|
|
Subject: GRUB - changing boot drive
From: Alex Fraser
Date: 10/1/2007 8:25:34 PM
Firstly, if there is a better place to ask this, please let me know.
My brother has a machine running openSUSE 10.2 (no other OS installed), and
I have been tasked with sorting out GRUB. Unfortunately I haven't been able
to figure out how from reading the manual, searching the web or even
experimenting in desperation...
There are currently two hard drives, hdb (via nForce2 IDE) and sda (via SiI
3112). At present, the system boots from hdb (ie the BIOS loads GRUB stage 1
from hdb's MBR). I am posting because hdb needs replacing as it is reporting
bad sectors, and also another drive (hdc) needs adding.
First question: how do I make the system boot from sda, without adversely
affecting the installed OS?
Second question: can I make it unaffected by addition/removal of IDE drives?
If so, how, and if not, what must I do before and/or after such changes to
keep GRUB working?
Some specific details:
# grub --version
grub (GNU GRUB 0.97)
# cat /boot/grub/device.map
(hd0) /dev/hdb
(hd1) /dev/sda
# cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Wed Jun 6 21:18:21 BST 2007
default 0
timeout 8
gfxmenu (hd1,1)/boot/message
##YaST - activate
title openSUSE 10.2 - 2.6.18.8-0.3
root (hd1,1)
kernel /boot/vmlinuz-2.6.18.8-0.3-default root=/dev/sda2 vga=0x31a
resume=/dev/sda1 splash=silent showopts
initrd /boot/initrd-2.6.18.8-0.3-default
title Failsafe -- openSUSE 10.2 - 2.6.18.8-0.3
root (hd1,1)
kernel /boot/vmlinuz-2.6.18.8-0.3-default root=/dev/sda2 vga=normal
showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off
initrd /boot/initrd-2.6.18.8-0.3-default
# fdisk -l /dev/hdb; fdisk -l /dev/sda
Disk /dev/hdb: 122.9 GB, 122942324736 bytes
255 heads, 63 sectors/track, 14946 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hdb1 1 14946 120053713+ fd Linux raid
autodetect
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 262 2104483+ 82 Linux swap / Solaris
/dev/sda2 * 263 1307 8393962+ 83 Linux
/dev/sda3 1308 16252 120045712+ fd Linux raid
autodetect
/dev/sda4 16253 38913 182024482+ 83 Linux
# cat /etc/fstab
/dev/sda1 swap swap defaults 0 0
/dev/sda2 / ext3 acl,user_xattr 1 1
[...]
/dev/md0 /storage/doc ext3 defaults 1
2
/dev/sda4 /storage/mpd1 ext3 defaults 1
2
# cat /proc/mdstat
Personalities : [raid1]
md0 : active raid1 sda3[0]
120045632 blocks [2/1] [U_]
unused devices: <none>
(hdb1 was part of md0, but seems to have been removed without
intervention...)
Thanks for reading,
Alex
Subject: GRUB - changing boot drive
From: Alex Fraser
Date: 10/3/2007 5:08:25 PM
"Alex Fraser" <me@privacy.net> wrote in message
news:ss-dnWEL8tUp1JzaRVnytAA@eclipse.net.uk...
[snip]
> First question: how do I make the system boot from sda, without adversely
> affecting the installed OS?
>
> Second question: can I make it unaffected by addition/removal of IDE
> drives? If so, how, and if not, what must I do before and/or after such
> changes to keep GRUB working?
I eventually got it to work. As I was already suspected when I posted, I
needed to make GRUB think the drives were how they would be after changing
things over. So I started by adding another suitable entry to
/boot/grub/menu.lst, and then in grub:
device (hd0) /dev/sda
root (hd0,1)
setup (hd0)
Finally, I rebooted and changed the boot order in the BIOS.
Alex
|