Routine fsck deactivates swap, changing UUID

Bug #90526 reported by Matthew Paul Thomas on 2007-03-08
46
This bug affects 2 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
High
Unassigned

Bug Description

Ubuntu 6.10, all updates installed

On starting up my computer, Ubuntu began a routine fsck (30 startups since the previous one). Once it had done that, it failed to mount the swap partition, and neither "swapon -a" nor restarting could bring it back.

Fabian Rodriguez helped me diagnose the problem. /etc/fstab said:
proc /proc proc defaults 0 0
# /dev/hda1 -- converted during upgrade to edgy
UUID=08cd8430-653a-450c-bc50-c5efb9f4030c / ext3 defaults,errors=remount-ro 0 1
# /dev/hda5 -- converted during upgrade to edgy
UUID=cab9c968-fa2b-4e0a-a307-6603cb713f06 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0

But "ls -l /dev/disk/by-uuid" said:
total 0
lrwxrwxrwx 1 root root 10 2007-03-08 09:55 08cd8430-653a-450c-bc50-c5efb9f4030c -> ../../hda1
lrwxrwxrwx 1 root root 10 2007-03-08 09:55 2b2b6707-dbf9-4388-948c-5a05f4d3bbb6 -> ../../hda5

After editing /etc/fstab so that the hda5 partition matched that given by /dev/disk/by-uuid, "swapon -a" worked.

What was expected: fsck either should not change the UUIDs of partitions, or should change them in fstab too.

This is not a duplicate of bug 66637, because I haven't run "mkswap" in the past year or so.

Fabián Rodríguez (magicfab) wrote :

Can someone confirm the package affected ?

Matthew Paul Thomas (mpt) wrote :

(Not Needs Info unless you have a specific question that only someone suffering the bug can answer.)

Changed in util-linux:
status: Needs Info → Unconfirmed
Albert Cardona (cardona) wrote :

I confirm this. It's happening all the time in a Thinkpad T60 with Edgy dist-upgraded.

I confirm this too.
In fact, I just realized after reading this that it occured after the routine fsck. But that seem consistant with what I saw.
I had this problem in Edgy, and now in Feisty.

Scott, Kurt says you get this - feel free to reassign

Changed in util-linux:
assignee: magicfab → keybuk
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Colin Watson (cjwatson) wrote :

Presumably the title of this bug should be "fsck", not "fdisk"? I'm hoping we don't do a routine fdisk. :-)

description: updated
description: updated
Fabián Rodríguez (magicfab) wrote :

Ooops! My MS days come back to betray me. Tx. for changing it.

Changed in util-linux:
importance: Medium → High
Cruncher (ubuntu-wkresse) wrote :

Mostly confirmed.
It seems in my case there also seemed to have been a fsck running just before that happened, however, it was definitely not a routine fsck. (shouldn't a fsck of the root-fs leave the swap partitioned untouched anyway?)
In my case the fsck(?, probably not a full check, since it only took 2 seconds to complete) happened after a (failed) hibernation attempt, here is the message from /var/log/messages:

May 23 15:32:09 hobbes kernel: [ 10.052000] EXT3-fs: INFO: recovery required on readonly filesystem.
May 23 15:32:09 hobbes kernel: [ 10.052000] EXT3-fs: write access will be enabled during recovery.
May 23 15:32:09 hobbes kernel: [ 11.944000] kjournald starting. Commit interval 5 seconds
May 23 15:32:09 hobbes kernel: [ 11.944000] EXT3-fs: recovery complete.

I'm not sure whether this bug is related to hibernations, so here is what I did:
- I tried "Hibernate" from the Gnome shutdown menu a few days ago, which seemed to work.
- However, on wakeup all I saw was a black screen (with sync), and even Ctrl-Alt-F1 didn't work anymore. A remote login showed that Xorg was running at 100% CPU. I then performed a clean shutdown.
- I tried "Hibernate" again yesterday. Again, it did go to sleep. However, this time the machine didn't seem to resume on wakeup, but do a normal, complete reboot.
- During that reboot, the above recovery was run, but it probably was journal related, not a full fsck, since it only took a few seconds.

I don't have uswsusp or similar installed. Using Feisty.
HTH,
Cruncher

Jarno Suni (jarnos) wrote :

I also lost swap after hibernate when using Edgy. Today I noticed the swap is not in use (by running top) while running on terminal "sudo aptitude update && aptitude show alsaplayer", using Feisty.

Patch to this is to use device name instead of the uuid thing for swap partition in /etc/fstab and then reboot. (I have not tested hibernate with it, though.)

Jarno Suni (jarnos) wrote :

Hibernate worked in Feisty after applying this:
http://ubuntuforums.org/showpost.php?p=1656039&postcount=13
Maybe you have to update menu.lst again after kernel update.

Cruncher (ubuntu-wkresse) wrote :

> See also https://bugs.launchpad.net/ubuntu/+bug/121737

"Sorry, you don't have permission to access this page."

?

Jarno Suni (jarnos) wrote :

Cruncher, I don't understand. I can access the page even if logged off. Have a nice day anyway.

Mark Silence (madasi) wrote :

Just wanted to add my confirmation, I've had this happen to me twice in Feisty. Since I hibernate 90% of the time, I've managed to be resuming from a hibernation each time the routine fsck kicked in. In both cases, the resume wouldn't happen, I'd get a normal boot instead, and find my swap gone.

It looks like swapon may call mkswap if it believes the partition is corrupt; this could happen after failed (or ignored) hibernation for example. Obviously this should attempt to preserve the UUID, or not happen at all.

Changed in util-linux (Ubuntu):
assignee: Scott James Remnant (scott) → nobody
status: Confirmed → Triaged
Phillip Susi (psusi) wrote :

This was fixed back in karmic.

Changed in util-linux (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers