mountall does not mount all swap partitions

Bug #435027 reported by David Gibson
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
mountall (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

I have two disks with a swap partition on each. Under Karmic, mountall only activates one, not both of them. This is annoying, because hibernate will not work without both mounted.

After a fresh boot:

mulberryst:~$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 2449872 0 -1
mulberryst:~$ sudo swapon -a
[sudo] password for dgibson:
mulberryst:~$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sdb5 partition 2449872 0 -1
/dev/sda5 partition 2449872 0 -2

mountall is version 0.1.7

affects: ubuntu → mountall (Ubuntu)
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Could you attach your /etc/fstab please?

Changed in mountall (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
Revision history for this message
David Gibson (dwg) wrote :

Certainly, fstab attached.

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

Thanks, and could you also attach the output of running "sudo blkid"

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

That's unusual.

Could you do the following for me:

 edit /etc/init/mountall.conf
 add --debug >/dev/mountall-stdout.log 2>/dev/mountall-stderr.log to the mountall command
 reboot
 attach both generated log files

Revision history for this message
David Gibson (dwg) wrote :

Ok, I've attached the stdout log. The stderr log is empty:

mulberryst:/dev$ ls -l /dev/*.log
-rw-r--r-- 1 root root 0 2009-09-26 13:16 /dev/mountall-stderr.log
-rw-r--r-- 1 root root 18928 2009-09-26 13:16 /dev/mountall-stdout.log

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

Thanks

This shows that the second swap partition is considered to "update" the first since they both have the same mountpoint ("none") - we should check non-device mountpoints, and swap partitions

Changed in mountall (Ubuntu):
status: Incomplete → Triaged
Changed in mountall (Ubuntu):
status: Triaged → In Progress
Changed in mountall (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

I've uploaded a new mountall package to the ubuntu-boot PPA:

https://launchpad.net/~ubuntu-boot/+archive/ppa

I would appreciate it if you could install this and try it out. *BEFORE* you reboot though, could you run "sudo mountall --debug > mountall.log 2>&1" and attach that to this bug - then after you reboot, let me know whether it worked or not.

Thanks

Revision history for this message
Ridgeland (rambutan1) wrote :

OUCH!
Now that partition will no longer boot.
I used Synaptic to add the ppa, saw the new version for mountall and installed it.
Before reboot I ran the mountall --debug command. Do you want all 288 lines? the last line was "mountpoint_ready: /" Want a grep filter of it? I edited out all but / in /etc/fstab but it still will not boot.
In an hour I take off for a two week vacation. Sorry about the timing. I cannot test until I get back but I can post the mountall.log if you want it.

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote : Re: [Bug 435027] Re: mountall does not mount all swap partitions

On Thu, 2009-10-08 at 13:07 +0000, Ridgeland wrote:

> OUCH!
> Now that partition will no longer boot.
> I used Synaptic to add the ppa, saw the new version for mountall and installed it.
> Before reboot I ran the mountall --debug command. Do you want all 288 lines? the last line was "mountpoint_ready: /" Want a grep filter of it? I edited out all but / in /etc/fstab but it still will not boot.
> In an hour I take off for a two week vacation. Sorry about the timing. I cannot test until I get back but I can post the mountall.log if you want it.
>
As I said, I would like the entire debug log.

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
Ridgeland (rambutan1) wrote :

OK Scott
It's on the attachment I hope.
Reviewing /etc/fstab to try to get it to boot again I saw I had swap sdb2 commented out at the time.

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

Sorry about the issues with the previous PPA versions, as usual things worked just fine when I tested it in the various rigs I have here - of course it flatly failed when installed on normal systems because I hadn't actually tested that ;)

I've uploaded a new ~boot4 version, this one feels much better (and I'm running it on my laptop now :p)

As before, after installing the package but *before* you reboot, please run with --debug and attach the log to the bug - then after rebooting, let me know how it works out.

Thanks for all your help with testing, this is a big change and it's good to know that it's now working for 95% of people and your help getting it work for the final 5% is greatly appreciated!

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mountall - 0.2.0

---------------
mountall (0.2.0) karmic; urgency=low

  [ Colin Watson ]
  * Always check the root filesystem if --force-fsck is used, regardless of
    passno. LP: #435707.

  [ Johan Kiviniemi ]
  * Have each fsck instance create a lock for each underlying physical device.
    If you have a single disk or RAID, all filesystem checks will happen
    sequentially in order to avoid thrashing. On more complex configurations,
    you’ll benefit from the parallel checks mountall has been doing all along.
    LP: #434974.

  [ Scott James Remnant ]
  * Flush standard output and error before spawning processes to make
    capturing logs easier (otherwise we end up repeating things still in
    the buffer), and before calling exec().
  * Turn the code upside down so that each mount knows what it's waiting
    for, and allow multiple dependencies. This makes the code much more
    readable putting the "policy" in a single function, and will make it
    much easier in future when this is done by Upstart.
  * For kernel filesystems listed in fstab, honour the order that they
    are listed in fstab. LP: #432571, #433537, #436796
  * Always create new swap partition mounts for each fstab entry, don't
    treat them as updating the same. LP: #435027.
  * Virtual filesystems under local or remote filesystems (and local under
    remote) don't delay the virtual or local events. LP: #431040.
  * Simplify event emission, this has the advantage that we can now output
    what mount points we're waiting for and what they are waiting for as
    well.
  * Fixed issue with trailing slashes. LP: #443035.
  * Only run hooks if the filesystem was not already mounted. LP: #444252.
  * Don't clean up /tmp when run without --tmptime argument.
  * Ignore loop and ram devices until ready. LP: #441454.
  * Add options to binfmt_misc filesystem, which will probably cause it to
    be mounted on boot as well.
  * Synchronously mount local and virtual filesystems, I suspect this is
    the real cause behind the XFS races as one will modprobe and the other
    will not (and fail). LP: #432620.
  * Synchronously activate swap to avoid out of memory issues when checking
    the root filesystem.
  * Enumerate existing udev devices on startup, so we don't always have to
    see udev be coldplugged.
  * Don't break on general errors for non-essential filesystems.
    LP: #441144.
  * Don't repeat attempts to mount a filesystem without having first
    succeded to mount another.
  * Still restart mountall even if the recovery shell fails.
  * Don't queue filesystem check when device is "none", or missing, or the
    filesystem is marked nodev.
  * Generate a "mount" event before mounting a filesystem, and wait for its
    effects to complete.

 -- Scott James Remnant <email address hidden> Fri, 09 Oct 2009 16:50:46 +0100

Changed in mountall (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
David Gibson (dwg) wrote :

Well. The new mountall might be mounting all the swap partitions. But since it fails to boot on my machine, it's kind of hard to tell. It looks very much as if my system is triply broken currently.

My most recent kernels don't even get out of the ramfs, looks like the update-initramfs is broken (again) so that it triggers a "PANIC: Circular dependency" error.

My older kernel which doesn't seem to have had the ramfs rebuilt broken gets into init proper, but first drops to a root password prompt when it dies with a "cannot remove /forcefsck: Read-only filesystem". If I log in and remount / read-write, I get "mountall start/starting" then nothing.

mountall really, seriously should have some sort of timeout and drop to a shell if it's unable to mount all the things it thinks it needs to. As it stands debugging this is astonishingly painful.

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

On Sat, 2009-10-10 at 11:13 +0000, David Gibson wrote:

> Well. The new mountall might be mounting all the swap partitions. But
> since it fails to boot on my machine, it's kind of hard to tell. It
> looks very much as if my system is triply broken currently.
>
Can you get a debug log please?

> mountall really, seriously should have some sort of timeout and drop to
> a shell if it's unable to mount all the things it thinks it needs to.
> As it stands debugging this is astonishingly painful.
>
Actually, I was going for a message stating which filesystems it's
waiting for and the ability to press a key to interrupt and get a shell.

That's in the branch with the rest of the usplash-related bits (fsck
progress, etc.) - I'm trying to get the bugs fixed first ;-)

Scott
--
Scott James Remnant
<email address hidden>

Revision history for this message
David Gibson (dwg) wrote :

Well, that approach sounds reasonable. However it seems odd to me to postpone a feature which will make it substantially easier to analyse and workaround bugs until after you've fixed the bugs.

I think the current mountall brokenness is the one I've reported in bug 44794. The "Can't remove /forcefsck" is because mountall dies due to bug 44794, then its post-stop action attempts to remove /forcefsck, but since mountall hasn't actually completed, / is still read-only. Seems like that post-stop should only be post a successful completion.

I can't check much else about mountall right now, because my latest kernels (both Ubuntu and home-built) currently don't get out of the initramfs, due to initramfs-tools bugs.

Revision history for this message
David Gibson (dwg) wrote :

Well, the good news is that after working around the various other booting problems I've had, it does appear that all my swap partitions are now being mounted. So it looks like this bug can be closed.

Revision history for this message
Ridgeland (rambutan1) wrote :

Installed 9.10 RC
Both swap partitions are used (sda2 and sdb2 each 2GB)
:)

Revision history for this message
bastafidli (ubuntu-bastafidli) wrote :

This is not fixed if both of the swap partitions are encrypted. I am not sure if this is the same bug or different bug (e.g. https://bugs.launchpad.net/ubuntu/+source/mountall/+bug/571682). My root partition is on 2 disks using RAID 1 using mdraid and is encrypted using LUKS. Each of these disks contains also swap partition which is encrypted but not configured using mdraid since kernel doesn't need it.

In my /etc/fstab I have

/dev/mapper/sda2_crypt none swap sw 0 0
/dev/mapper/sdb2_crypt none swap sw 0 0

In my /etc/crypttab I have

/dev/mapper/sda2_crypt none swap sw 0 0
/dev/mapper/sdb2_crypt none swap sw 0 0

Only of these partitions is mounted upon start. The other one is not mounted nor decrypted.

Revision history for this message
bastafidli (ubuntu-bastafidli) wrote :

I just verified this bug is still present on fully updated maverick but it is a timing issue. I have following encrypted partitions

/dev/mapper/md1_crypt on / type
/dev/mapper/md2_crypt on /home
/dev/mapper/sda2_crypt none swap sw 0 0
/dev/mapper/sdb2_crypt none swap sw 0 0

plymouth asks me for passphrases in following order

1. md1_crypt
2. sda2_crypt
3. sdb2_crypt
4. md2_crypt

If I do not enter password for #3 fast enough, I get message that home is not present and even though when I enter password for it looks like is #3 it gets applied to #4. Then /home directory is mounted and the second swap partition is never decrypted and mounted.

Revision history for this message
bastafidli (ubuntu-bastafidli) wrote :

I also had to apply following workaround to get the plymouth display correctly on my graphics card
https://bugs.launchpad.net/ubuntu/+source/plymouth/+bug/563878

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.