Configurare Grub per raid: Difference between revisions

From RVM Wiki
Jump to navigation Jump to search
m prove da fare
 
(4 intermediate revisions by the same user not shown)
Line 10: Line 10:
       79103936 blocks [2/1] [UU]
       79103936 blocks [2/1] [UU]
</pre>
</pre>
Dopo aver installato Grub, lanciare come root ed eseguire:
 
Dal BIOS, con entrambi i dischi, si ha:
 
*SATA0=sda
*SATA1=sdb
 
In caso il primo hard disk venga tolto il secondo hard disk viene visto dal BIOS sempre come SATA1, ma dal kernel SEMPRE come sda.
 
==Esecuzione batch==
L'esecuzione batch è possibile con questo script
 
* Configurazione sda
 
export DEVICE="sda"


<pre>
<pre>
# grub
sudo grub --batch <<EOFile
grub> root (hd0,0)
device (hd0) /dev/${DEVICE}
Filesystem type is ext2fs, partition type 0xfd
root (hd0,0)
setup (hd0)
quit
EOFile
</pre>


grub> setup (hd0)
* Ripetere per
  Checking if "/boot/grub/stage1" exists... yes
  export DEVICE="sdb"
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,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.


grub> root (hd1,0)
<pre>
Filesystem type is ext2fs, partition type 0xfd
sudo grub --batch <<EOFile
device (hd0) /dev/${DEVICE}
root (hd0,0)
setup (hd0)
quit
EOFile
</pre>


grub> setup (hd1)
*Installare l'MBR:
  Checking if "/boot/grub/stage1" exists... yes
  sudo env DEVICE="sda" grub-install --recheck /dev/${DEVICE}
Checking if "/boot/grub/stage2" exists... yes
  sudo env DEVICE="sdb" grub-install --recheck /dev/${DEVICE}
  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,0)/boot/grub/stage2 /boot/grub/grub.conf"... succeeded
Done.


grub> quit
==Esecuzione manuale==
 
<pre>
sudo grub-install --recheck /dev/sda
sudo grub-install --recheck /dev/sdb
</pre>
</pre>
<pre>
sudo grub
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
device (hd0) /dev/sdb
root (hd0,0)
setup (hd0)
quit
</pre>
Questa configurazione è stata testata e funziona con hdd sata.


'''RICORDARSI SEMPRE DI FARE LE PROVE CON:'''
'''RICORDARSI SEMPRE DI FARE LE PROVE CON:'''
Line 53: Line 82:


== Riferimenti ==
== Riferimenti ==
*[http://www.linuxsa.org.au/mailing-list/2003-07/1270.html LinuxSA Mailing List: GRUB + RAID howto]
* [http://www.debian-administration.org/articles/393 Debian Administration :: Mondo, RAID, Debian Sarge Workaround]
* [http://www.linuxsa.org.au/mailing-list/2003-07/1270.html LinuxSA Mailing List: GRUB + RAID howto]

Latest revision as of 10:23, 7 September 2010

Supponendo di aver creato un array /dev/md0 come

cat /proc/mdstat
Personalities : [raid0] [raid1] [raid5]
md1 : active raid1 sda2[0] sdb2[1]
      1269056 blocks [2/2] [UU]

md0 : active raid1 sda1[2] sdb1[1]
      79103936 blocks [2/1] [UU]

Dal BIOS, con entrambi i dischi, si ha:

  • SATA0=sda
  • SATA1=sdb

In caso il primo hard disk venga tolto il secondo hard disk viene visto dal BIOS sempre come SATA1, ma dal kernel SEMPRE come sda.

Esecuzione batch

L'esecuzione batch è possibile con questo script

  • Configurazione sda
export DEVICE="sda"
sudo grub --batch <<EOFile
device (hd0) /dev/${DEVICE}
root (hd0,0)
setup (hd0)
quit
EOFile
  • Ripetere per
export DEVICE="sdb"
sudo grub --batch <<EOFile
device (hd0) /dev/${DEVICE}
root (hd0,0)
setup (hd0)
quit
EOFile
  • Installare l'MBR:
sudo env DEVICE="sda" grub-install --recheck /dev/${DEVICE}
sudo env DEVICE="sdb" grub-install --recheck /dev/${DEVICE}

Esecuzione manuale

sudo grub-install --recheck /dev/sda
sudo grub-install --recheck /dev/sdb
sudo grub

device (hd0) /dev/sda
root (hd0,0) 
setup (hd0)

device (hd0) /dev/sdb
root (hd0,0) 
setup (hd0)

quit

Questa configurazione è stata testata e funziona con hdd sata.


RICORDARSI SEMPRE DI FARE LE PROVE CON:

  • sda con cavo dati STACCATO e sdb funzionante
  • sdb con cavo dati STACCATO e sda funzionante
  • sda con cavo alimentazione STACCATO e sdb funzionante
  • sdb con cavo alimentazione STACCATO e sda funzionante

Riferimenti