repair a broken partition table

Asked by sammy

I try to install ubuntu 7.10 on my computer without formatting my ntfs partitions.
But, even my XP and the ubuntu live cd works well with the hard disk, the partitioner can' recognize anything - the only option is to format everything. It seems that the HDD isn't formatted well....(Partition 1 does not end on cylinder boundary.)

can you help me repair the partition table without deleting the old partitions?

and this is the problem:
ubuntu@ubuntu:~$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/hda: 40.0 GB, 40020664320 bytes
16 heads, 63 sectors/track, 77545 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Disk identifier: 0x99399939

   Device Boot Start End Blocks Id System
/dev/hda1 * 1 20321 10241406 7 HPFS/NTFS
Partition 1 does not end on cylinder boundary.
/dev/hda2 20321 34537 7165021+ f W95 Ext'd (LBA)
Partition 2 does not end on cylinder boundary.
/dev/hda3 34537 34633 48163+ 83 Linux
Partition 3 does not end on cylinder boundary.
/dev/hda5 20321 32513 6144799+ 83 Linux
/dev/hda6 32513 34537 1020096 82 Linux swap / Solaris
/dev/hda7 34633 77520 21615426 7 HPFS/NTFS

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
sammy
Solved:
Last query:
Last reply:
Revision history for this message
Dave Cohen (dgcohen61430) said :
#1

Yes, you can download a trial of bootitng from www.terabyteunlimited.com. Make the boot media, you may have to read the instructions on the site.
Boot from the boot media and at the install dialog, cancel and enter maintanance mode. From partition work you can resize partitions, delete or create new ones. If you have a dvd burner it would be a good idea to make an image of your partitions before you mess with them.

I have no personal interest in this product, but it's very inexpensive to register and once installed solves all your multi boot problems, you can have dozens of partitions, no 4 primaries limit. Plus it includes imaging.
Dave cohen

Revision history for this message
sammy (ticaloshu) said :
#2

thanks dave!
finally, i used fdisk to rearrange partitions, it seemed to be something more complicated that fdisk reported. good idea with the backup.

Revision history for this message
Jeffrey (jeff0stella) said :
#3

Can fdisk be used to correct partition tables?
If so how do I use it?

Revision history for this message
sammy (ticaloshu) said :
#4

i deleted some of the partitions, and rebuilt them. so, i cannot say i corrected them with fdisk.... try fdisk --help for more info and see if those commands can help you with ur problem.

maybe dave's solutions would be better, but i didn't tested it