swapon with a UUID adds both physical device and evms mapped device

Bug #103899 reported by asubedi
This bug report is a duplicate of:  Bug #96715: double swap space usage. Edit Remove
16
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
High
Scott James Remnant (Canonical)

Bug Description

Fiesty does not seem to use my swap partition. Instead, it seems to be using some swap file. The swap partition entry in my /etc/fstab is:

# /dev/hda2 -- converted during upgrade to edgy
UUID=70f18355-44d8-4a74-a737-6bd5933a1bb9 none swap sw,auto 0 0

The partition /dev/hda2 is approx 2Gb. However, when I do $free -m I get:

Swap: 3812 0 3812

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda2 partition 1951888 0 -1
/dev/mapper/sda2 partition 1951888 0 -2

After turning off the swap using swapoff -a, and then turning it again using swapon -a, the free command gives me:

Swap: 1906 0 1906

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/mapper/sda2 partition 1951888 0 -3

After a restart, the swap partition is not used. Why isn't Feisty using my swap partition?

Also note that 3812 = 2 * 1906.

Revision history for this message
Ralph Janke (txwikinger) wrote :

Thanks for reporting this problem report.

Free -m with the result of 1906 is almost 2G. So that would be correct. It uses 0 after the reboot so all 1906 is available. It will not use swap unless all the physical memory is used up, then it will start to use swap.

Could you please explain what indicates to you that after the reboot the swap is not used at all?

Thanks

Revision history for this message
Brian Murray (brian-murray) wrote : [Bug 103899] swap partition is not used

Thanks for taking the time to report this bug and helping to make Ubuntu
better. Could you confirm the volume id of your swap partition using the
vol_id command? Thanks in advance.

 status needsinfo
 assignee <email address hidden>

Revision history for this message
asubedi (asubedi) wrote : Re: swap partition is not used

$vol_id /dev/sda2 gives me

ID_FS_UUID=70f18355-44d8-4a74-a737-6bd5933a1bb9

Which is what I have in /etc/fstab.

To txwikinger:

Just after reboot free -m says that my swap space is around 4Gb. However, my swap partition is only 2Gb.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This seems to be the "swapon activates both the real swap, and the evms-created /dev/mapper swap" bug

Changed in util-linux:
assignee: nobody → keybuk
Revision history for this message
clever (clever-nbnet) wrote :

when i upgraded from 6.10 to 7.04 i noticed that i had double the normal swap
my /dev/hda5 partition was 'missing'
and /dev/sda5 and /dev/evms/sda5 where both mounted as swap
and the fstab was set to use uuid for both root and swap
i changed the fstab to use just /dev/sda5 and it fixed it until today
my system went back to /dev/hda5 without warning leaving me without swap and it took 10mins to get a term open to reenable it:P

uuid swap should either just use the first match or find some way to detect dup devices going to the same partition

Revision history for this message
Francisco Javier Saavedra Plominsky (kuroyume) wrote :

Same bug applies to me. I run Kubuntu Feisty, with 2 gigs of RAM and 4 gigs swap

free -m after boot gives:

Swap: 8189 0 8189

swapon -s:

Filename Type Size Used Priority
/dev/sda2 partition 4192956 92 -1
/dev/mapper/sda2 partition 4192956 0 -2

Revision history for this message
Marco Gaiarin (marcogaio) wrote :

Same things to me, just upgraded to feisty, on two box.
The PC at work pose no or little problem (it took to me a bit to use all 1Gig RAM + 2GB Swap) but on my portable system (IBM Thinkpad T23) it is rather easy to fill 256+512MB of RAM... and i imagine that when linux kernel start to fill the second swap that is the same of the first... BANG! ;(

root@aurora:~# swapon -s
Filename Type Size Used Priority
/dev/sda2 partition 522104 33756 -1
/dev/mapper/sda2 partition 522104 0 -2
root@aurora:~# grep swap /etc/fstab
UUID=239e8d4b-202c-435d-bac4-8a556ea44ccb none swap sw 0 0
root@aurora:~# vol_id -u /dev/sda2
239e8d4b-202c-435d-bac4-8a556ea44ccb
root@aurora:~# swapoff -a
root@aurora:~# swapon -a
root@aurora:~# swapon -s
Filename Type Size Used Priority
/dev/mapper/sda2 partition 522104 0 -3

If is known some sort of circumvent to prevent at least crashes... say me.

Thanks.

Revision history for this message
Francisco Javier Saavedra Plominsky (kuroyume) wrote :

you can do:

sudo swapoff -a

and then

sudo swapon -a

that will fix the problem, but you will have to do it every time you boot

Revision history for this message
rs13tux (roland-saibold) wrote :

I have also the same problem:

First, after i updated from edgy to feisty i had no swap at all, because the UUID in /etc/fstab was a wrong one.
I fixed this, by putting the correct UUID from the command "vol_id".

After rebooting i have now the double size of physical swap shown by the command free.

"swapoff -a" and "swapon -a" fix this bug for one time.

Revision history for this message
rs13tux (roland-saibold) wrote :

Now i found a solution that works for me:

I´ve just used the old device-name e.g. /dev/hda5 instead of the UUID in /etc/fstab. Now when i boot the system, swap seems to be correctly mounted once.

Revision history for this message
Håkon A. Hjortland (post-hakn) wrote :

Same problem here.

This fixed it for me:
sudo aptitude remove evms evms-ncurses libevms-2.5

Revision history for this message
Gasc Ludovic (gmludo) wrote :

I confirm this problem : bug #112876
My computer becomes crazy when the first swap is full.

Do somebody work to find the good solution to fix this ?

Thanks for your response.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.