0

I have just installed Ubuntu into one of two 60GB partitions on my hard disc. I think it is sda2 and that the other partition (sda1) contains a failed installation of Ubuntu. Sda2 is further divided into sda6 (59GB) and sda5 (swap space), so can I conclude that the working copy of Ubuntu is in sda2? The disk utility tells me that sda1 is not mounted and bootable, and sda6 is mounted at / but the partition flag just says “-“. How can I delete the failed installation and ensure that I can still boot, please?

2 Answers 2

0

I suspect you have this setup:

1 HDD, partitioned with the MBR scheme:

SDA1: A primary partition (containing your failed installation)  
SDA2: An **extended** partition, containing two volumes:  
      SDA5 (1 GB, swap)
      SDA6 (59 GB)
SDA3: not used.
SDA4: not used.

(Drives partitioned with the MBR schema can only have up to 4 primary partitions. One of those can be an extended partition which basically says 'turn the page, look at the next list for more partitions whose data does not fit in the primary part).

If this is the case you should be able to set partition 6 to active.
You do that with: fdisk /dev/sda a 6

Note that there should only be one single active partition at the time. If sda1 is also marked active then you either have to manually remove this flag. You toggle it in the same way as you did with partition 6. From fdisk type a 1 (Active, partition number to change).

However, start with fdisk -l (fdisk, list all partitions) or with fdisk /dev/sda p (fdisk on /dev/sda, then print partition table) to verify that the partition layout is as I assumed.

Example output from the VM I just tested with: (sda1 is active in this example).

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    16779263     8388608   83  Linux
/dev/sda2        16779264    20971519     2096128   82  Linux swap / Solaris
3
  • Thanks for the quick reply - you describe the setup exactly. However, I am faced with the Ubuntu dashboard with nowhere to type fdisk. In fact "Help" has never heard of it and I thought it was a DOS command. I fear I shall have to re-install.
    – David
    Mar 28, 2013 at 14:07
  • No need to reinstall. If you get logged in then you can either start a shell (or a xterm) and type /sbin/fdisk on the prompt. Or go to a text console (usually Control-ALT-F1/F2...F6. Log in there and type it. Ir run it from a liveOS CD. Or even boot windows (from the windows DVD and use F10 to get a command prompt and use diskpart (select disk 1,select partition 6, active).
    – Hennes
    Mar 28, 2013 at 15:23
  • Thanks for your suggestions. Out of desperation, I re-booted into recovery mode and found an option that enabled me to run fdisk and follow your original instructions. I had to select m for help as my version required a slightly different procedure for changing the boot partition (not helped by l looking very much like 1), but it seems to have worked.
    – David
    Mar 28, 2013 at 16:40
0

To change which partition will be bootable from terminal: (I'm not sure does it works that way if you have EFI boot)

sudo sfdisk -AX /dev/sdY

where X is partition number you want to boot from, and Y is disk number.

To get know your partitions and disks type

sudo sfdisk -l

or

sudo fdisk -l

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .