ttist25
asked on
How to recover a three disk Ubuntu software RAID5 array
Hey there,
I'm building an Ubuntu 10.04 virtual machine server. I have three 500GB SATA drives which I setup in a RAID5 configuration. The setup went fairly easily and I installed the OS without a problem.
Before I start setting everything up, I want to make sure that if I lose one of the drives I know how to recover. For my dry run, I removed one of the drives, connected it to my laptop with a SATA USB docking station, and deleted the partitions from it.
I physically reinstalled the drive in my server and tried to boot. During boot I'm prompted to start the degraded RAID. I say yes to that and I get the following:
So, the question is, how would I go about rebuilding the third drive in the array? Can I boot to a live CD and do something there? Is there something I can do at the initramfs prompt?
Glad I'm not trying to figure this out on a failed production box! Yay for dry runs! :P
Thanks in advance for any help.
I'm building an Ubuntu 10.04 virtual machine server. I have three 500GB SATA drives which I setup in a RAID5 configuration. The setup went fairly easily and I installed the OS without a problem.
Before I start setting everything up, I want to make sure that if I lose one of the drives I know how to recover. For my dry run, I removed one of the drives, connected it to my laptop with a SATA USB docking station, and deleted the partitions from it.
I physically reinstalled the drive in my server and tried to boot. During boot I'm prompted to start the degraded RAID. I say yes to that and I get the following:
mdadm: CREATE user root not found*then a list of common problems and then:
mdadm: CREATE group disk not found
raid5: raid level 5 set md0 active with 2 out of 3 devices, algorithm 2
mdadm: /dev/md0 has been started with 2 drives (out of 3)
raid5: failed to run raid set md1
mdadm: failed to RUN-ARRAY /dev/md1: Input.output error
mdadm: Not enough devices to start the array while not clean - consider --force
Started the RAID in degraded mode
Gave up waiting for root device:
ALERT! /dev/disk/by-uuid/bunchanuThen I get a busybox shell and a prompt of "initramfs".mbersnad letters does not exist. Dropping to a shell!
So, the question is, how would I go about rebuilding the third drive in the array? Can I boot to a live CD and do something there? Is there something I can do at the initramfs prompt?
Glad I'm not trying to figure this out on a failed production box! Yay for dry runs! :P
Thanks in advance for any help.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
do you have a copy of your /etc/fstab? that would help us.
If you did follow the guide that you pointed to, the md0 that came up is just the swap partition. The md1 is the root partition that doesn't want to boot in a degraded state. When GRUB comes up, hit "e" to edit and then choose the "kernel" line and "e" to edit it. Append "bootdegraded=true" (without the quotes) to the kernel line and then boot the box. Does it come up now?
If you did follow the guide that you pointed to, the md0 that came up is just the swap partition. The md1 is the root partition that doesn't want to boot in a degraded state. When GRUB comes up, hit "e" to edit and then choose the "kernel" line and "e" to edit it. Append "bootdegraded=true" (without the quotes) to the kernel line and then boot the box. Does it come up now?
ASKER
Sorry - I started from scratch again before I saw your response. I followed these instructions to the letter except that I selected RAID5 rather than RAID1 and I formatted three drives with a swap and / partition instead of two.
Also this time, after I got the OS installed, I opened up a terminal and did "sudo dpkg-reconfigure mdadm" to set bootdegraded to true and also set the notification email.
I rebooted, shutdown, and disconnected power to drive 1 (sdb). Then I started the box and tried hitting "e" after POST but I don't ever see GRUB. I'm not sure I see grub menu's even with all three drives running normally. Although I know grub is installed - there's no other OS or bootloader.
Maybe I'm missing something fundamental. For instance, all of the RAID5 tutorials I've seen reference at least 4 drives. One is for the OS (and is sometimes mirrored with a 5th drive in RAID1) and the other three are used for the array. I'm installing the OS on my RAID5 array. Is this the reason it can't boot degraded?
I've got to have this server be able to run in a degraded state as an entire satellite office (6 users) will be connecting via RDP to the VM's on it. The office is about 1-1/2 hours from me so I need to have that redundancy so they can continue to run until I can get there and fix it.
If I reconnect the drive and boot would the fstab still help you? Just let me know and I'll post it right away.
Thanks SO much for your help. I'm really getting frustrated trying to get this working and it's nice to have you guys there for support.
Thanks again.
Also this time, after I got the OS installed, I opened up a terminal and did "sudo dpkg-reconfigure mdadm" to set bootdegraded to true and also set the notification email.
I rebooted, shutdown, and disconnected power to drive 1 (sdb). Then I started the box and tried hitting "e" after POST but I don't ever see GRUB. I'm not sure I see grub menu's even with all three drives running normally. Although I know grub is installed - there's no other OS or bootloader.
Maybe I'm missing something fundamental. For instance, all of the RAID5 tutorials I've seen reference at least 4 drives. One is for the OS (and is sometimes mirrored with a 5th drive in RAID1) and the other three are used for the array. I'm installing the OS on my RAID5 array. Is this the reason it can't boot degraded?
I've got to have this server be able to run in a degraded state as an entire satellite office (6 users) will be connecting via RDP to the VM's on it. The office is about 1-1/2 hours from me so I need to have that redundancy so they can continue to run until I can get there and fix it.
If I reconnect the drive and boot would the fstab still help you? Just let me know and I'll post it right away.
Thanks SO much for your help. I'm really getting frustrated trying to get this working and it's nice to have you guys there for support.
Thanks again.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nope. Didn't come up even with bootdegraded set to true. That said, even without setting bootdegraded to true, I get an option that asks if I want to boot degraded.
Right now it's sitting with sdb disconnected and sitting at an initramfs prompt. I'll try rebooting and see if I can get the grub menu.
Is there anything else I can provide for you?
thanks
Right now it's sitting with sdb disconnected and sitting at an initramfs prompt. I'll try rebooting and see if I can get the grub menu.
Is there anything else I can provide for you?
thanks
ASKER
I was in an Ubuntu IRC chat and someone there stated that the OS can't be on the array in RAID5. Do you know if that's true?
ASKER
Hey guys,
Thanks for the help but I've given up on RAID5. For my application I think a RAID1 setup is the way to go. It provides sufficient fault tolerance for my application and will keep the server running long enough for me to add a new drive.
RAID5 in theory (better read times, greater storage space, etc) would've been better for my application but, there doesn't seem to be strong consensus in the community in the ability to install the OS on the array and recover and I see more nightmares than solutions in the available resources.
I used this tutorial to set it up and test it. Worked well.
I setup RAID1, disconnected sdb, removed sdb, booted, added sdb and it built and runs fine.
Keep it simple I guess. Time to move on.
Thanks again for your efforts.
Thanks for the help but I've given up on RAID5. For my application I think a RAID1 setup is the way to go. It provides sufficient fault tolerance for my application and will keep the server running long enough for me to add a new drive.
RAID5 in theory (better read times, greater storage space, etc) would've been better for my application but, there doesn't seem to be strong consensus in the community in the ability to install the OS on the array and recover and I see more nightmares than solutions in the available resources.
I used this tutorial to set it up and test it. Worked well.
I setup RAID1, disconnected sdb, removed sdb, booted, added sdb and it built and runs fine.
Keep it simple I guess. Time to move on.
Thanks again for your efforts.
ASKER
:D
Where would I find them? Is it accessible via the initramfs thing? I'm just knowledgeable enough about Linux to be dangerous. I guess I've spread my wings and left the nest but I'm getting jacked up by some branches on the way down!
When I set it up I used the instructions here.
Everything went as described in that document except that it states:
and I didn't get asked about booting in a degraded state at that point.
Maybe I should try starting over to make sure I didn't miss something?
Thanks for the help.