1

Topic: gparted does not see partitions - but WinXP does

Hi everybody. These topics are all new to me, so hopefully, I get the terms right.

Well, currently, GParted (0.4.6) sees my hd unpartitioned, i.e., there is no single partition on it.  But WinXP starts without problems - and it sees the expected partitions.  Let me explain:

I had a dual boot installation: WinXP in the primary partition (on the left end), some other partitions in the extended one (on the right) with Linux.

Then I formatted the primary partition with NTFS and made it smaller. I enlarged the extended one accordingly.  Then I re-installed Windows XP and chose the primary partition.

Now Windows starts and it shows me the partitions correctly: They are of right size and order, although it calls them "unknown".  But GParted does not even find the primary partition. 

What is wrong?

2

Re: gparted does not see partitions - but WinXP does

Hello scholz,
could you please post the print-out of Linux command fdisk -lu , where "l" is a lower-case "L", and parted print ? Both programs are contained in "GParted Live".

Regards
cmdr

3

Re: gparted does not see partitions - but WinXP does

A lot of typing by hand.  I hope I get the numbers right.

fdisk -lu
ommitting empty partition (5)

Disk /dev/sda:160.0 GB, 160040803840 bytes
255 heads, 63 sectors/tracks, 19457 cylinders, total 312579695 sectors
Disk identifier: 0xb6d0e5be

Device      Boot    Start      End          Blocks     Id     System
/dev/sda1   *          63    83971754       41985846   7     HPFS/NTFS
/dev/sda2         83971755    312576704     114302475  5     Extended
/dev/sda3        311596803   312576704      489951      83    Linux
/dev/sda5         83971881   137066579      26547349+   83   Linux
/dev/sda6       137066706    309604679      86268987    83    Linux
/dev/sda7       309604743    311596739       995998+    82   Linux swap / Solaris

parted print
Error: Could not stat device print - No such file or directory.
Retry/Cancel?

4

Re: gparted does not see partitions - but WinXP does

I believe that the command that cmdr intended is:

parted /path-to-your-device print

Where /path-to-your-device is probably something like /dev/sda.

5 (edited by scholz 2009-10-29 10:43:31)

Re: gparted does not see partitions - but WinXP does

parted /dev/sda print
Error: Can't have overlapping partitions

parted /dev/X print with X=sda1, sda3, sda5, sda6, and sda7 seem to give the same results as fdisk.  Too much to type now but I can give the complete numbers if needed. They all say Model: Unknown (unknown), Partition Table: loop, and give the correct file system type (NTFS, ext3, or linux-swap)

parted /dev/sda2 print
Error: Can't have a partition outside the disk
parted /dev/sda4 print
Error: Could not stat device /dev/sda4 - No such file or directory.

Maybe I should also mention that the partitioning was done with GParted 0.2.4.  I switched to 0.4.6 only after the problem occured.

6

Re: gparted does not see partitions - but WinXP does

Hello scholz,
sorry for my false command; gedakc was right.
fdisk print-out indicates,  that a third primary partition (sda3) is located within the extended partition sda2 (overlapping). This probably breaks the whole extended partition chain. The easiest solution would be to delete sda3 and rebuild it as logical volume within the extended partition ( ->sda 8). Perhaps only the partition table in Master Boot Record is incorrect. It seems, that "sda3" can be  integrated into the extended Partition Boot Record (XBR) chain as well. I would first delete the third partition table in MBR and see, what happens ( with a backup of MBR, of course, to get a second chance). You can do it with "MC_HxEd" (use fluxbox menu; right click on "GParted" desktop). By clicking on sda within the program, you get access to edit the MBR. The third partition table starts at address 0x1DE and ends at 0x1ED. Just overwrite these 16 Bytes with 0x00 and save the result.
Be cautious not to overwrite anything else. Refresh "GParted" and see, what happens. It's not just easy, but possible to give "sda8"/sda3 a suitable XBR, since the distance between sda7 and "sda8"/sda3 is exactly as needed, if it doesn't emerge automatically. But it's not sure, that Linux will cope with these changes.

Maybe I should also mention that the partitioning was done with GParted 0.2.4.

It's an unnecessary risk to not use the latest version, especially if NTFS is involved.

Regards
cmdr

7

Re: gparted does not see partitions - but WinXP does

I'm not sure I fully understand what you write but I will try it.  Especially the following part is unclear:

It's not just easy, but possible to give "sda8"/sda3 a suitable XBR, since the distance between sda7 and "sda8"/sda3 is exactly as needed, if it doesn't emerge automatically.

BTW, how do I save something when using GParted Live?  I guess I can mount a USB stick and a USB hard drive. I would prefer not to mount my hard drive because it contains my backup. How to mount the USB stick?

Thanks!

8

Re: gparted does not see partitions - but WinXP does

Hello scholz,

cmdr wrote:

It's not just easy, but possible to give "sda8"/sda3 a suitable XBR, since the distance between sda7 and "sda8"/sda3 is exactly as needed, if it doesn't emerge automatically.

XBR is a Boot Record within the extended partition, that only holds two partition table entries (first and second) in a table similar to the partition table in MBR. The first entry gives the relative address of the appropriate logical volume and its size, whereas the second points to the next XBR, thus forming a chain. The last XBR has only a first entry in its partition table. Distance between XBR and Volume Boot Record is always 63 sectors (one disk track), i.e. you need at minimum 63 sectors between the upper border of a logical volume and the lower border of the next to integrate the needed XBR.

In your case : 311,596,803(first sector of sda3/new sda8) - 311,596,739 (last sector of sda7) - 1 = 63 sectors

How to mount the USB stick?

"MC_HxEd" has a "mounting wizard". Just plug your stick in on request. It doesn't let you change any Boot Records without a previous backup on your stick. To preserve the Record, copy it to another folder (standard is "BootRec"). It might get overwritten, if you use "MC_HxEd" again and accidentally answer "yes", if you get asked, whether you want to store the (altered) record permanently.

Regards
cmdr

9 (edited by scholz 2009-10-29 23:27:47)

Re: gparted does not see partitions - but WinXP does

Thanks for your help.  I just found out about the mounting wizzard of MC_HxEd. A positive surprise.

Unfortunately, your suggestion of overwriting 0x1DE to 0x1ED with 0x00 did not help: GParted still does not find a partition. /dev/sda3 is missing now from fdisk -lu and all messages of parted are the same, too, with the exception that there is no /dev/sda3.

:-(

Ulrich

10 (edited by cmdr 2009-10-29 23:50:23)

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,

/dev/sda2         83971755    312576704     114302475  5     Extended

I just came across this line. The filesystem ID is 5 (last number preceeding "Extended"). This is an old MS-DOS 3.3 extended filesystem ID, which doesn't support big present harddisks. I think, that this is part of the problem ... and easy to correct with "MC_HxEd". The value should be 0x0F for the LBA Extended version. Just overwrite Byte 0x1D2 (=05) with 0F in Master Boot Record (sda) and see, what happens.

Regards
cmdr

PS.: We will "reanimate" sda3 as extended sda8, if "GParted" shows partitioning now.

11

Re: gparted does not see partitions - but WinXP does

cmdr wrote:

Just overwrite Byte 0x1D2 (=05) with 0F in Master Boot Record (sda) and see, what happens.

No fun. Now fdisk -ul says "W95 Ext'd (LBA)" for the file system of sda2.  Nothing else changed

12

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,
I googled to find out, what "parted" means by "Partition table: loop". It seems, that the Master Boot Record may contain traces of a Volume Boot  Record. I think, we should have the MBR as a file (use "HxD" with Windows and copy sector 0 (512 Bytes) of your HDD to a file). Upload it to a file sharing site, so that we can have a look at it.

fdisk -lu
ommitting empty partition (5)

What partition was omitted ?

Please do NOT resize or delete any physical or logical structures on your HDD at the moment, so that it's possible to get "sda8", where it belongs to at last.

Regards
cmdr

13

Re: gparted does not see partitions - but WinXP does

Hi cmdr, here are two files.  fdisk.txt is the output of fdisk -ul.  Don't know what "ommittin empty partition (5)" means.

sector0 is a ascii-copy of sector 0 of my hard disk.  Didn't know which format to save so I simpy copied it as text.

Best, Ulrich

http://dl.getdropbox.com/u/2659967/fdisk.txt
http://dl.getdropbox.com/u/2659967/sector0

14

Re: gparted does not see partitions - but WinXP does

Hi cmdr,

sorry for me nagging but you asked me to not alter my HDD.  Is there still hope that I can recover my partitions? Otherwise, I have to re-format and re-install.  I need to work with it in some days.

Thanks, Ulrich

15

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,
sorry for my late reply, but I'm very engaged professionally at the moment.

Neither the Master Boot Record (Win XP, german) nor print_out of fdisk help to solve the problem:
1. MBR : the only thing, which is not regular, are two Bytes (address 0x1BC : 0xE8; adr. 0x1BD: 0xCE ), which should be both zeroed. I tested it with an USB stick : fdisk and parted do NOT take any notice of that. So this is no problem.
2. fdisk : the third partition is NOT zeroed, but the filesystem of second partition is altered as wished. Are you sure, you really tested it with third partition table zeroed ( Ref. )?

Is there still hope that I can recover my partitions? Otherwise, I have to re-format and re-install.  I need to work with it in some days.

A deeper search (Partition Boot Records) would cost much more time ... and there is no certainty, that it will work afterwards. So if time counts, you must do reinstallation from "scratch" (first XP with appropriate sized partition, NTFS on first primary, then Linux, instantly all on an extended  3rd partition, except for its bootmanager on second primary partition).
Personally, I would use "Grub4DOS" (G4D) as bootmanager instead, because it doesn't need its own code  in MBR and easily works in coexistence with XP from 1st primary partition. You just have to rename "NTLDR" to "XPLDR" and "GRLDR" (G4D) to "NTLDR". Then you "chainload" "XPLDR" in "menu.lst", that's all to start XP.

Regards
cmdr

16

Re: gparted does not see partitions - but WinXP does

Thanks cmdr! I'll probably try the repartitioning on the weekend.  If you have some more ideas until then, please tell.  Cross your fingers that I can re-install my saved Linux partition (partimage). Ulrich

17

Re: gparted does not see partitions - but WinXP does

cmdr, maybe you can do me a last favor: You know I have a working Windows partition on my HD.  Is there a way to keep it while re-formatting the rest? If not, I have to re-install the 20+ MS patches and programms again. Ulch.

Ulrich

18

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,

You know I have a working Windows partition on my HD.  Is there a way to keep it while re-formatting the rest?

I stick at the word "re-formatting" .  Of course you can format any other partition without loosing a working Windows on its own separate partition ( well, unless it's bootmanager does NOT reside elsewhere !) .  But I guess, you mean "re-partitioning".  If XP is located on first primary partition AND starts at sector 63 AND doesn't fill the whole drive , you can do anything you want with the unallocated space above without any interference to first primary. The only thing, that I would avoid, is to create new partitions other than in disk order ( higher number should always be located past lower number).

Regards
cmdr

19

Re: gparted does not see partitions - but WinXP does

cmdr, the problem is (as explained at the beginning):

Well, currently, GParted (0.4.6) sees my hd unpartitioned, i.e., there is no single partition on it.  But WinXP starts without problems - and it sees the expected partitions.

So I cannot re-partition. I would like to.  Maybe I can "remove" some more partitions "by hand", so that the one with Windows (the first one) re-appears in GPared

20

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,

Maybe I can "remove" some more partitions "by hand", so that the one with Windows (the first one) re-appears in GPared

No, let's have a look at sda1 Partition/Volume Boot Record at sector 63 and the next 100 sectors. first.

Enter in a console /Terminal window ( NO TYPOS !) :

 dd  if=/dev/sda  of=/root/sda1.pbr  bs=512  skip=63  count=100

It's NO typo to use "sda" here, since we work on the physical drive. Upload the file "sda1.pbr" to a file sharing site and give us the link.

Regards
cmdr

21

Re: gparted does not see partitions - but WinXP does

Upload the file "sda1.pbr" to a file sharing site and give us the link.

Of course, here it is:

http://dl.dropbox.com/u/2659967/sda1.pbr

Best, Ulrich

22

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,

I analyzed your XP PBR : it fits exactly to the values in MBR and is in no way unusual.
Your problem must have an other cause. I think XP would NOT boot, if there were faults in MBR or PBR (code, addresses or sizes).

Regards
cmdr

23

Re: gparted does not see partitions - but WinXP does

After failing with GParted, I used Norton PartitionMagic.  It immediately detected two problems with my partitioning, which it corrected right away. After the correction, GParted can detect my partitions again.

I missed to write down the exact information to the first problem but it was related to two partitions that were overlapping.

The second error was: The content of the boot record for the extended partition is in wrong order.  PartitionMagic can correct this problem by re-ordering the EPBR entries. (translated from German).

Thanks for your help.  Ulrich

24

Re: gparted does not see partitions - but WinXP does

Hello Ulrich,

cmdr wrote:

fdisk print-out indicates,  that a third primary partition (sda3) is located within the extended partition sda2 (overlapping). This probably breaks the whole extended partition chain. The easiest solution would be to delete sda3 and rebuild it as logical volume within the extended partition ( ->sda 8).

I think, I was right. Could you please give us a last "fdisk" print-out of your present partitioning scheme to finish this thread ?

Regards
cmdr

25

Re: gparted does not see partitions - but WinXP does

Of course, here you are: Unfortunately, it seems that I've destroyed my Windows by trying to install Grub. Thanks and best regards, Ulrich

scholz@binge:~$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb6d0e5be

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        5227    41985846    7  HPFS/NTFS
/dev/sda2            5228       19397   113812524    f  W95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary.
/dev/sda3           19397       19457      489951   83  Linux
/dev/sda5            5228        8532    26547349+  83  Linux
/dev/sda6            8533       19272    86268987   83  Linux
/dev/sda7           19273       19396      995998+  82  Linux swap / Solaris