finding a lost swap partition?

Bug #165316 reported by shanen (Shannon Jacobs) on 2007-11-27
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)

Bug Description

There should be some kind of sanity check when fstab specifies the wrong swap partition. I'm running Ubuntu on a number of machines, and I just finished going through what seemed like several hours of battling that started when the UUID of the swap partition was changed. I had a pretty large advantage of realizing fairly quickly that the problem was the swap partition, but it was still a pretty major pain to figure out what was supposed to be in the /etc/fstab file before I was able to fix it. It would seem like this should be a fairly minor thing to fix--if I actually understood what was going on.

Probably the general solution would be a recovery routine if fstab has any problems. In this particular case, I just needed to find the proper name for the only swap partition and put it in there...

Can you expound on the UUID of the swap partition changing? Was this something that was caused by another bug? I suppose I'm wondering what might cause the UUID to change, which would then cause this issue.

the 'blkid' command will generate filesystem information, including device, UUID and fs-type. Would this be a tool that would help find/resolve this issue in the future?

The first time it happened, I had used gparted to move the swap partition forward, but I still don't know what might have caused it the second time. Yes, I was awake and paying some attention, but something strange happened. I don't even know enough about UUIDs to imagine what causes them to change, but my suggestion was that it should be a simple sanity check when fstab includes an incorrect reference to a partition that does not exist.

The blkid command seems to be the correct solution, but I did not know about it and still have no idea how to find it. What I did at the time was stuff like "man -k partition", which led to some information about various other kinds of stuff. I was pretty quickly able to figure out which partition I was supposed to be dealing with, but it still took a long time to find a name that worked in the fstab file.

I don't know why--but my larger point is that most people don't want to know why. They don't even want to know how to fix a broken fstab file. They just want it to work.

Benson Margulies (bimargulies) wrote :

I'd like to join this issue.

Here's what happened to me. Some unexplained phenomenon hammered my swap partition, so it lost its UUID. My system simply booted without incident or warning -- but also without any swap!

mount and swapon, run from command line, complained that the UUID was invalid.

One could argue that this is the price of UUID-based fstab mounts; how the heck should the system know that the dangling UUID once pointed to some unused partition on the disk.

Aside from that, I would like to have been yelled at for the fact that my fstab contained an invalid swap mount line, even if it couldn't have given me a ton of help in recovering from the problem.

Further, I could imagine some sort of maintenance tool that would look at the partition table, find a lonely, under-appreciated swap partition, and offer to rehabilitate it.

trollord (trollenlord) wrote :

Perhaps it would be less hassle just to use swap files. They are as good performing (they really are with new kernels), more stable (simple files, mine is at /swap.img), and you can resize/add/delete them a lot faster and easier. No UUIDs exploding either.

Changed in linux:
importance: Undecided → Wishlist
status: New → Triaged

I'll just note that I ran into some of these problems again in conjunction with some more upgrades. I'm getting much too familiar with the internal GRUB commands to find partitions and to find and display files.

I feel like the proper solution would be a graphic repair interface for GRUB. In almost all cases I was able to boot the machine somewhere--but they could still put the utility on the live CD.

Phillip Susi (psusi) wrote :

This isn't a bug or something that util-linux can do anything about.

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

Other bug subscribers