2 swap partitions each mounted twice in 2.6.20-8

Bug #86234 reported by Thomas Templin
Affects Status Importance Assigned to Milestone
linux-source-2.6.20 (Ubuntu)
Won't Fix

Bug Description

Binary package hint: linux-source-2.6.20

After bootup a 'swapon -s' shows:


This always results in a system crash only a few minutes after loged in to a GNOME session!

But when I do a 'swapoff -a' followed by a 'swapon -a' a 'swapon -s' shows:


And the system doesn't crash after log in to a GNOME session, using a lot of swap (~600MB).
Kernel 2.6.20-8-generic and lowlatency

Revision history for this message
Kyle McMartin (kyle) wrote :

Yes, having two instances of the same swap partition would be problematic. Can you please paste or attach (in seperate attachments please) the output of the following:

While you have the multiple swap devices:
dmsetup ls
dmsetup info
cat /etc/fstab


Changed in linux-source-2.6.20:
assignee: nobody → kyle
status: Unconfirmed → Needs Info
Revision history for this message
Thomas Templin (coastgnu) wrote :
Revision history for this message
Thomas Templin (coastgnu) wrote :
Revision history for this message
Thomas Templin (coastgnu) wrote :
Revision history for this message
Thomas Templin (coastgnu) wrote :

grep -v ^# /etc/fstab

proc /proc proc defaults 0 0
none /proc/bus/usb usbfs defaults 0 0
UUID=1b95fc8e-2fed-4ff6-a727-917f9ce9bb97 / ext3 defaults,errors=remount-ro,user_xattr,acl 0 1
UUID=4683d8da-a917-4b5d-8b4f-03f3f3ad2936 /data ext3 defaults,user_xattr,acl 0 2
UUID=96ff845c-1af0-4c42-a7fa-c8868ea8e59c /home xfs defaults 0 2
UUID=0130e7ef-9add-44ca-9110-0db346af1ef3 /opt xfs defaults 0 2
UUID=361d04ca-d197-419a-89cf-8a1121dddbe6 /var ext3 defaults,user_xattr,acl 0 2
UUID=27991276-db58-4ec1-a999-17dd4b3cd3bb none swap sw,pri=2 0 0

UUID=6c26c5be-d9c5-4b5c-b284-c0b1001c6760 none swap sw,pri=2 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/cdrw /media/cdrom1 udf,iso9660 user,noauto 0 0

Revision history for this message
Scott Hilleard (scottles-deactivatedaccount) wrote :

I have noticed that my system has the same problem (currently running the 2.6.20-14-generic kernel). The swap is only listed once in my fstab, yet gets mounted twice (as shown by swapon -s):

Filename Type Size Used Priority
/dev/sda1 partition 4883720 0 -1
/dev/mapper/sda1 partition 4883720 0 -2

Revision history for this message
Sod75 (launchpad-net-vernaillen) wrote :

same issue here on 2.6.20-15-generic

after a swapoff -a and a swapon -a it's only listed once

Changed in linux-source-2.6.20:
status: Needs Info → Confirmed
Revision history for this message
Thomas Templin (coastgnu) wrote :

In [gutsy] this bug is fixed I asume by dbus 1.0.2-5ubuntu1 (23.may.07)

In [feisty] the bug still exists

 dbus (1.0.2-5ubuntu1) gutsy; urgency=low
   * Merge with Debian unstable; remaining Ubuntu changes:
     - debian/patches/80-dbus-change-at-console-policy.patch: Make at_console
       policy work with libpam-foreground.
     - debian/patches/81-session.conf-timeout.patch: Raise the service startup
       timeout from 25 to 60 seconds. It may be too short on the live CD with
       slow machines.
     - debian/rules: Start dbus at runlevel priority 12, so that it comes
       before gdm. This eliminates the race condition of starting the X session
       before hal is running. Also use 'multiuser' mode of update-rc.d.
     - debian/dbus.postinst: Migrate rc?.d symlinks from 20 to 12 on upgrades
       to this version. This needs to be kept until the next Ubuntu LTS.
     - debian/dbus.{postinst,prerm}: Reverted Debian's change to always restart
       dbus on upgrades.
   * debian/control: Drop dbus dependency to dbus-x11, since we crave to get
     rid of that Xsession.d script. (LP: #62163)
   * debian/dbus.preinst: Improve rm_conffile() to get the unmodified md5sum
     from dpkg instead of hardcoding it, and remove unchanged
     /etc/X11/Xsession.d/75dbus_dbus-launch on upgrade.
 dbus (1.0.2-5) unstable; urgency=low
   [ Michael Biebl ]
   * debian/dbus.init
     + Add some safety checks and support for file-rc. (Closes: #419984)
   * Drop dbus-1-utils package and move dbus-monitor into the dbus package.
     (Closes: #404981)
   * Create dbus-x11 package and move dbus-launch and the Xsession start script
     from dbus into this package. This removes the X11 dependency from the dbus
     Add a dependency on dbus-x11 to the dbus package, to not break packages
     which still depend on dbus but should be updated to depend on dbus-x11
     instead if they require a D-Bus session bus.
   [ Sjoerd Simons ]
   * debian/control: Add libselinux1-dev to build depends
   * debian/rules: Clean up some more generated files (From the ubuntu

Revision history for this message
otzenpunk (reisswolf-nospam) wrote :

Replacing the UUID in the fstab with the "real" devicename á la /dev/sda2 fixes this problem for me, too.

The swapon command is called twice during the boot process. Once in checkroot.sh and once in mountall.sh, the latter because:

        # Execute swapon command again, in case we want to swap to
        # a file on a now mounted filesystem.

This shouldn't be a problem, because swapon -a normally ignores partitions that are already activated.

The following is my speculation: I think for some reason the /dev/mapper-devices aren't present at the time of the first swapon, so the regular device belonging to the UUID get's activated. When swapon gets executed the second time, the /dev/mapper-device is present and is going to be used, when the translation UUID->device is performed. As the /dev/mapper-device isn't in the swap -list yet, it's going to get activated although the underlying partition is already running under a different name.

Revision history for this message
otzenpunk (reisswolf-nospam) wrote :

Just backed up my theory a little bit.

I dumped swapon -s into a file near the end of checkroot.sh and confirmed that there was only one swap entry (/dev/sda9) at this time. When the system was fully up and running, there were the two entrys with and without 'mapper' again.

Revision history for this message
Thomas Templin (coastgnu) wrote :

I can confirm this, replacinf UUID with the /dev entry in fstab works.

Also replacing dbus from 7.04 Feisty with dbus (1.0.2-5ubuntu1) gutsy does the job.
So updating feisty with the gutsy dbus package will be a solution for a bugfix upgrade.

So we have two solutions now to fix this bug + updating dbus will be a solution for novice users by offering an unattended upgrade via update-manager.

Kyle, it's your turn now, I would say. :-)

Revision history for this message
taj (othertaj) wrote :

Just to keep the last post alive:
I also have this problem, and I know how to work around it.

But... The fix is known for more than a month now, so how many more time is needed (and novice users put off) before the update?

Changed in linux-source-2.6.20:
assignee: kyle → ubuntu-kernel-team
importance: Undecided → Medium
status: Confirmed → Triaged
Revision history for this message
Michael R. Head (burner) wrote :

This seems to have been fixed in gutsy. I can now use the UUID form in /etc/fstab for my swap partition.

Tim Gardner (timg-tpi)
Changed in linux-source-2.6.20:
status: Triaged → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote : Kernel team bugs

Per a decision made by the Ubuntu Kernel Team, bugs will longer be assigned to the ubuntu-kernel-team in Launchpad as part of the bug triage process. The ubuntu-kernel-team is being unassigned from this bug report. Refer to https://wiki.ubuntu.com/KernelTeamBugPolicies for more information. Thanks.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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