No hibernation after reallocation of root and swap partitions

Bug #957999 reported by Ivan Zorin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

I had a fresh install of Ubuntu 11.10 with correctly working suspend/hibernate.
I had to re/move some partitions, so UUIDs of partitions have been changed - after that hibernation obviously become broken.
But even after fixing UUIDs/device paths in initramfs/resume, fstab and grub, and updating initramfs image (update-initramfs -u) and updating grub configuration (update-grub) hibernation still not working.

Here current values for partitions:
root device = /dev/sda5
root UUID = 568501ed-ff45-4746-8fdc-d887b064d6eb
swap device = /dev/sda6
swap UUID = f3636075-22f2-4469-8d0f-6ff4f0fe67a5

Now system boots correctly, and swap partition is available in the system, but if I try to hibernate:
 - on hibernation looks like that system image are compressing correctly
 - on resuming looks like that system image are decompressing correctly (according to booting logs)
 - but after that screen goes black, and system automatically rebooted
 - next time on booting I can see cold boot start

Also I've tried to re-format swap parition and manually setup previous UUID:

$ sudo mkswap -L SWAP -U f3636075-22f2-4469-8d0f-6ff4f0fe67a5 /dev/sda5

No any changes.

Also I've tried to upgrade packages:

$ sudo apt-get upgrade

No any changes.

Also I've tried to change UUIDs to device names in grub/fstab/initramfs, but no any changes as well.

My current config files:

$ cat /etc/fstab | grep -v "^#"
proc /proc proc nodev,noexec,nosuid 0 0
UUID=568501ed-ff45-4746-8fdc-d887b064d6eb / ext4 errors=remount-ro 0 1
UUID=f3636075-22f2-4469-8d0f-6ff4f0fe67a5 none swap sw 0 0

$ cat /etc/initramfs-tools/conf.d/resume
RESUME=UUID=f3636075-22f2-4469-8d0f-6ff4f0fe67a5

$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=568501ed-ff45-4746-8fdc-d887b064d6eb ro no_console_suspend debug loglevel=9 pcie_aspm=force pcie_aspm.policy=powersave

I guess, that if I'll do a fresh install, then hibernate will be working correctly again;
so just looks like that some other configuration files must be updated to fix UUID/device path.

If this is a real not particular hardware-related bug, then it should be reproducible;
Steps to reproduce (I will be very appreciate, if someone really will try to reproduce it):
 - take testing HDD and Ubuntu 11.10 live cd/usb and start installation
 - during installation, make the following partitions:
  * /dev/sda1 for data (8GB)
  * /dev/sda2 for data (2GB)
  * /dev/sda3 for root (8GB)
  * /dev/sda4 for swap (2GB)
 - install system, make sure that it boots correctly and hibernation works correctly as well
 - now boot from live cd/usb
 - backup system data from root to /dev/sda1, something like that:
  $ sudo mkdir /mnt/root-new
  $ sudo mkdir /mnt/root
  $ sudo mount /dev/sda3 /mnt/root
  $ sudo mount /dev/sda1 /mnt/root-new
  $ sudo cp -rfax /mnt/root/* /mnt/root-new/*
  $ sudo umount /mnt/root
  $ sudo umount /mnt/root-new
 - delete used partitions:
  $ sudo swapoff -a
  $ sudo parted /dev/sda rm 4
  $ sudo parted /dev/sda rm 3
 - find out new UUIDs for root and swap partitions:
  $ ls -la /dev/disk/by-uuid/
 - fix config files on new root:
  $ sudo mount /dev/sda1 /mnt/root-new
  $ sudo gedit /etc/fstab /etc/initramfs-tools/conf.d/resume
  * now replace UUIDs for root and swap by current values for /dev/sda1 and /dev/sda2 respictaevly
  * save changes, close gedit
 - update system information:
  $ sudo grub-install --root-directory /mnt/root-new /dev/sda
  $ sudo mount --bind /proc /mnt/root-new/proc
  $ sudo mount --bind /dev /mnt/root-new/dev
  $ sudo mount --bind /sys /mnt/root-new/sys
  $ sudo chroot /mnt/root-new/
  # update-initramfs -u
  # update-grub
  # exit
  $ sync
 - now try to boot "new" system

What should happen:
 - booting into system just like it hasn't been moved
 - hibernate/suspend and other features should works correctly

What happens:
 - system is booting
 - swap space is available in system
 - looks like that system can hibernating correctly, but on resume it goes in reboot

See reports for pretty similar issues:
bug #499940
bug #577916

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: linux-image-3.0.0-12-generic 3.0.0-12.20
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: wl
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.24.
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: Intel [HDA Intel], device 0: STAC92xx Analog [STAC92xx Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: ubuntu 1770 F.... pulseaudio
CRDA: Error: [Errno 2] No such file or directory
Card0.Amixer.info:
 Card hw:0 'Intel'/'HDA Intel at 0xd0900000 irq 46'
   Mixer name : 'Intel IbexPeak HDMI'
   Components : 'HDA:111d7605,103c149b,00100402 HDA:80862804,80860101,00100000'
   Controls : 18
   Simple ctrls : 10
Date: Sat Mar 17 20:21:05 2012
HibernationDevice: RESUME=UUID=f3636075-22f2-4469-8d0f-6ff4f0fe67a5
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
Lsusb:
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 001 Device 003: ID 04f2:b1cc Chicony Electronics Co., Ltd
MachineType: Hewlett-Packard HP ProBook 5320m
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-12-generic root=UUID=568501ed-ff45-4746-8fdc-d887b064d6eb ro no_console_suspend debug loglevel=9 pcie_aspm=force pcie_aspm.policy=powersave
RelatedPackageVersions:
 linux-restricted-modules-3.0.0-12-generic N/A
 linux-backports-modules-3.0.0-12-generic N/A
 linux-firmware 1.60.1
SourcePackage: linux
StagingDrivers: brcmutil mei brcmsmac
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 09/16/2011
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 68AFU Ver. F.20
dmi.board.name: 149B
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 82.13
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr68AFUVer.F.20:bd09/16/2011:svnHewlett-Packard:pnHPProBook5320m:pvr:rvnHewlett-Packard:rn149B:rvrKBCVersion82.13:cvnHewlett-Packard:ct10:cvr:
dmi.product.name: HP ProBook 5320m
dmi.sys.vendor: Hewlett-Packard

Revision history for this message
Ivan Zorin (iaz) wrote :
Brad Figg (brad-figg)
Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Ivan Zorin (iaz) wrote :

After complete re-formatting partitions and re-installation of Ubuntu the problem is still exists.

Revision history for this message
Ivan Zorin (iaz) wrote :

Got it! Zeroing swap partition and reformatting it - looks like that problem fixed:

$ cat /proc/swaps
Filename Type Size Used Priority
/dev/sda5 partition 5242876 0 -1

$ ls -la /dev/disk/by-uuid/ | grep sda5
lrwxrwxrwx 1 root root 10 2012-03-18 15:20 cf32f967-d4a9-4904-a9e7-498af72339d4 -> ../../sda5

$ sudo swapoff -a

$ sudo dd if=/dev/zero of=/dev/sda5 bs=4M

$ sudo mkswap -L SWAP -U cf32f967-d4a9-4904-a9e7-498af72339d4

$ sudo reboot

So, I guess that problem was in corrupted data on swap partition from previous swap image(s), so kernel just couldn't process it correctly while resuming.

Now hibernation should be working correctly.

I hope that this information will be useful for others.

Changed in linux (Ubuntu):
status: Confirmed → Opinion
Revision history for this message
Ivan Zorin (iaz) wrote :

Now looks like that the issue is reproducible (again :( in the following case:

 - take testing HDD and Ubuntu 11.10 live cd/usb and start installation
 - during installation, make the following partitions:
  * /dev/sda1 for data (8GB)
  * /dev/sda2 for data (2GB)
  * /dev/sda3 for root (8GB)
  * /dev/sda4 for swap (2GB)
 - install system, make sure that it boots correctly and hibernation works correctly as well
 - if not, disable swap, zeroing partition, and run `mkswap' with previous UUID (see the previous comment)
 - now boot from live cd/usb
 - backup system data from root to /dev/sda1, something like that:
  $ sudo mkdir /mnt/root-new
  $ sudo mkdir /mnt/root
  $ sudo mount /dev/sda3 /mnt/root
  $ sudo mount /dev/sda1 /mnt/root-new
  $ sudo cp -rfax /mnt/root/* /mnt/root-new/*
  $ sudo umount /mnt/root
  $ sudo umount /mnt/root-new
 - delete used partitions:
  $ sudo swapoff -a
  $ sudo parted /dev/sda rm 4
  $ sudo parted /dev/sda rm 3
 - make new swap partition with the previous UUID:
  $ sudo dd if=/dev/zero of=/dev/sda2 bs=4M
  $ sudo mkswap -L SWAP -U <old UUID here> /dev/sda2
 - find out new UUID for root:
  $ ls -la /dev/disk/by-uuid/
 - fix config files on new root:
  $ sudo mount /dev/sda1 /mnt/root-new
  $ sudo gedit /etc/fstab
  * now replace UUID for root by current value for /dev/sda1
  * save changes, close gedit
 - update system information:
  $ sudo grub-install --root-directory /mnt/root-new /dev/sda
  $ sudo mount --bind /proc /mnt/root-new/proc
  $ sudo mount --bind /dev /mnt/root-new/dev
  $ sudo mount --bind /sys /mnt/root-new/sys
  $ sudo chroot /mnt/root-new/
  # update-initramfs -u
  # update-grub
  # exit
  $ sync
 - now try to boot "new" system

What should happen:
 - booting into system just like it hasn't been moved
 - hibernate/suspend and other features should works correctly

What happens:
 - system is booting
 - swap space is available in system
 - looks like that system can hibernating correctly, but on resume it goes in reboot

Changed in linux (Ubuntu):
status: Opinion → Confirmed
Revision history for this message
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v3.3 kernel[1] (Not a kernel in the daily directory). Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag(Only that one tag, please leave the other tags). This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.
Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[1] http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3-precise/

Changed in linux (Ubuntu):
importance: Undecided → Medium
tags: added: needs-upstream-testing
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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