LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 08-27-2012, 07:43 AM   #1
igor012
Member
 
Registered: Feb 2010
Posts: 87

Rep: Reputation: 2
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 ?
 
Old 08-28-2012, 05:32 PM   #2
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 81

Rep: Reputation: 23
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
 
Old 08-29-2012, 03:29 AM   #3
igor012
Member
 
Registered: Feb 2010
Posts: 87

Original Poster
Rep: Reputation: 2
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
 
Old 08-29-2012, 09:07 PM   #4
brak44
Member
 
Registered: Aug 2010
Location: Brisbane Australia
Distribution: Centos, Fedora
Posts: 81

Rep: Reputation: 23
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]
 
Old 08-30-2012, 03:58 AM   #5
igor012
Member
 
Registered: Feb 2010
Posts: 87

Original Poster
Rep: Reputation: 2
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>
 
  


Reply

Tags
centos, grub, lvm, raid1


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 11 RAID 1, Disk failure - How to boot from the single working disk NothingSpecial Linux - Hardware 2 10-18-2009 06:20 PM
[SOLVED] Software RAID (mdadm) - RAID 0 returns incorrect status for disk failure/disk removed Marjonel Montejo Linux - General 4 10-04-2009 06:15 PM
Adding an old software-RAID array to a software-RAID installation.. Boot problems GarethM Linux - Hardware 2 05-05-2008 03:16 PM
Will a ex - Software Raid 1 disk boot without Raid software? carlosruiz Linux - Software 0 05-27-2006 01:12 PM
Software RAID 1 setup on CentOS using Grub boot loader kumarsundaram Linux - Software 1 11-30-2005 12:57 PM


All times are GMT -5. The time now is 08:56 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration