Page 1 of 1
Swap partition gone
Posted: 17 Jan 2008, 17:41
by juicer
Hi,
I have somewhat of a problem; I started getting out of memory errors and quickly discovered that my total swap size was 0 kb. There doesn't seem to be a swap partition at all! It looks as if there is some problem with the disk. For example, when running cfdisk i get "FATAL ERROR: Cannot open disk drive - Press any key to exit cfdisk".
I don't have any idea what might have caused this. Can I recreate the swap partition somehow or do I have to perform a complete re-install? Can you help me out?
Thanks in advance!
juicer
Posted: 19 Jan 2008, 14:11
by tor
Hi Juicer,
Could you give me the output of
and
/Tor
Posted: 21 Jan 2008, 10:39
by juicer
Code: Select all
bubba:~# cat /proc/partitions
major minor #blocks name
3 0 312571224 hda
3 1 311532448 hda1
3 2 1036192 hda2
31 0 66 mtdblock0
31 1 1584 mtdblock1
31 2 462 mtdblock2
bubba:~# ls -l /dev/hda*
ls: /dev/hda*: No such file or directory
bubba:~#
This might have been a result of a upgrade gone wrong. I actually didn't notice it first. But I am at a loss on what to do about it...

Posted: 21 Jan 2008, 11:38
by Ubi
juicer wrote:
This might have been a result of a upgrade gone wrong. I actually didn't notice it first. But I am at a loss on what to do about it...

That isn't really possible as the first command shows that you are using hda. And the fact you can actually log in to the machine shows that something is mounted...
What does
return?
Posted: 21 Jan 2008, 16:48
by juicer
Code: Select all
bubba:~# mount
/dev/hda1 on / type ext3 (rw,noatime)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/var/samba/public on /home/storage type none (rw,bind)
/var/www/html on /home/web type none (rw,bind)
bubba:~#
Posted: 22 Jan 2008, 06:48
by Ubi
right
So you do have /dev/hda1
This means there's basically two reasons why your "ls -l /dev/hda*" failed. Either your /dev/ is corrupted, or something went wrong with the command. Please check by going into dev (cd /dev) and enter "ls" to see what is there, and if it includes hda1 and hda2 ("ls | grep hda" may speed things up)
But all this is pretty academic, as it does nothing to solve. Here's a possible solution:
first verify the swap part is in your system:
it should return something like this:
ok, now check if the swap partition is active:
Code: Select all
[root@korona:/root]$ cat /proc/swaps
Filename Type Size Used Priority
/dev/hda2 partition 1036184 12712 -1
Another way to check is using the 'free' command:
Code: Select all
[root@korona:/root]$ free
total used free shared buffers cached
Mem: 126940 118216 8724 0 2876 71600
-/+ buffers/cache: 43740 83200
Swap: 1036184 12712 1023472
Assuming nothing is returned, now manually turn on the swap using the swapon command
First RTFM:
then test by turning on swap:
It should then either crash or work
btw, all the above commands must of course be executed as root
Posted: 22 Jan 2008, 14:27
by juicer
Thanks a lot for your help, Ubi! Here is the output from the commands you suggested:
Code: Select all
bubba:~# cat /etc/fstab | grep swap
/dev/hda2 none swap sw 0 0
bubba:~# cat /proc/swaps
bubba:~# free
total used free shared buffers cached
Mem: 62020 57368 4652 0 20976 15916
-/+ buffers/cache: 20476 41544
Swap: 0 0 0
bubba:~# swapon -a -v
swapon on /dev/hda2
swapon: cannot stat /dev/hda2: No such file or directory
bubba:~#
Posted: 22 Jan 2008, 17:12
by Ubi
Well, that outcome shows your swap cannot be activated. This could even mean that your partition table is hosed, which is a very serious problem.
Now there's a few other tests that can be conducted. This includes running partition tools and low level disk checking. For me this is difficult to help out via a forum. Maybe I missed something and somebody else has a suggestion, but my suggestion would be, if the product in still within warranty, to contact the excito helpdesk. You may need to reinstall the bubba software (as the new OS is coming this is not even such a bad idea) or your HD needs replacing.
Ubi
Posted: 23 Jan 2008, 04:47
by tor
Hi,
Its very strange that
/proc/partitions says that you have a
hda2 (swap) partition. But the device node,
/dev/hda2, is missing.
I assume that you have tried to restart your Bubba? It could be some problems with udev, the "device manager".
Could you give me the output of
It should look something like
Code: Select all
1148 ? S<s 0:00 udevd --daemon
4145 pts/1 R+ 0:00 grep udev
/Tor
Posted: 23 Jan 2008, 08:44
by juicer
Thanks Tor. This helped me out!
I didn't have udev up and running and it actually seemed that the udev package was missing completely (maybe from the previous failed upgrade). I re-installed it and got warnings that there was also a problem with the portmap package which was automatically resolved by apt-get. After a reboot, my swap is back in business and eveything seems to work. I still don't have the udevd process running, though...
Code: Select all
bubba:~# ps ax | grep udev
1584 pts/0 S+ 0:00 grep udev
bubba:~# apt-get update
Hit http://update.excito.net bubba/main Packages
Hit http://update.excito.net bubba/main Release
Hit http://ftp.se.debian.org sarge/main Packages
Hit http://ftp.se.debian.org sarge/main Release
Reading Package Lists... Done
bubba:~# apt-get install udev
Reading Package Lists... Done
Building Dependency Tree... Done
The following extra packages will be installed:
portmap
The following NEW packages will be installed:
udev
The following packages will be upgraded:
portmap
1 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 232kB/255kB of archives.
After unpacking 815kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://ftp.se.debian.org sarge/main udev 0.056-3 [232kB]
Fetched 232kB in 0s (573kB/s)
(Reading database ...
dpkg: serious warning: files list file for package `portmap' missing, assuming package has no files currently installed.
17962 files and directories currently installed.)
Preparing to replace portmap 5-9 (using .../archives/portmap_5-9_arm.deb) ...
Unpacking replacement portmap ...
Selecting previously deselected package udev.
Unpacking udev (from .../archives/udev_0.056-3_arm.deb) ...
Setting up portmap (5-9) ...
Starting portmap daemon: portmap.
Setting up udev (0.056-3) ...
and now, after a reboot:
Code: Select all
bubba:~# cat /proc/partitions
major minor #blocks name
3 0 312571224 hda
3 1 311532448 hda1
3 2 1036192 hda2
31 0 66 mtdblock0
31 1 1584 mtdblock1
31 2 462 mtdblock2
bubba:~# s -l /dev/hda*
-su: s: command not found
bubba:~# ls -l /dev/hda*
brw-rw---- 1 root disk 3, 0 1970-01-01 01:00 /dev/hda
brw-rw---- 1 root disk 3, 1 1970-01-01 01:00 /dev/hda1
brw-rw---- 1 root disk 3, 2 1970-01-01 01:00 /dev/hda2
bubba:~# cat /etc/fstab | grep swap
/dev/hda2 none swap sw 0 0
bubba:~# cat /proc/swaps
Filename Type Size Used Priority
/dev/hda2 partition 1036184 28168 -1
bubba:~# free
total used free shared buffers cached
Mem: 62020 59252 2768 0 488 44976
-/+ buffers/cache: 13788 48232
Swap: 1036184 28168 1008016
bubba:~# ps ax | grep udev
1599 pts/0 S+ 0:00 grep udev
Posted: 23 Jan 2008, 15:53
by Ubi
Good call Tor
Can you give a hint on what the hell happended to his system, as I would have called it a physical HardDisk problem
Ubi
Posted: 23 Jan 2008, 16:12
by tor
Hi,
Juicer, my fault on the udev part. The ps command wont show anything on Bubba. It runs in another way than on Debian Etch where i looked.
The reason this failed seemed to be that udev, the application responsible for creating device nodes, such as
/dev/hda2, for devices in the system (The replacement for devfs), somehow got lost. Seeing the line:
Code: Select all
The following NEW packages will be installed:
udev
Which is wrong since udev already should be installed. Why this happened i have no idea.
/Tor
Posted: 24 Jan 2008, 03:32
by Ubi
Selecting previously deselected package udev.
This suggests to me the udev has been actively removed by something, but I'm no expert on apt.
Posted: 24 Jan 2008, 03:48
by juicer
Thanks to both of you! Much appreciated!
Still, I feel that a complete re-install might be a good thing. But with the swap up and running I can wait until the debian etch release.
/Juicer
Posted: 24 Jan 2008, 06:49
by Eek
Hi
I looked at my own system and found the same problem, no swap.
Had everything setup minimized enough not experience any memory problems.
Ubi, you are correct. I have tried some packages and one of them deinstalled udev.
I don't know which one any more, maybe when i tried to get gmailfs working.
So taking the problem as an opportunity to upgrade to etch.
cheers
Eek