[SOLVED] Problem installing CentOS with a RAID 1

General support questions
Lisandro1987
Posts: 33
Joined: 2012/04/25 17:37:40

Re: Problem installing CentOS with a RAID 1

Post by Lisandro1987 » 2012/05/14 18:09:39

Thanks! Here it's:

[quote][b][root@ls2 administrator]# mdadm --detail /dev/md0[/b]
/dev/md0:
Version : 1.0
Creation Time : Wed May 9 14:47:52 2012
Raid Level : raid1
Array Size : 204788 (200.02 MiB 209.70 MB)
Used Dev Size : 204788 (200.02 MiB 209.70 MB)
Raid Devices : 2
Total Devices : 1
Persistence : Superblock is persistent

Update Time : Mon May 14 15:01:16 2012
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

Name : ls2.serfe.com:0 (local to host ls2.serfe.com)
UUID : 41974042:c8882884:7311578f:ce0fa29f
Events : 111

Number Major Minor RaidDevice State
0 0 0 0 removed
1 8 17 1 active sync /dev/sdb1

[b][root@ls2 administrator]# mdadm --detail --scan[/b]
ARRAY /dev/md2 metadata=1.1 name=ls2.serfe.com:2 UUID=46b6312a:681507ff:c8f5c2fc:4c9fe59c
ARRAY /dev/md1 metadata=1.1 name=ls2.serfe.com:1 UUID=61b278d4:0977d175:5c72db72:4d2a5aab
ARRAY /dev/md0 metadata=1.0 name=ls2.serfe.com:0 UUID=41974042:c8882884:7311578f:ce0fa29f[/quote]

I can I erase the drive and reinstall a 'fresh version' of CentOS

What would I do to make sure that the tables and partitions are like factory?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Problem installing CentOS with a RAID 1

Post by pschaff » 2012/05/14 18:22:03

Before going through a reinstall, you may want to fail and remove the stubborn /dev/sda1, and use [code]mdadm --zero-superblock /dev/sda1[/code]to clear the metadata, then attempt to re-add it.

If you do want to re-install for a fresh start then you can use the procedure in the [url=http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5]software RAID[/url] Wiki article to make the drives appear factory new.

Lisandro1987
Posts: 33
Joined: 2012/04/25 17:37:40

Re: Problem installing CentOS with a RAID 1

Post by Lisandro1987 » 2012/05/14 18:58:05

Thanks! I'll reinstall CentOS following the instructions http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5.

Some questions about that:
1) To run the commands 'dd if=/dev/zero of=/dev/sda bs=512 count=64' and 'dd if=/dev/zero of=/dev/sdb bs=512 count=64' I do the next: Boot from the DVD of CentOS > Select 'Install or upgrade an existing system' > Press 'Ctrl+Alt+F2'. Is this OK?
2) When I create the partitions (boot, swap and root), Have I to ''Force to be a primary partition' any partition? I force only the boot partition...
3) Before install CentOS I had a hardware RAID. A CMOS reset and running the dd commands is sufficient to make a software RAID?
4) When I created the partitions, Can I specify to be ext4?
5) In method 2 for GRUB, How can I make sure that hd0 and hd1 is the same in my case?
6) 'Once you're booted up, do a system update' > That means that I have to run 'yum update', isn't it?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Problem installing CentOS with a RAID 1

Post by pschaff » 2012/05/14 19:33:25

[quote]
Lisandro1987 wrote:
Thanks! I'll reinstall CentOS following the instructions http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5.[/quote]
Do be careful not to depend on that [i]too[/i] closely. CentOS-6 is similar but different in some respects.

[quote]
Some questions about that:
1) To run the commands 'dd if=/dev/zero of=/dev/sda bs=512 count=64' and 'dd if=/dev/zero of=/dev/sdb bs=512 count=64' I do the next: Boot from the DVD of CentOS > Select 'Install or upgrade an existing system' > Press 'Ctrl+Alt+F2'. Is this OK?[/quote]
Again, details may differ, but do the 'Ctrl+Alt+F2' after the GUI starts and before the partitioning step, or do it on the live system before you reboot to the installer. In that case, you are "cutting off the limb you are standing on" so do it as a one-liner and just hit the power button after the operation completes.
[code]dd if=/dev/zero of=/dev/sda bs=512 count=64 ; dd if=/dev/zero of=/dev/sdb bs=512 count=64[/code]Somehow that one gives an unreasonable sensation of god-like power of life-and-death. :-)
Be very sure you have backed up anything you care about.

[quote]
2) When I create the partitions (boot, swap and root), Have I to ''Force to be a primary partition' any partition? I force only the boot partition...[/quote]
That should be good.

[quote]
3) Before install CentOS I had a hardware RAID. A CMOS reset and running the dd commands is sufficient to make a software RAID?[/quote]
Yes.

[quote]
4) When I created the partitions, Can I specify to be ext4?[/quote]
Yes, but it gets a bit trickier if you want to use LVM on top of the RAID.

[quote]
5) In method 2 for GRUB, How can I make sure that hd0 and hd1 is the same in my case?[/quote]
See [url=http://wiki.centos.org/HowTos/GrubInstallation?highlight=%28GRUB%29#head-9cefdf03346305429c960b24d38d9506793f6e21]Grub Installation[/url], and if you have problems, [url=http://wiki.centos.org/TipsAndTricks/TroubleshootGRUB]Troubleshoot Grub[/url].

[quote]
6) 'Once you're booted up, do a system update' > That means that I have to run 'yum update', isn't it?[/quote]
Yes.

Lisandro1987
Posts: 33
Joined: 2012/04/25 17:37:40

Re: Problem installing CentOS with a RAID 1

Post by Lisandro1987 » 2012/05/15 17:04:22

[b]Thanks so much pschaff!!![/b]

I just reinstall CentOS with your recommendations and with the wiki http://wiki.centos.org/HowTos/SoftwareRAIDonCentOS5, but when I disconnect a disk the system didn't boot.

When I finish the first section in the wiki, in section two I do the following:

- I boot normally CentOS > Applications > System tools > Terminal:
su
grub
grub> find /grub/stage1
(hd0,0)
(hd1,0)
grub> device (hd0) /dev/sda
grub> device (hd1) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
grub> root (hd1,0)
grub> setup (hd1)
grub> quit
reboot

- Later, I update the system:
su
yum list updates
yum update
reboot

What's wrong? :-(

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Problem installing CentOS with a RAID 1

Post by pschaff » 2012/05/15 17:14:59

Apparently you forgot about the dracut bug mentioned in post #2 and other times in the thread. You need it be sure to update dracut, and then the kernel before testing the RAID. At this point you may need to [url=http://wiki.centos.org/TipsAndTricks/CreateNewInitrd]create a new initramfs[/url].

Lisandro1987
Posts: 33
Joined: 2012/04/25 17:37:40

Re: Problem installing CentOS with a RAID 1

Post by Lisandro1987 » 2012/05/15 21:20:43

Did you see the note of this document? Remember that I'm using CentOS 6.2

'This article applies to CentOS-5 and earlier. CentOS-6 uses dracut and initramfs. Please see man dracut and the upstream Deployment Guide'

In the other guide, I only use the next command:

[quote][b]dracut /initramfs-2.6.32-220.13.1.el6.x86_64.img 2.6.32-220.13.1.el6.x86_64[/b][/quote]

Am I missing something?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Problem installing CentOS with a RAID 1

Post by pschaff » 2012/05/15 21:36:25

[quote]
Lisandro1987 wrote:
Did you see the note of this document? Remember that I'm using CentOS 6.2

'This article applies to CentOS-5 and earlier. CentOS-6 uses dracut and initramfs. Please see man dracut and the upstream Deployment Guide'[/quote]
Yes, I knew the article was primarily about CentOS-5, but mentioned 6. Guess I should have just referred you directly to the upstream guide for dracut.

[quote]
In the other guide, I only use the next command:

[quote][b]dracut /initramfs-2.6.32-220.13.1.el6.x86_64.img 2.6.32-220.13.1.el6.x86_64[/b][/quote]

Am I missing something?[/quote]
That command would put the new initramfs-2.6.32-220.13.1.el6.x86_64.img in the root filesystem, rather than in /boot, so it will not be used. See [url=https://www.centos.org/modules/newbb/viewtopic.php?topic_id=37076&forum=55&post_id=162512#forumpost162512]this post[/url] for a procedure. If still having problems post the details of your tests and the exact results.

Lisandro1987
Posts: 33
Joined: 2012/04/25 17:37:40

Re: Problem installing CentOS with a RAID 1

Post by Lisandro1987 » 2012/05/16 14:29:21

Again, thanks so much for your time!

[code]cd /boot
dracut initramfs-2.6.32-220.13.1.el6.x86_64_new.img 2.6.32-220.13.1.el6.x86_64
mv initramfs-2.6.32-220.13.1.el6.x86_64.img initramfs-2.6.32-220.13.1.el6.x86_64_old.img
mv initramfs-2.6.32-220.13.1.el6.x86_64_new.img initramfs-2.6.32-220.13.1.el6.x86_64.img[/code]

I did this, but i'm still having problem when I disconnect the first disk. Here is the disk information:

http://pastebin.com/Tn5hrqPP

Do you need some more?

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Problem installing CentOS with a RAID 1

Post by pschaff » 2012/05/16 14:42:59

It appears that both disks are present but the arrays for md0 and md2 are degraded. Only sda is active so sdb1 and sdb3 are not being updated. Exactly what is your testing procedure, and what errors or symptoms are you encountering?

Post Reply