Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had Ubuntu 9.04 and I want to upgrade to 10.04. It is dual-booted with Windows Vista. I decided to do a clean install from a live CD. The live CD wasn't able to detect the partitions and instead just gave me the option of erasing the entire hard drive. I booted into Windows and erased my Ubuntu partition hoping that the live CD would recognise the free space. It doesn't, and now I can't boot into Windows either since I deleted the grub settings.

So:

How can I get my live CD to recognise the partitions? How can I boot back into Windows before this is fixed?

I am also restricted in that my only resource is the live CD (and internet) until the end of this weekend.

Thanks

edit:

output of sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical / optimal IO): 512 bytes / 512 bytes
Disk identifier: 0x90000000

Device Boot      Start         End      Blocks   Id  System
/dev/sda1              17        1322    10485760    7  HPFS/NTFS
/dev/sda2   *        1322        9200    63279092    7  HPFS/NTFS
/dev/sda3            9201       14594    43320297+   f  W95 Ext'd (LBA)
/dev/sda4   *       14267       14594     2620416    c  W95 FAT32 (LBA)
/dev/sda5           14054       14266     1710891   82  Linux swap / Solaris

output of sudo parted -l

Error: Can't have overlapping partitions.                                 

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0 has been opened read-only.
Error: /dev/sr0: unrecognised disk label

After trying some other utilities (eg lilo) these are the new conditions of my partitions.

New output of sudo sfdisk -d /dev/sda

# partition table of /dev/sda
unit: sectors
/dev/sda1 : start= 258048, size= 20971520, Id= 7
/dev/sda2 : start= 21229568, size=126558184, Id= 7, bootable
/dev/sda3 : start=225761507, size= 3421783, Id= f
/dev/sda4 : start=229197824, size= 5240832, Id= c, bootable
/dev/sda5 : start=225761508, size= 3421782, Id=82

New output of sudo fdisk -lu

Device Boot      Start         End      Blocks   Id  System    
/dev/sda1          258048    21229567    10485760    7  HPFS/NTFS    
/dev/sda2   *    21229568   147787751    63279092    7  HPFS/NTFS    
/dev/sda3       225761507   229183289     1710891+   f  W95 Ext'd (LBA)    
/dev/sda4   *   229197824   234438655     2620416    c  W95 FAT32 (LBA)    
/dev/sda5       225761508   229183289     1710891   82  Linux swap / Solaris

New output of sudo parted -l

Partition Table: msdos    
Number  Start   End     Size    Type      File system     Flags    
1      132MB   10.9GB  10.7GB  primary   ntfs    
2      10.9GB  75.7GB  64.8GB  primary   ntfs            boot    
3      116GB   117GB   1752MB  extended                  lba    
5      116GB   117GB   1752MB  logical   linux-swap(v1)
4      117GB   120GB   2683MB  primary   fat32           boot, lba    

Warning: Unable to open /dev/sr0 read-write (Read-only file system).  /dev/sr0    
has been opened read-only.    
Error: /dev/sr0: unrecognised disk label
share|improve this question
    
Are you able to post the output of sudo fdisk -l and sudo parted -l? –  arrange Mar 25 '11 at 19:04
    
Please edit your first post and post the output there using the code tag. –  arrange Mar 25 '11 at 20:04
    
This is the output of sudo parted -l: Error: Can't have overlapping partitions. Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only. Error: /dev/sr0: unrecognised disk label –  AHG Mar 25 '11 at 20:07

2 Answers 2

up vote 2 down vote accepted

GParted won't work if you have overlapping partitions. In my opinion you have 2 options now:

  • the brute force option - wipe out the disk and reinstall all;

  • the repair partition table option - look at this nice tutorial how to do it. Before you do it, don't forget to back up your data.

As for booting into Windows, either repair the table and install Ubuntu, or repair MBR using any of the Windows recovery tools (depends on the version of Windows you have, just Google it).

share|improve this answer
    
ok, I'll try it now –  AHG Mar 25 '11 at 20:26
    
Follow up: I ran fixparts but I wasn't sure what to do. The tutorial wasn't really clear about what I had to do. I wasn't sure what I was looking for in the partition table –  AHG Mar 27 '11 at 12:00
    
@AHG: OK, can you please post sudo sfdisk -d /dev/sda? –  arrange Mar 27 '11 at 20:52
    
@arrange: I added the output to my original post (sorry about formatting, It wouldn't display it as I pasted it) –  AHG Mar 27 '11 at 22:17
    
It looks like there are no overlapping partitions now, and the output of sfdisk differs from that from fdisk... Have you been doing anything with the table? Is it working now? If not, can you post again sudo fdisk -lu, sudo sfdisk -d /dev/sda, sudo parted -l? (You can use paste.ubuntu.com if you have problems with formatting) –  arrange Mar 27 '11 at 22:47

You can repair windows mbr by booting the install disc, getting a terminal and type fixmbr(for xp, dont know how it is on vista.)

share|improve this answer
    
I'll have access to a windows cd in a few days, at the moment I only have the Ubuntu live cd –  AHG Mar 27 '11 at 22:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.