GNOME Bugzilla – Bug 342369
IBM Thinkpad hibernation partition misreported as Linux Swap
Last modified: 2012-11-05 16:41:30 UTC
Please describe the problem: On the LiveCD downloaded 19-May-2006, my IBM (Lenovo) ThinkPad's 'Hibernation' partition was misreported as a 'Linux Swap' partition. FDisk output is as follows: /dev/hda4 106256 108375 1068322+ a0 IBM Thinkpad hibernationPartition 4 does not end on cylinder boundary. GNU Parted prints the following, so this is probably their bug. 4 52297.537 53340.820 primary linux-swap type=a0 Steps to reproduce: Run GParted on an IBM Thinkpad with a hibernation partition; note the wrong partition type. Actual results: Partition displayed as 'Linux Swap' Expected results: Partition displayed as "IBM Hibernation" Does this happen every time? Yes Other information: As noted, this is actually a GNU bug. I will investigate their site and see if they have a reporting function. If not, you may want to consider a work-around.
hmmz, this seems to be related to http://bugzilla.gnome.org/show_bug.cgi?id=334569 According to Leslie Polzer (The GNU Parted maintainer) this will be fixed in libparted 1.7.1, so let's wait and see if it's fixed by then.
Re comment by plors: Actually, I saw that bug before I entered this one. Not knowing the code, I couldn't tell if it's just the reverse of my problem or not. Ping me when the new parted/libparted release comes out and I'll see if the bug is fixed. It looks to me like Gnome is off the hook for this issue, modulo the need to relink when the library is fixed.
What happens when you hibernate your machine using suspend2, and restart using the GParted LiveCD? What is the IBM Hibernation partion shown as?
I would very much like to mark this one as dup of http://bugzilla.gnome.org/show_bug.cgi?id=334569, but i'm still not sure if this is the same issue. Although.. both come down to an incorrect guess of the fstype by ped_filesystem_probe().
Glenn could you give me the output of the following command after 'hibernating' your machine and booting up using the GParted LiveCD? # hexdump -C /dev/hda4 | head -n 50 I am assuming /dev/hda4 is the partition to which your system gets 'hibernated', and under normal circumstances acts as your 'swap' partition. Are you using 'Suspend2', 'swsusp', or something else?
I'm running SUSE 9.3; I'm not sure how to 'suspend-to-disk'. I know that the system seems to sleep when I close the lid, but I don't know if that's the code path you need. Any suggestions on the 'right' way to trigger a suspend? Other than whatever 'closing the lid' does, I'm not actively using the suspend feature.
(In reply to comment #6) > I'm running SUSE 9.3; I'm not sure how to 'suspend-to-disk'. I know that the > system seems to sleep when I close the lid, but I don't know if that's the code > path you need. Do not worry. Just 'hibernate' your laptop, in the way you did while filing the bug report, reboot using the LiveCD and from the terminal run: # hexdump -C /dev/hda4 | head -n 50 You could mount one of your other hard-drive partitions from the LiveCD and redirect the output of the command to a file on it. That way it would be easier for you to post the output. :-) > Any suggestions on the 'right' way to trigger a suspend? # echo shutdown > /sys/power/disk ; echo disk > /sys/power/state This one of the ways to do it using the kernel's swsusp feature. There are few other different ways to di it too. However it seems your machine does something else on 'closing the lid'. No need to worry about that. Just reproduce the bug, as in the bug report, and get me the output of the above command. Thanks...
Created attachment 76453 [details] Tarred and feathered text files containing dump of partition header See 00index.txt in the tar file for information. Sorry, I forgot to create the tar within a subdirectory, so it will unpack into the current directory.
Considering how old this bug is, is this still a problem?
Ping Glenn... Would you be able to test this with the latest parted release (1.9.0)? If it is more convenient to use a Live CD, parted-1.9.0 is packaged with gparted-0.4.6 on the System Rescue CD: To download SystemRescueCd-x86-1.2.3, visit: http://www.sysresccd.org/Download
(In reply to comment #10) > Ping Glenn... > > Would you be able to test this with the latest parted release (1.9.0)? > > If it is more convenient to use a Live CD, parted-1.9.0 is packaged with > gparted-0.4.6 on the System Rescue CD: > It just so happens that I downloaded the new release of System Rescue off of LinuxTracker, so I tried it out. GPARTED still reports 'unknown' as the partition type for /dev/sda4 while FDISK reports "IBM Thinkpad Hibernation". It's been a while, so I don't remember if there's a valid hibernation image on the partition or not, but I wouldn't expect 'unknown' if the partition type code says what it says (type '0a' to be specific.)
Thank you for the quick response Glenn. Following is some background information, and a suggested next step to determine the source of this issue. BACKGROUND INFORMATION GParted uses libparted to detect file systems and manipulate partitions. I believe that the parted code does not rely on the partition type codes, and instead inspects the contents of the file system to determine the file system type. One of the challenges I can see of relying only on the partition type code is that some partition type codes were used for more than one partition type. For instance, when I take a look at the following list of partition codes: http://www.win.tue.nl/~aeb/partitions/partition_types-1.html I notice that there is more than one type of file system defined for partition type code 0a. For example (quoted from above URL): ID NAME 0a OS/2 Boot Manager OS/2 is the operating system designed by Microsoft and IBM to be the successor of MS-DOS. Dropped by Microsoft. See comp.os.os2. Windows 2000 actively tries to destroy OS/2 Boot Manager. 0a Coherent swap partition 0a OPUS Open Parallel Unisys Server. See Unisys. Hence it would appear that partition type codes are not unique. SUGGESTED NEXT STEP To confirm whether parted is able to determine the type of file system in the partition, would you please post the output to the following command (using parted-1.9.0)? parted /path-to-your-disk-device unit s print
parted (GNU parted) 1.9.0 Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by <http://parted.alioth.debian.org/cgi-bin/trac.cgi/browser/AUTHORS>. Model: ATA HTS726060M9AT00 (scsi) Disk /dev/sda: 109243759s Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 63s 40960079s 40960017s primary ntfs boot 2 40965750s 55584899s 14619150s primary fat32 3 55584900s 107105354s 51520455s extended 6 55585026s 104647409s 49062384s logical ext3 5 104647473s 107105354s 2457882s logical linux-swap(v1) 4 107105355s 109241999s 2136645s primary - - - - - - - - - - - - - - - - - - - sfdisk (util-linux-ng 2.16) Disk /dev/sda: 6800 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 2549- 2550- 20480008+ 7 HPFS/NTFS end: (c,h,s) expected (1023,254,63) found (1023,239,63) /dev/sda2 2550 3459 910 7309575 b W95 FAT32 start: (c,h,s) expected (1023,254,63) found (1023,90,1) /dev/sda3 3460 6666 3207 25760227+ 5 Extended start: (c,h,s) expected (1023,254,63) found (1023,60,1) /dev/sda4 6667 6799 133 1068322+ a0 IBM Thinkpad hibernation /dev/sda5 6514+ 6666 153- 1228941 82 Linux swap / Solaris /dev/sda6 3460+ 6513 3054- 24531192 83 Linux
Thank you Glenn for performing these tests with the latest versions of GParted (0.4.6) and Parted (1.9.0). From the parted output listing, it appears that parted was unable to determine the type of file system for primary partition 4 (/dev/sda4 in the sfdisk listing). To address this problem, would you be able to post a bug report to the parted mailing list (bug-parted@gnu.org)? It would likely help to include a link to this bug URL so that the parted development team can see the trail of comments as well.
Email sent. You can either keep this bug open to track the dependency, or close it. As you can imagine, this isn't 'mission critical' for me...
Thank you for emailing this problem to the parted team. I will watch the bug-parted mailing list for a response. It would be useful to keep keep this bug open so that we can track the dependency.
Hey Curtis, this is not a bug and so should be closed. The MSDOS partition table type codes are meaningless and not used; all that matters is whether the partition contains a linux swap filesystem. Since it does, (g)parted is correct in reporting this.
Thank you Phillip for the clarification. If I understand laptop hibernation correctly, the swap space is used store the contents of the computers RAM when it goes into hibernation mode. When the laptop comes out of hibernation mode, the swap space is used to restore the contents of the RAM. Hence you are correct that the hibernation space, and the swap space are the same thing. I think the original reporter was pointing out the partition table type of "a0" as being different, which it is. However since parted (and libparted) look at the actual contents of the partition to determine the file system, parted is also correct. Closing this report as RESOLVED - NOTABUG