GParted detects entire disk as UNALLOCATED SPACE + hd0 out of disk

Posted by msPeachy on Ask Ubuntu See other posts from Ask Ubuntu or by msPeachy
Published on 2012-07-01T03:10:22Z Indexed on 2012/07/08 15:23 UTC
Read the original article Hit count: 329

Good day to everyone. I hope someone can help me with my problem.

I have a dual boot Windows and Ubuntu system.

I recently encountered an hd0 out of disk error and wasn't able to boot Ubuntu. So I booted into Windows. After 2 to 3 times of booting and rebooting Windows, I tried booting Ubuntu again but still I get the same hd0 out of disk error.

I decided to run Ubuntu from LIVEUSB to try to fix my Ubuntu partition using GParted, but when I run GParted, it shows my entire disk as UNALLOCATED SPACE!

The strange thing is that Nautilus still shows and mounts my partitions. Also every time I boot into Windows , my partitions exists and I am able to read and write to them.

I have no idea what is wrong. Please help! I can't stand using Windows since most of the tools I use are in Ubuntu. I don't mind reinstalling Ubuntu. In fact I already tried reinstalling using the LIVEUSB but since GParted or the Ubuntu installer itself does not recognize my partitions and shows the entire disk as unallocated space, I decided not to continue.

I am currently running Ubuntu from LIVEUSB. Here's the outpuf of sudo fdisk -l

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: 0xb30ab30a

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   104869887    52433920   83  Linux
/dev/sda2       104869888   105074687      102400    7  HPFS/NTFS/exFAT
/dev/sda3       105074688   156149759    25537536    7  HPFS/NTFS/exFAT
/dev/sda4       156151800   625153409   234500805    f  W95 Ext'd (LBA)
/dev/sda5       156151808   169156591     6502392   82  Linux swap / Solaris
/dev/sda6       169158656   294991871    62916608    7  HPFS/NTFS/exFAT
/dev/sda7       294993920   471037944    88022012+   7  HPFS/NTFS/exFAT
/dev/sda8       471041928   625121152    77039612+   7  HPFS/NTFS/exFAT

When I run, sudo parted -l, I got this error message:

ubuntu@ubuntu:~$ sudo parted -l
Error: Can't have a partition outside the disk!

UPDATE

I think I might know the problem. The total sectors of sda is 625142448 but the extended partition (sda4) ends at 625153409.

Now, my question is, how do I fix this or modify the extended partition (sda4) to matched the total number of sectors?

Anyone, please???


UPDATE

I was able to fix the unallocated space issue with the help of Rod Smith's tool called fixparts

I am now able to view my partitions via GParted in LiveUSB. But the error: hd0 out of disk. Press any key to continue... still persists on reboot. I still can't boot into Ubuntu.

Can someone help me please???

© Ask Ubuntu or respective owner

Related posts about partitioning

Related posts about gparted