Terminus Logo

Question ? How can I boot from the SATA drive 2 of a Software Raid-1 System ?  

 As configuration starting point - here is the setup as found on my server:
/dev/sda - Primary S-ATA drive
/dev/sdb - Secondary S-ATA drive

Note that both drives are master drives - as S-ATA does not handle Primary/Secondary stuff.
Having the System up and running - the partitions look like this - assuming they are setup already:

Filesystem            Size  Used Avail Use% Mounted on
/dev/md0              380M   75M  267M  22% /
/dev/md1               76M  9.8M   63M  14% /boot
/dev/md2              2.9G  378M  2.3G  15% /home
/dev/md5               26G   11G   13G  48% /home/Share
/dev/md6              981M  132K  881M   1% /tmp
/dev/md3              2.0G  1.3G  476M  73% /usr
/dev/md4              4.4G  1.3G  2.7G  32% /var

Note that the Primary root partition is md0 and the boot partition md1. This will be important in the grub-configuration later on.
The following grub.conf file has the following features:
- Has several harddisks to boot from
- uses fallback to jump to the next harddrive in case the first one fails
- prepares the connection of a serial console, while also displaying all stuff on tty0

Assuming you have the following grub.conf file in your /boot partition - which is md1:

# Boot automatically after 30 secs.
timeout 50

# By default, boot the first entry.
default 0

serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
terminal --timeout=50 serial console

# Fallback to the second entry.
fallback 1

# Splash-Image...
# splashimage=(hd0,0)/grub/splash.xpm.gz

# For booting with disc 0 kernel
title  EpiaN (hd0,1)
kernel (hd0,1)/vmlinuz-2.6.13.2-EpiaN root=/dev/md0 
devfs=nomount acpi=ht resume=/dev/md7 splash=silent
read-only console=ttyS0,115200n8 console=tty0 initrd=(hd0,1)/initrd-2.6.13.2-EpiaN.img # For booting with disc 1 kernel title EpiaN (hd1,1) kernel (hd1,1)/vmlinuz-2.6.13.2-EpiaN root=/dev/md0
devfs=nomount acpi=ht resume=/dev/md7 splash=silent
read-only console=ttyS0,115200n8 console=tty0 initrd=(hd1,1)/initrd-2.6.13.2-EpiaN.img # Mandrake Kernel title linux-i686-up-4GB (hd0,1) kernel (hd0,1)/vmlinuz-2.6.11-6mdk-i686-up-4GB root=/dev/md0 devfs=nomount acpi=ht resume=/dev/md7
splash=silent read-only console=ttyS0,115200n8
console=tty0 initrd=(hd0,1)/initrd-i686-up-4GB.img # Mandrake Kernel title linux-i686-up-4GB (hd1,1) kernel (hd1,1)/vmlinuz-2.6.11-6mdk-i686-up-4GB root=/dev/md0 devfs=nomount acpi=ht resume=/dev/md7
splash=silent read-only console=ttyS0,115200n8
console=tty0 initrd=(hd1,1)/initrd-i686-up-4GB.img # For booting with disc 0 kernel - Failsafe title Failsafe (hd0,1) kernel (hd0,1)/vmlinuz root=/dev/md0 devfs=nomount acpi=ht
resume=/dev/md7 splash=silent failsafe read-only
console=ttyS0,115200n8 console=tty0 initrd=(hd0,1)/initrd.img # For booting with disc 1 kernel - Failsafe title Failsafe (hd1,1) kernel (hd1,1)/vmlinuz root=/dev/md0 devfs=nomount acpi=ht
resume=/dev/md7 splash=silent failsafe read-only
console=ttyS0,115200n8 console=tty0 initrd=(hd1,1)/initrd.img

you would issue the following commands to install grub on your harddisks

grub> root (hd0,1)
 Filesystem type is ext2fs, partition type 0xfd

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

grub> root (hd1,1)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd1) 
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd1)"...  16 sectors are
embedded.
succeeded
 Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p
(hd1,1)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.

That's it. You're done. Please keep in mind - that the command "root (hdx,x)" determins where the /boot partition is to be found. In the grub.conf file - we're using the "hd0(0.1)/vmlinuz" to actually tell grub to get the kernel files etc. from that partition - which is not mounted - thus directly from "/".
Note the order of the bootable kernels. You'll notice that "title EpiaN (hd0,1)" comes first, then "title EpiaN (hd1,1)". Using the "fallback 1" statement make grub fall back to the second entry - in case the first one is not found - making the system kind of automatically boot the alternate raid-1 drive - in case drive 0 is dead. 

Entered by smurphy on Monday, 26 September 2005 @ 20:04:21  
Linux General - Common Linux problems, # Hits: 99350

Attach   grub.conf.txt  [ 1,875 bytes - text/plain ]

Next  How to reinstall grub from a rescue mode ? 

This page was issued from the Terminus Website:
https://www.solsys.org

The URL for this page is:
https://www.solsys.org/mod.php?mod=faq&op=view&faq_id=96


  Close