pbm partitionable RAID1 CentOS 6.3

General support questions
Post Reply
globalsi
Posts: 7
Joined: 2012/09/27 12:02:47

pbm partitionable RAID1 CentOS 6.3

Post by globalsi » 2012/09/27 13:09:15

Hi,

I followed the following tutorial [url=http://wiki.centos.org/HowTos/Install_On_Partitionable_RAID1]http://wiki.centos.org/HowTos/Install_On_Partitionable_RAID1[/url] to build a software partitionable RAID1.

I'v got 2*1TB SATA disk (/dev/sda & /dev/sdb)
I'v make 3 partitions on sda :
- /boot (500MB)
- swap (8GB)
- / (rest of the disk except at the end 3MB)

I've boot with rescue cd , buid the raid and do :
[quote]mkdir /mnt/sysimage
mount /dev/md_d0p3 /mnt/sysimage
mount /dev/md_d0p1 /mnt/sysimage/boot
mount -o bind /dev /mnt/sysimage/dev
mount -o bind /selinux /mnt/sysimage/selinux
mount -o bind /tmp /mnt/sysimage/tmp
mount -t proc none /mnt/sysimage/proc
mount -t sysfs none /mnt/sysimage/sys
chroot /mnt/sysimage
[/quote]

after chrooting, I :
- create /etc/mdadm.conf
- set in /etc/fstab /dev/md_d0p1 for /boot , /dev/md_d0p2 for swap and /dev/md_d0p3 for /
- replace in the /etc/grub.conf LABEL with /dev/md_d0p1 and delete rd_NO_MD
build the initramfs

Everything seemed to be going well but when I reboot the server, I have the following line:

[quote]mount: /dev/md_d0p1 already mounted or /sysroot busy
mount: according to mtab, /dev/md_d0p1 is already mouted on /sysroot
mount: /dev/md_d0p1 already mounted or /sysroot busy
mount: according to mtab, /dev/md_d0p1 is already mouted on /sysroot
mount: /dev/md_d0p1 already mounted or /sysroot busy
mount: according to mtab, /dev/md_d0p1 is already mouted on /sysroot
mount: /dev/md_d0p1 already mounted or /sysroot busy
mount: according to mtab, /dev/md_d0p1 is already mouted on /sysroot



kernel panic - not syncing:Attempted to kill init
Pid: 1, comm: init Tainted: G I--------------- 2.6.32-279.el6.x86_64
#1
Call Trace:
[] ? panic+0xa0/0x168
[] ? do_exit+0x862/0x870
[] ? fput+0x24/0x30
[] ? do_group_exit+0x58/0xd0
[] ? sys_exit_group+0x17/0x20
[] ? system_call_fastpath+0x16/0x1b
[/quote]

any ideas on what's wrong ?

Thanks

simon_matthews
Posts: 315
Joined: 2012/09/15 21:06:54

Re: pbm partitionable RAID1 CentOS 6.3

Post by simon_matthews » 2012/09/29 00:42:18

[quote]

any ideas on what's wrong ?

Thanks[/quote]

Attempting to use partitionable RAID instead of LVM?

LVM is well supported (inlcuding in the installer), I am at a loss to understand why you should not want to use it.

globalsi
Posts: 7
Joined: 2012/09/27 12:02:47

Re: pbm partitionable RAID1 CentOS 6.3

Post by globalsi » 2012/10/01 09:40:49

Hi, thank you for your interest in my problem!

I suppose partitionable RAID is also well supported (the howto is from wiki.centos.org )
and I'd prefer user it because :
[quote]Why would you want to have a system installed on a partitionable software RAID1?

If you are installing a system on a partitionable RAID you can use the whole hard drive as a RAID component device, and since RAID1 is a mirror, you will be able to boot your system from any of the drives in case of failure without any additional tricks required to preserve bootloader configuration, etc. And when you need to repair a failed RAID volume with the whole hard drive as a RAID component, all you have to do is to insert a new hard drive and run mdadm --add; no partitioning or anything else required. [/quote]

I've retry with only two partitions :
- swap (8GB)
- / (rest of the disk except at the end 3MB)
and this time, i'm able to boot.

Unfortunately, when I simulate a failure, (boot with only one disk), i'v got the nearly same errors than post #1.
[quote]
kernel panic - not syncing:Attempted to kill init
Pid: 1, comm: init Tainted: G I--------------- 2.6.32-279.el6.x86_64
#1
Call Trace:
[] ? panic+0xa0/0x168
[] ? do_exit+0x862/0x870
[] ? fput+0x24/0x30
[] ? do_group_exit+0x58/0xd0
[] ? sys_exit_group+0x17/0x20
[] ? system_call_fastpath+0x16/0x1b
[/quote]

any idea of what is technically wrong (except my choice of partitionable RAID1) ?

globalsi
Posts: 7
Joined: 2012/09/27 12:02:47

Re: pbm partitionable RAID1 CentOS 6.3

Post by globalsi » 2012/10/01 12:59:13

Seem to be a bug ([url=http://bugs.centos.org/view.php?id=5400]report 5400[/url] for 6.2 and [url=http://bugs.centos.org/view.php?id=5970]report 5970[/url] for 6.3).
Steps to solve :
1/ add "rdshell" to the kernel command line
2/ dracut:/# mdadm --run /dev/md_d0
3/ dracut:/# exit

This seem to ok for next boot.

I'll run test and mark SOLDED if all is ok.

simon_matthews
Posts: 315
Joined: 2012/09/15 21:06:54

Re: pbm partitionable RAID1 CentOS 6.3

Post by simon_matthews » 2012/10/01 20:41:03

[quote]
globalsi wrote:
Hi, thank you for your interest in my problem!

I suppose partitionable RAID is also well supported (the howto is from wiki.centos.org )
and I'd prefer user it because :
[quote]Why would you want to have a system installed on a partitionable software RAID1?

If you are installing a system on a partitionable RAID you can use the whole hard drive as a RAID component device, and since RAID1 is a mirror, you will be able to boot your system from any of the drives in case of failure without any additional tricks required to preserve bootloader configuration, etc. And when you need to repair a failed RAID volume with the whole hard drive as a RAID component, all you have to do is to insert a new hard drive and run mdadm --add; no partitioning or anything else required. [/quote]

I've retry with only two partitions :
- swap (8GB)
- / (rest of the disk except at the end 3MB)
and this time, i'm able to boot.
6/0x1b
[/quote]


You already have your disk partitioned, so you already lost the advantage of not partitioning the disk. Putting either / or /boot on a RAID1 partition should allow you to boot if either hard drive fails. Perhaps you don't have grub properly installed on the second drive (I have a seen a number of howtos on the web which have bad information on this -- the missing information is that, when writing the boot record to the second drive, grub has to be setup so that it will boot off the first drive -- remember, that if the first drive fails, what was the second drive will now be the first drive on the next boot).

You also need to put your swap on a RAID partition (RAID1 or RAID5 NOT RAID0), because otherwise if the drive that contains your swap fails, your system will go down.

If you want to boot off a MDRAID RAID1 partition, you need to make sure it is version 0.9 or 1.0. You cannot boot off a version 1.2 MDRAID partition because of the layout of the RAID metadata.

I strongly suggest that you use RAID1 and LVM to do this. It is simple, supported by the installer and the only downside is that you have to partition any replacement hard drives. I suspect that LVM has much more flexibility on re-sizing partitions.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

pbm partitionable RAID1 CentOS 6.3

Post by jlehtone » 2012/10/01 22:06:55

@ simon_matthews: So you do recommend the use of mirrored LVM? Doesn't that require a "log" to be placed on some volume?


It is sad to learn that the dracut -- while more dynamic than mkinitrd -- still can fail on RAID array initialization.

globalsi
Posts: 7
Joined: 2012/09/27 12:02:47

Re: pbm partitionable RAID1 CentOS 6.3

Post by globalsi » 2012/10/05 08:52:52

info : yesterday, there was a update of dracut ... maybe the bug is corrected.

simon_matthews
Posts: 315
Joined: 2012/09/15 21:06:54

Re: pbm partitionable RAID1 CentOS 6.3

Post by simon_matthews » 2012/10/10 05:22:03

[quote]
jlehtone wrote:
@ simon_matthews: So you do recommend the use of mirrored LVM? Doesn't that require a "log" to be placed on some volume?

[/quote]

I recommend that you use a LVM-on-RAID solution, with the LVM hosted on one of the RAID1 arrays. See this page http://www.gagme.com/greg/linux/raid-lvm.php or many others.

You will partition your hard drives and create 2 or 3 RAID arrays.

The first RAID1 array will be either the root (/) filesystem or the /boot filesystem (grub can boot off RAID1, but not LVM). The second RAID1 array will then be used as the physical volume for LVM. You can then create multiple logical volumes in the physical space that is your second RAID1 array. . Your third parition can be used for either a third RAID1 rarray that is used for swap, or you can put the swap in a logical volume (which is on your second RAID1 array).

All of this is supported through the installer, which is why you should do it this way.

Post Reply