LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   RAID-1 software CENTOS - no boot second disk (https://www.linuxquestions.org/questions/linux-server-73/raid-1-software-centos-no-boot-second-disk-4175424200/)

igor012 08-27-2012 07:43 AM

RAID-1 software CENTOS - no boot second disk
 
Hello,
I have installed a centos 6.3 with RAID-1 software and LVM.
To test it after the setup I removed the first hard drive and tried to boot on the second disk but nothing happens. Atfer a while it displays
Code:

Hard disk error
I used a kickstart for the install

Code:

# Kickstart file automatically generated by anaconda.

#version=RHEL6
install
cdrom
lang fr_FR.UTF-8
keyboard fr
network --device eth0 --mtu=1500 --bootproto static --ip 192.168.200.32 --netmask 255.255.255.0 --gateway 192.168.200.254 --nameserver 192.168.200.1,192.168.200.2 --hostname server1.company.com
rootpw  --iscrypted kkjkjknkjlgut
# Reboot after installation
reboot
firewall --service=ssh
authconfig --useshadow  --enablemd5  --enablecache
selinux --permissive
timezone Europe/Paris
bootloader --location=mbr --driveorder=sda,sdb --append="crashkernel=auto crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --drives=sda,sdb --initlabel --all
part raid.01 --size=200
part raid.02 --size=200
part raid.03 --grow --size=40600
part raid.04 --grow --size=40600
raid /boot --fstype=ext4 --level=1 --device=md0 raid.01 raid.02
raid pv.1000 --level=1 --device=md1 raid.03 raid.04
volgroup SystemVG --pesize=32768 pv.1000
logvol /var/log --fstype=ext4 --name=lv_log --vgname=SystemVG --size=10240
logvol / --fstype=ext4 --name=lv_root --vgname=SystemVG --size=4096
logvol swap --name=lv_swap --vgname=SystemVG --size=4096
logvol /tmp --fstype=ext4 --name=lv_tmp --vgname=SystemVG --size=1024
logvol /usr --fstype=ext4 --name=lv_usr --vgname=SystemVG --size=4096
logvol /var --fstype=ext4 --name=lv_var --vgname=SystemVG --size=10240



repo --name="CentOS"  --baseurl=file:///mnt/source/ --cost=100
repo --name="CentOS"  --baseurl=file:///mnt/source/ --cost=100
%packages
@Base
@Base
@Core
@Core
postfix
quota
strace
sysstat
vim-enhanced
yum-utils
-bluez-gnome
-bluez-libs
-bluez-utils
-cairo
-dnsmasq
-gamin
-irda-utils
-pcsc-lite
-sendmail
-wireless-tools
-ypbind
%end

I read online that I have to install grub on the second hard drive then I used those commands under grub shell.
Code:

root (hd0,0)
setup (hd0)
root (hd1,0)
setup (hd1)

And the two last one failed.

Code:

root (hd1,0)
 Filesystem type unknown, partition type 0xfd

and
Code:

setup (hd1)

Error 1        : Cannot mount selected partition

Any idea to get the second drive working if the first one fails ?

brak44 08-28-2012 05:32 PM

You may have prematurely removed the 2nd drive before it had synced up to the first.
Did you check it with cat /proc/mdstat ? to see if it had completed.
If not then copy the partition info across using
sfdisk -d /dev/sda | sfdisk /dev/sdb --force (this is an example for sda to sdb - use fdisk -l to show)
then do a
mdadm /dev/md0 --add /dev/sdb1
mdadm /dev/md1 --add /dev/sdb2
mdadm /dev/md2 --add /dev/sdb3

or whatever cat /proc/mdstat shows you for your md devices

igor012 08-29-2012 03:29 AM

It seems to be ok, doesn't it ?

cat /proc/mdstat
Code:

Personalities : [raid1]
md0 : active raid1 sda1[0] sda2[1]
      204788 blocks super 1.0 [2/2] [UU]
     
md1 : active raid1 sda3[1] sdb1[0]
      77744060 blocks super 1.1 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk


brak44 08-29-2012 09:07 PM

No, this looks totally wrong for a sensible raid1 configuration
md0 should be active raid1 sda1[0] sdb1[1]
md1 should be active raid1 sda2[0] sdb2[1]

igor012 08-30-2012 03:58 AM

Hello
I did it again on a VM and this partition plan seems to be working.

Code:

clearpart --none
volgroup lv --pesize=4096 pv.009001
logvol /var/log --fstype=ext4 --name=lv_log --vgname=lv --size=10240
logvol / --fstype=ext4 --name=lv_root --vgname=lv --size=20480
logvol swap --name=lv_swap --vgname=lv --size=4096
logvol /usr --fstype=ext4 --name=lv_usr --vgname=lv --size=4096
logvol /var --fstype=ext4 --name=lv_var --vgname=lv --size=4096
raid /boot --fstype=ext4 --level=1 --device=md0 raid.008001 raid.008017
raid pv.009001 --level=1 --device=md1 raid.008002 raid.008018

part raid.008001 --asprimary --size=200
part raid.008002 --grow --size=200

part raid.008017 --asprimary --size=200
part raid.008018 --grow --size=200

cat /prod/mdstat
Code:

Personalities : [raid1]
md0 : active raid1 sdb1[1] sda1[0]
      204788 blocks super 1.0 [2/2] [UU]

md1 : active raid1 sdb2[1] sda2[0]
      83679164 blocks super 1.1 [2/2] [UU]
      bitmap: 1/1 pages [4KB], 65536KB chunk

unused devices: <none>



All times are GMT -5. The time now is 03:07 PM.