[H-GEN] replace XP partition with Ubuntu partition

Russell Stuart russell-humbug at stuart.id.au
Tue Dec 14 20:49:45 EST 2010


On Wed, 2010-12-15 at 11:10 +1000, Peter Robinson wrote:
> E.G.
> Do I need to make this partition (that was XP at the start of the disk) 
> bootable?

Depends on the boot manager you have loaded into the MBR.  The "standard
one" looks for a partition that is bootable, reads in the first sector
and jumps to the first instruction in the sector.  So in that case, yes,
you need to make it bootable.

Linux boot managers don't use the boot flag at all.  They load a control
file off the disk and typically display it as a menu.  So for example if
you have LILO or grub in the MBR then you don't have to do anything with
the boot flag.

> I presume I will have to reconfigure grub?
> Can I use gparted to set up the mount point for me?

It depends on what you are doing.  If you are just leaving the existing
Ubuntu root file system intact and just re-formatting the XP partition
to hold an Linux file system then you won't have to do anything.

If you are doing more radical things that involve moving the existing
Ubuntu root file system, you *will* have to tell your boot loader about
it.  When the boot loader is installed, the boot record it creates
contains hard wired sector numbers for the second stage of the boot
process.  (The boot record is the thing written into the MBR, or the
first sector of a partition.)  These will be sector numbers for files
within the Ubuntu root file system.  Typically these files live
under /boot.  If those files are in any way touched / moved / modified,
the boot loader has to be reinstalled.

I don't know if the gparted live usb/cd will do this your you.  If it
doesn't reinstalling is in principle simple.  You just chroot to the new
root partition and run grub-install /dev/sdX (/dev/sda typically).  Of
course getting to the point of being able to run those commands can be
tricky as by definition the machine isn't bootable.  So it usually
involves live CD's/USB's and manually mounting things.  It is wise to
have a tested live CD/USB lying around, so when you get to this point
you aren't scratching around for one when your machine is dead and as a
bonus you can practice running these commands before hand.  They are
idempotent.

Finally, I am enough of a wimp to never attempt this sort of thing
without backing up the HDD to an external drive first.  Even if you
don't have one on hand, a 1TB USB external drive is all of $73 at umart.




More information about the General mailing list