Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mdadm RAID 1 problem
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
mpicklesimer
n00b
n00b


Joined: 22 Mar 2006
Posts: 59
Location: Boston, MA

PostPosted: Mon Jul 24, 2006 6:39 am    Post subject: mdadm RAID 1 problem Reply with quote

I built a RAID 1 array following the directions I found here with some old drives I had laying around, which is why I went with RAID1. About a week later, wouldn't you know it, I had my first failure: /dev/sda went south for the winter, and decided to retire there. So, according to the same directions, I pulled the failed drive and stuck in another one. After this, the system refused to boot. So i swapped sda and sdb, and was now able to boot.

Once in, I followed the directions in the "Misc RAID stuff" section. When I ran "mdadm /dev/md1 -r /dev/sda1 -a /dev/sdb1" I got "mdadm: hot remove failed for /dev/sda1: Device or resource busy". So my question is, what am I doing [/url]wrong here?

"cat /proc/mdstat" shows the following, if it helps:
Code:
Personalities : [raid1]
md1 : active raid1 sda1[1]
      272960 blocks [2/1] [_U]

md2 : active raid1 sda2[1]
      273024 blocks [2/1] [_U]

md3 : active raid1 sda3[1]
      8337664 blocks [2/1] [_U]

unused devices: <none>


Currently, /dev/sda is the former /dev/sdb and the former /dev/sda is the failed drive that I had to replace, which is now in /dev/sdb. I appreciate any help y'all can give.
Back to top
View user's profile Send private message
farmorg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2003
Posts: 76
Location: Leicester (UK)

PostPosted: Mon Jul 24, 2006 1:29 pm    Post subject: Reply with quote

If it were my machine I would've left the drives as they were. I think the problem you had with booting was that Grub was not installed on sdb. By swapping the drives you might have confused mdadm, here's what i'd do.

1. Swap the drives back and boot off a live cd
2. Install Grub into the mbr of sdb
3. Reboot from sdb
4. mdadm -r /dev/md1 /dev/sda1
5. mdadm -a /dev/md1 /dev/sda1

Repeat steps 4-5 for md2 & md3 - Obviously substituting the correct partitions ;-)

HTH

farmorg
_________________
Master farmorg

May the source be with you
Back to top
View user's profile Send private message
mpicklesimer
n00b
n00b


Joined: 22 Mar 2006
Posts: 59
Location: Boston, MA

PostPosted: Mon Jul 24, 2006 3:21 pm    Post subject: I did install Grub to sdb. Reply with quote

But I'm at work right now, so I'll try it again when I get home. Maybe it didn't take when I did it? The only thing I didn't follow of those directions was mounting /home on a separate partition. Everything else I followed to the letter.
Back to top
View user's profile Send private message
farmorg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2003
Posts: 76
Location: Leicester (UK)

PostPosted: Mon Jul 24, 2006 9:52 pm    Post subject: Reply with quote

It doesn't matter if you have /home on a seperate partition or not, at least not in this instance.

Post back with the results when youv'e had another try at sorting this out.
As long as your scsi card will let you boot off sdb you should be ok once Grub is installed into the mbr.
_________________
Master farmorg

May the source be with you
Back to top
View user's profile Send private message
mpicklesimer
n00b
n00b


Joined: 22 Mar 2006
Posts: 59
Location: Boston, MA

PostPosted: Tue Jul 25, 2006 4:11 am    Post subject: Still no luck. Reply with quote

It occurs to me that I obviously must have installed grub to /dev/sdb, since I am now booting to that same drive as /dev/sda. I mentioned this earlier that, as part of my troubleshooting, I had made this switch and was able to boot fine, but mdadm was upset at me for doing this. Unfortunately I didn't have much choice in the matter as it was the only way I could boot. I really appreciate the help so far tho. Thanks.
Back to top
View user's profile Send private message
farmorg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2003
Posts: 76
Location: Leicester (UK)

PostPosted: Tue Jul 25, 2006 10:52 am    Post subject: Reply with quote

A good point well put :-) Why that didn't occure to me I have no idea, sorry :oops:

Have you checked the scsi bios to see if there is a setting to allow booting from the second scsi disk?
I know that on at least one of my scsi cards you have to set which disk is bootable.
_________________
Master farmorg

May the source be with you
Back to top
View user's profile Send private message
weanus
n00b
n00b


Joined: 12 Apr 2005
Posts: 1
Location: Chicago, IL

PostPosted: Tue Jul 25, 2006 2:28 pm    Post subject: Re: Still no luck. Reply with quote

mpicklesimer wrote:
It occurs to me that I obviously must have installed grub to /dev/sdb, since I am now booting to that same drive as /dev/sda. I mentioned this earlier that, as part of my troubleshooting, I had made this switch and was able to boot fine, but mdadm was upset at me for doing this. Unfortunately I didn't have much choice in the matter as it was the only way I could boot. I really appreciate the help so far tho. Thanks.

...but did you modify your kernel (and initrd) lines in grub.conf? something like: 'kernel (hd0,0)/kernel-genkernel-x86-2.6.16-gentoo-r7' to 'kernel (hd1,0)/kernel-genkernel-x86-2.6.16-gentoo-r7'...
when using software raid, I usually add two entries in grub - one (or more) for each drive:
Code:

title  Gentoo GNU/Linux (2.6.16-gentoo-r7)
root (hd0,0)
kernel (hd0,0)/kernel-genkernel-x86-2.6.16-gentoo-r7 udev dolvm2 root=/dev/ram0 real_root=/dev/sys/root lvmraid=/dev/md3 splash=silent,fadein,theme:default CONSOLE=/dev/tty1 quiet vga=791 softlevel=default
initrd (hd0,0)/initramfs-genkernel-x86-2.6.16-gentoo-r7

title  Gentoo GNU/Linux (2.6.16-gentoo-r7) verbose, minimal
root (hd0,0)
kernel (hd0,0)/kernel-genkernel-x86-2.6.16-gentoo-r7 udev dolvm2 root=/dev/ram0 real_root=/dev/sys/root lvmraid=/dev/md3 splash=verbose,theme:default CONSOLE=/dev/tty1 vga=791 softlevel=minimal
initrd (hd0,0)/initramfs-genkernel-x86-2.6.16-gentoo-r7


title  Gentoo GNU/Linux (2.6.16-gentoo-r7) hdb
root (hd1,0)
kernel (hd1,0)/kernel-genkernel-x86-2.6.16-gentoo-r7 udev dolvm2 root=/dev/ram0 real_root=/dev/sys/root lvmraid=/dev/md3 splash=silent,theme:default CONSOLE=/dev/tty1 quiet vga=791
initrd (hd1,0)/initramfs-genkernel-x86-2.6.16-gentoo-r7

title  Gentoo GNU/Linux (2.6.16-gentoo-r7) verbose, minimal hdb
root (hd1,0)
kernel (hd1,0)/kernel-genkernel-x86-2.6.16-gentoo-r7 udev dolvm2 root=/dev/ram0 real_root=/dev/sys/root lvmraid=/dev/md3 splash=verbose,theme:default CONSOLE=/dev/tty1 vga=791 softlevel=minimal
initrd (hd1,0)/initramfs-genkernel-x86-2.6.16-gentoo-r7


not that this has anything to do w/ your problem... :D

good advise from farmorg, though. leave the drives where they are, then remove via mdadm, then physically replace.
Back to top
View user's profile Send private message
farmorg
Tux's lil' helper
Tux's lil' helper


Joined: 14 Jun 2003
Posts: 76
Location: Leicester (UK)

PostPosted: Wed Jul 26, 2006 6:52 am    Post subject: Reply with quote

Quote:
...but did you modify your kernel (and initrd) lines in grub.conf? something like: 'kernel (hd0,0)/kernel-genkernel-x86-2.6.16-gentoo-r7' to 'kernel (hd1,0)/kernel-genkernel-x86-2.6.16-gentoo-r7'...
when using software raid, I usually add two entries in grub - one (or more) for each drive:


Aha... Now that's something I hadn't thought of doing, I run some Centos & Fedora boxes on software raid so i'll be doing this on them. Good thinking weanus :-)
Actually, before posting this I just checked the grub.conf on a Centos box & it points root at /dev/md1 (mounted at /) however, I'm not entirely sure that it works properly, it's been a while since I had a drive fail (tempting fate or what!) - might be worth a little testing at some point.

Heres the grub.conf for ref:

Code:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/md1
#          initrd /initrd-version.img
#boot=/dev/sda1
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.9-34.0.2.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-34.0.2.ELsmp ro root=/dev/md1
        initrd /initrd-2.6.9-34.0.2.ELsmp.img
title CentOS-4 i386 (2.6.9-34.ELsmp)
        root (hd0,0)
        kernel /vmlinuz-2.6.9-34.ELsmp ro root=/dev/md1
        initrd /initrd-2.6.9-34.ELsmp.img


As the raid drivers are built as modules, I guess they are included in the initrd, I usually build them directly into the kernel on Gentoo to avoid building an initrd (lazy I know).

mpicklesimer - If you swap the drives back to their original order, does weanus' post enable you to boot from the second drive?
(You still might need to check your scsi bios boot options).
_________________
Master farmorg

May the source be with you
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum