You are not logged in.

#1 2014-01-14 05:24:04

logic_guy76
Member
Registered: 2009-09-05
Posts: 30

phantom hard disk partition mysteriously appeared [solved]

My hard disk has one primary partition formated with NTFS with Windows XP running on it.
The rest of the disk is allocated as an extended partition with various logical partitions.
The first logical partition is a 150 GB NTFS partition used for WinXP data.
Next I have a small ext2 partition, which is the boot partition for Arch.
This is followed by a swap partition and some other Linux partitions.
I have GRUB legacy installed on the ext2 partition and use it as the Linux loader and OS selector.  I've been operating this way for quite some time.

A few days ago, I was working away in WinXP, which has been running very reliably for me for many years, when it started acting very strangely.  I decided to reboot.  Upon reboot, chkdsk started running, reported that there were a lot of errors on the disk, and starting making what looked like 1000's of repairs.  A large number of messages flew by about restoring lots of "orphaned files" to various directories, which were identified only by numbers, not names.  ("Oh, man, what on earth happened.  I've never seen this before.")  Eventually, somewhat to my surprise, WinXP came up and appeared to work quite normally.  I felt relieved, for a while, but then I discovered that some files on the C: drive were missing.  For instance, all my Opera bookmarks were gone.  Fortunately, I had just done a long overdue full-image backup of the C drive the day before, using Avanquest PerfectImage.  So, counting my lucky stars, I booted up the PerfectImage restore CD and did a full restore of the C drive.  Upon reboot, GRUB reported some errors and wouldn't display the OS selection menu.  So, I booted the SystemRescue CD and reinstalled GRUB.

Now, WinXP boots OK, but Arch won't boot, or any other Linux installation that I had on the other logical partitions.  I used SystemRescue CD to explore the disk and all the partitions and data are still there and everything looks normal under GParted.  However, after doing some exploring with GRUB, I discovered that it is now numbering the logical partitions differently than before, but Linux still numbers them the same.  GRUB seems to think there is some extra invisible partition before the first logical partition.

Here is what Linux sees:

root@sysresccd /root % fsarchiver probe   
[======DISK======] [=============NAME==============] [====SIZE====] [MAJ] [MIN]
[sda             ] [WDC WD3200AAJB-0               ] [   298.09 GB] [  8] [ 0]
[sr0             ] [DVDR   PX-716A                 ] [   369.40 MB] [ 11] [ 0]
[=====DEVICE=====] [==FILESYS==] [======LABEL======] [====SIZE====] [MAJ] [MIN] 
[loop0           ] [squashfs   ] [<unknown>        ] [   299.54 MB] [  7] [ 0] 
[sda1            ] [ntfs       ] [WINXP            ] [    25.13 GB] [  8] [ 1] 
[sda5            ] [ntfs       ] [DATA             ] [   150.00 GB] [  8] [ 5] 
[sda6            ] [ext2       ] [BOOT             ] [    94.10 MB] [  8] [ 6] 
[sda7            ] [swap       ] [<unknown>        ] [     1.91 GB] [  8] [ 7] 
[sda8            ] [jfs        ] [ARCHLINUX        ] [    15.26 GB] [  8] [ 8] 
[sda9            ] [reiserfs   ] [arch_var         ] [     9.54 GB] [  8] [ 9] 
[sda10           ] [jfs        ] [HOME             ] [    45.78 GB] [  8] [ 10] 
[sda11           ] [ext3       ] [COMMON           ] [     9.54 GB] [  8] [ 11] 
[sda12           ] [ext4       ] [<unknown>        ] [     5.72 GB] [  8] [ 12] 
[sda13           ] [ext3       ] [FEDORA           ] [     4.98 GB] [  8] [ 13]

sda1 is my only primary partition, sda5 [DATA] the first logical partition, sda6 [BOOT] the second, etc.

Here is what GRUB sees:

grub> find (hd0, <TAB>
 Possible partitions are:
   Partition num: 0,  Filesystem type unknown, partition type 0x7
   Partition num: 5,  Filesystem type unknown, partition type 0x7
   Partition num: 6,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 7,  Filesystem type unknown, partition type 0x82
   Partition num: 8,  Filesystem type is jfs, partition type 0x83
   Partition num: 9,  Filesystem type is reiserfs, partition type 0x83
   Partition num: 10,  Filesystem type is jfs, partition type 0x83
   Partition num: 11,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 12,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 13,  Filesystem type is ext2fs, partition type 0x83

GRUB numbers things starting from 0, so the first logical partition should be (hda0,4), not (hda0,5),  and (hda0,6) is now the BOOT partition, where it used to be (hda0,5), etc.  That is why Arch et al won't boot.  The (hda0,x) numbers in the menu.lst file, which used to be correct, no longer match the numbering scheme that GRUB is now seeing.  I suppose I could edit the grub/menu.lst file and increment the (hda0,x) numbers by 1, except for (hda0,0), but why is GRUB's numbering off by 1 now, when it wasn't before.

Also, fdisk reports something strange:

root@sysresccd /root % fdisk -l
omitting empty partition (5)

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x000b680c

   Device Boot      Start         End      Blocks   Id  System
   /dev/sda1   *          63    52693199    26346568+   7  HPFS/NTFS/exFAT
   /dev/sda2        52693200   625142447   286224624    f  W95 Ext'd (LBA)
   /dev/sda5        52693263   367267839   157287288+   7  HPFS/NTFS/exFAT
   /dev/sda6   *   367267903   367460619       96358+  83  Linux
   /dev/sda7       367460683   371460804     2000061   82  Linux swap / Solaris
   /dev/sda8       371460868   403462284    16000708+  83  Linux
   /dev/sda9       403462348   423463209    10000431   83  Linux
   /dev/sda10      423463273   519467649    48002188+  83  Linux
   /dev/sda11      519467713   539468574    10000431   83  Linux
   /dev/sda12      539468638   551469129     6000246   83  Linux
   /dev/sda13      551469193   561915903     5223355+  83  Linux

sda2, the extended partition, begins at the very next sector after the end of sda1 and goes to the last sector of the disk, 625142447.  That looks normal.  The first logic partition, sda5, begins exactly 63 sectors after the start of the extended partition.  That's normal.  The next logical partition begins 64 sectors after the last sector of the previous logical partition.  That's normal.  Etc.

So, where is this "empty partition (5)" that fdisk, and apparently GRUB, are seeing?

(I know this isn't really an Arch question per se, but lots of smart, helpful people hang out on these forums, so I'm hoping someone might have an idea.)

Last edited by logic_guy76 (2014-01-17 04:19:34)

Offline

#2 2014-01-17 04:18:54

logic_guy76
Member
Registered: 2009-09-05
Posts: 30

Re: phantom hard disk partition mysteriously appeared [solved]

In case anybody is interested...
I finally solved the problem.
Thinking that some sector on my hard disk had taken a hit, I backed up all the partitions, did a low-level format of the entire disk, reformatted, and reloaded everything.  And... I still had the problem!

After lots of experimentation, I discovered that I could create the first logical partition (sda5/NTFS/DATA), but not restore the data yet, and grub would detect it as (hd0,4), as expected.  But, after I restored the image of the data for that partition, grub would detect it as (hd0,5).  Something squirrelly had happened to that ntfs partition.  I decided that the fix probably involved reloading all the data for that partition.  Since Linux could access the files in that partition without any problem, I backup up everything using fsarchiver, which makes a file-level, rather than a block-level archive.  Then I reformatted the partition and restored all the data using fsarchiver.  That fixed the problem.  grub detects all the logical drives with the expected numbering scheme and that "phantom" partition is gone.

Arch is running again and I am typing this reply from Arch.

Offline

Board footer

Powered by FluxBB