thewatertower.org.uk

GRUB


Reinstalling

A botched install of OpenSolaris along side Ubuntu has left my laptop unbootable.

I boot into the Ubuntu live CD with a view to reinstalling GRUB. Most of the configuration is held in /boot/grub, so not knowing the menu configuration isn't a problem.


ubuntu@ubuntu:~$ sudo bash
root@ubuntu:~# grub
grub> geometry hd0

Error 11: Unrecognized device string

grub> geometry (hd0)
drive 0x80: C/H/S = 4864/255/63, The number of sectors = 78140160, /dev/sda
   Partition num: 0,  Filesystem type unknown, partition type 0x82
   Partition num: 1,  Filesystem type is reiserfs, partition type 0x83
   Partition num: 2,  Filesystem type unknown, partition type 0xbf

grub> root (hd0,1)

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
 Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"...  19 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+19 p (hd0,1)/boot/grub/stage2 /boot/grub/menu.lst"
... succeeded
Done.

grub> quit

Mirrored disks

Scenario: a linux system built on a pair of mirrored disks. /boot is mirrored as a separate filesystem or as part of / and the installer has installed grub and the main boot record on the primary disk.

NB - you can't boot off RAID5, so don't try. If you have three disks, set aside half a gig on each for /boot. Mirror two of them and either pop the third in as a spare volume in the array, or leave it in the box for when a disk fails. Don't be miserly with /boot, not with Ubuntu anyway. It needs room in root for kernel updates.

Search (hd0), (hd1) etc and find the second disk that has /boot mirrored on it.

Specify the right partition as the root partition; ie root (hd1,0), then setup (hd1) and quit

There's no point pointing the boot partition on the second disk back to the primary. There are scenarios when that might be desirable but RAID and the Grub/Linux configuration will redirect attention to the RAID devices sooner or later anyway, and the most important scenario is loss of the primary disk.


Printed and hosted by Prater Raines Ltd, 98 Sandgate High Street, Folkestone CT20 3BY.
Published and promoted by Ben Prescott, 14, St James's Square, Bournemouth, BH5 2BX. All rights reserved.
The views expressed are solely those of the author, not of the service provider.