SWAP doesn't work in Ubuntu
I am not sure what the problem is. I noticed it for the first time when I did an HD install fo Knoppix and it shared the swap partition with Ubuntu. A little while ago I tried to do an HD install of Dreamlinux.
Now my swap does not work in Ubuntu unless I manually mount it. It worked fine before. I treformated it as swap to in the hopes that would work but it does the same thing still. I manually mount it with gparted which shows it as swapoff until I change it. If this helps at all, here is the gdesklet error I get, and it shows swap as 0/0 until I manually mount it. float division /usr/share/gdesklets/Displays/sidecandy-ram/SideCandyRAM.display 24 25 def get_mem(): 26 Dsp.swap_used.value = "%s / %s" %(mem_format(sys.swap.used),mem_format(sys.swap.total)) 27 Dsp.memory_used.value = "%s / %s / %s" %(mem_format(sys.memory.used- sys.memory.cached- sys.memory.buffer),mem_format(sys.memory.used),mem_format(sys.memory.total)) 28 Dsp.gauge_mem.fill = int((sys.memory.used/float(sys.memory.total))*100) > 29 Dsp.gauge_swap.fill = int((sys.swap.used/float(sys.swap.total))*100) 30 Dsp.gauge_mem_true.fill = int(((sys.memory.used-sys.memory.cached- sys.memory.buffer)/float(sys.memory.total))*100) 31 Dsp.show_ram.value = mem_load(var_a,var_b) 32 add_timer(refresh, get_mem) 33 34 add_timer(0, get_mem) 35 |
Go trough your initscripts and see why swapon is not run.
|
Does your /etc/fstab still match your actual partitions?
You might want to show us the output of Code:
grep swap < /etc/fstab |
Quote:
UUID=f2ec5e35-9837-4677-8a77-5c3546f7c6d4 none swap sw 0 0 $ sudo fdisk -l | grep swap /dev/hda1 1 122 979933+ 82 Linux swap / Solaris I currently have the swapon. As I said it works fine when I manually mount it, cat /proc/meminfo SwapTotal: 979924 kB SwapFree: 979924 kB Until I manually mount it I get SwapTotal: 0 kB SwapFree: 0 kB Edit: Shouldn't "none" in the fstab line be "swapon" ? Edit Edit: Nope didn't help. |
Code:
grep swap < /etc/fstab Code:
grep swap /etc/fstab Quote:
|
Quote:
No. Everything is where it is suppose to be. I am just lost why this is happening. Its always been like this for hda, hdb1, hdb2 and sda1. hdb3, sda2 and sda3 are the ones I use to play around with other os's. Sda2 will always be for DesktopBSD. /dev/hda1 swap /dev/hda2 boot /dev/hda3 / dev/hda4 var /dev/hdb1 home /dev/hdb2 xp /dev/hdb3 (Empty partition currently, may just expand xp and get rid of hdb3) /dev/sda1 disk (storage) /dev/sda2 (Empty partition currently. Going to reinstall DesktopBSD with the latest version.) /dev/sda3 (Empty for now, will have some Linux os there soon..) Edit: here is fstab # /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 # /dev/hda3 UUID=3d9d448d-e454-4fa6-90b3-da717e691648 / ext3 defaults,errors=remount-ro 0 1 # /dev/hda2 UUID=dab28c96-19d1-4112-a55d-fd7d4209f236 /boot ext3 defaults 0 2 # /dev/hdb1 UUID=5e530f29-bff3-496e-997b-836d8490f4ed /home ext3 defaults 0 2 # /dev/hda4 UUID=8783fe31-bfc9-437e-a66a-64fbf23ce849 /var ext3 defaults 0 2 # /dev/hda1 UUID=f2ec5e35-9837-4677-8a77-5c3546f7c6d4 none swap sw 0 0 /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/sda1 /media/disk ext3 rw,noexec,nosuid,nodev 0 0 # /dev/sda3 /media/DesktopBSD ufs auto,ro,ufstype=ufs2,nodev,nosuid 0 0 # /dev/sda2 /media/Knoppix ext3 rw,noexec,nosuid,nodev 0 2 /dev/hdb2 /media/WinXP ntfs-3g default 0 0 # /dev/hdb3 /media/DSL ext3 defaults 0 2 # Generated by Automatix ## End of Automatix mounted partitions Here is mtab, /dev/hda3 / ext3 rw,errors=remount-ro 0 0 proc /proc proc rw,noexec,nosuid,nodev 0 0 /sys /sys sysfs rw,noexec,nosuid,nodev 0 0 varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0 varlock /var/lock tmpfs rw,noexec,nosuid,nodev,mode=1777 0 0 procbususb /proc/bus/usb usbfs rw 0 0 udev /dev tmpfs rw,mode=0755 0 0 devshm /dev/shm tmpfs rw 0 0 devpts /dev/pts devpts rw,gid=5,mode=620 0 0 lrm /lib/modules/2.6.20-16-generic/volatile tmpfs rw 0 0 /dev/hda2 /boot ext3 rw 0 0 /dev/hdb1 /home ext3 rw 0 0 /dev/hda4 /var ext3 rw 0 0 /dev/sda1 /media/disk ext3 rw,noexec,nosuid,nodev 0 0 /dev/hdb2 /media/WinXP fuseblk rw,nosuid,nodev,noatime,allow_other,blksize=4096 0 0 binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0 |
Also after I installed Both Knoppix and DreamLinux when I booted Ubuntu it would stop booting and I would get an error saying that I needed to use apt-get to install xinit or something to do with that. I had to use ctrl and D to continue booting normally. I don't get that error anymore, but that is when the swap stopped work automatically. (don't know if any of this is actually related at all.)
|
I am getting frustrated. I have looked all over, including Google and LQ. I can't find any info on this. This makes no sense.
|
Sounds like the UUID might have changed - check /dev/disk/by-uuid.
Personally I would check dmesg to see why the init-script mount is failing, and probably change fstab (back) to using the dev address. Some of the decisions made by the Ubuntu devs are hard to fathom - especially in a test/multi-boot environmnet. |
Quote:
Your timing is perfect. I found this at the Ubuntu Wiki, I followed it to step 4 when an error message came up. Steps I took, 1) cfdisk : erase the old Swap partition and recreate a new one 2) reboot (mandatory) 3) mkswap /dev/hda1 4) swapon -a After reboot step 3 appears to work, $ sudo mkswap /dev/sda1 Setting up swapspace version 1, size = 133372878 kB no label, UUID=8a11872c-2021-49aa-9c00-d2baf34f576c This is the error message I get when I try step 4 "swapon -a" ~$ swapon -a swapon: cannot stat /dev/disk/by-uuid/f2ec5e35-9837-4677-8a77-5c3546f7c6d4: No such file or directory |
The only thing I changed in fstab, after I made a backup of it, is the swap line,
/dev/hda1 swap swap 0 0 The swap works fine now but now my sda1 won't Auto Mount, XP (hdb1) does however. |
found my error! I will list it after.
|
Well because of the screw up with Ubuntu and the swap, I made a type when I did mkswap and lost all my most IMPORTANT information when I put in, by accident, mkswap /dev/sda1 instead of mkswap /dev/hda1
I am making a new thread on this. I need that data back...... New thread is http://www.linuxquestions.org/questi...82#post2840082 (By the way I got the swap to work by cutting and pasting the new uuid into fstab.) |
While I am working on MY MAJOR SCREW UP, I thought I would post what I did in order.
Like I said above I did the steps at the Ubuntu Wiki. 1) cfdisk : erase the old Swap partition and recreate a new one 2) reboot (mandatory) 3) mkswap /dev/hda1 Step 4 does not work. Now after mkswap I got this, Setting up swapspace version 1, size = 133372878 kB no label, UUID=8a11872c-2021-49aa-9c00-d2baf34f576c So I took the UUID=8a11872c-2021-49aa-9c00-d2baf34f576c and replaced the one that was in fstab. Then all worked fine, well except for my mistake with /dev/sda1. I still don't know what happened to cause this problem in Ubuntu except that when I installed Knoppix and then DreamLinux it was sharing the same swap space as Ubuntu, which is when the problems started, nothing else was done before that. |
What probably happened is one of those Distros (either Knoppix or DreamLinux) reformatted your swap partition. When it was reformatted it would have then got a new UUID. Then when Ubuntu tried to activate the swap partition by giving the UUID it would have given the old one, and so it wasn't found.
I hope that goes some way to explaining it to you. |
All times are GMT -5. The time now is 04:14 AM. |