Proper syntax for suspend to disk, uswusp.conf
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4043
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
I recently ran into a problem with setting up suspend to disk in my Free Linux Desktop. I tried a few different syntaxes, hoping to be able to use LABEL or UUID as you see below, but in my Debian system, Sid based, the system would fail to suspend when I used either LABEL= or UUID=

What I finally realized, and luckily had noticed, is that when I was using /dev/hda1 as my suspend to syntax, the system's /boot/grub/menu.lst is set to resume:

:: Code ::
# kopt=root=LABEL=main-root-1 ro quiet vga=791 resume=LABEL=main-swap-1

but when the system actually resumed, I noticed that it didn't use the LABEL, it used /dev/disk/by-label/main-swap-1 instead.

So I tried simply replacing LABEL=main-swap-1 with:
resume device = /dev/disk/by-label/main-swap-1

then I ran, as root: update-initramfs -u
just to make sure everything was in order, and rebooted, then tried to suspend, and it all worked immediately as expected.

:: Code ::
cat /etc/uswsusp.conf
# /etc/uswsusp.conf(8) -- Configuration file for s2disk/s2both
# resume device = LABEL=main-swap-1
resume device = /dev/disk/by-label/main-swap-1
# resume device = /dev/hda1
# resume device = UUID=a205753b-9cb9-4321-950d-119ea0cf3602
splash = y
compress = y
early writeout = y
image size = 365069189
RSA key file = /etc/uswsusp.key
shutdown method = platform

There's some more useful Suspend and Hibernate with µswsusp information. Here's some more suspend information.

The reason I ran into this issue was that I am switching between Debian Sid kernels, which do not appear to use libata for ide disks, and libata kernels from sidux, which do, ie:

With sid kernels, the syntax to use /dev/.. needed to be:
resume device = /dev/hda1
but with libata kernels, where everything is /dev/sdx, it needed to be:
resume device = /dev/sda1

Suspend would simply fail with no error messages when I used LABEL=<label> or UUID=<uuid> type syntax in the config file.

I hope this information is helpful to someone out there who runs into the same frustrating issues.

Remember, using /dev/sdx or /dev/hdx is risky because of the libata issues, and also because you never know what disks will be listed where as the linux kernel boots and discovers them, or what it will call them.

Using clean, unique, easy to indentify disk labels is by far and away the most intuitive, user friendly way I have found around this problem, but the suspend syntax was a last little obstacle that kept me from having a reliable, variable kernel method, suspend system.

also, initramfs data
Someone pointed out that this is also set, and it is:
:: Code ::
cat /etc/initramfs-tools/conf.d/resume

This is risky syntax to use, since if you or some operating system install, like default Debian's, decides it wants to reformat your swap, this will fail immediately.

so highly recommended to use Labels there as well. Remember, uuid is changed with every reformatting, and of course labels are lost too, but it's fairly trivial to relabel your partitions, far more trivial than going through your files and locating every single instance of the UUID and resetting it.

so the above needs to be changed here as well, to use:
then run: update-initramfs -u
again to update everything.
of course, you change that for your label, and make sure to make it unique to the machine.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours