3

I am using Ubuntu 12.04 and was trying to enable Hibernate.I came across that one should have Swap Partition equivalent to RAM in system so created one. My file system information on

sudo fdisk -l /dev/sda

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b11e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63       96389       48163+  de  Dell Utility
/dev/sda2           98304    84097023    41999360   83  Linux
/dev/sda3        84097024   167878655    41890816    7  HPFS/NTFS/exFAT
/dev/sda4       167879311   312575999    72348344+   f  W95 Ext'd (LBA)
/dev/sda5       167879313   287396152    59758420    7  HPFS/NTFS/exFAT
/dev/sda6       287397888   310425599    11513856    7  HPFS/NTFS/exFAT
/dev/sda7       310427648   312575999     1074176   82  Linux swap / Solaris

I am able to hibernate my system once I swapon my /dev/sda7 partition.

For that I do, mkswap /dev/sda7
and swapon /dev/sda7

I even added entry in /etc/fstab

UUID="xxx" /dev/sda7 none swap sw 0 0

Everything happens successfully including sudo pm-hibernate But when I restart my system after Hibernate its not able to load my swap partition.

I checked using Gparted Partition Editor then for /dev/sda7 the file system becomes unknown. Please help in resolving this.

2 Answers 2

3

Is that the actual line you have in fstab for the swap partition? If it is replace "xxx" with the real UUID. You can get that by running

 sudo blkid

My swap line is

UUID=2188134d-a147-4db9-9b58-fe12f7b74a58 none swap sw 0 0

my blkid output

/dev/sda2: UUID="72cf9e50-f555-476e-a018-cec87a86d2bb" TYPE="ext4" 
/dev/sda5: UUID="2188134d-a147-4db9-9b58-fe12f7b74a58" TYPE="swap" 
/dev/sda6: UUID="14143c21-08e9-4d31-b083-f6efb11234fb" TYPE="ext4" 
/dev/sda7: LABEL="1210" UUID="955bd082-58af-46fc-a72b-016c9d7a3150" TYPE="ext4" 
/dev/sdb1: UUID="14ee47cc-54cb-4887-8773-fd53121efe10" TYPE="ext4"

Backup and edit the fstab file to change as necessary

sudo cp /etc/fstab /etc/fstab.bak && gksudo gedit /etc/fstab

It might also be worth checking that the UUID in /etc/initramfs-tools/conf.d/resume is correct.

cat /etc/initramfs-tools/conf.d/resume

This should match the UUID for the swap partition, if it is different then change the UUID

sudo cp /etc/initramfs-tools/conf.d/resume /etc/initramfs-tools/conf.d/resume.bak && gksudo gedit /etc/initramfs-tools/conf.d/resume
5
  • /etc/initramfs-tools/conf.d/resume is not there in my file system. Should I create any file inside conf.d? Regarding UUID,it matches the blkid.So,no problem there.Do you need any other info. Jun 2, 2012 at 19:35
  • You could create the resume file all you need us RESUME=UUID=yourswapuuid Is your swap encrypted? Might make a difference Jun 3, 2012 at 6:16
  • I noticed one more thing that when I reboot my system post Hibernation, sudo blkid gives me: /dev/sda7: UUID="48194385-9cdd-464f-8df7-73322d9db5a4" TYPE="swsuspend" I don't know why its type is changed here.Is it creating problem?? Jun 3, 2012 at 12:41
  • still my problem is not resolved..someone please guide me Jun 5, 2012 at 18:41
  • not sure what the suspendsw is about - try removing it and recreating it - check the blkid in both the fstab and resume files afterwards again. Jun 6, 2012 at 5:34
0

Maybe do

sudo update-initramfs

after changing it.

1
  • Welcome to AskUbuntu! You may want to add additional information so that the original poster knows what he's doing when typing those lines of code into the terminal.
    – Oyibo
    Oct 3, 2012 at 7:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .