You are not logged in.

#1 2008-06-24 16:55:41

windowbreaker
Member
Registered: 2008-06-18
Posts: 46

How to auto mount RAID 1 when drives are powered up

I have a RAID 1 mirror setup with 2 external USB drives.  How do I configure Arch to assemble the RAID and mount the drives when they are powered up.

Right now, here's what I do:
1. Power on the drives.
2. Determine the device files

fdisk -l | grep raid
/dev/sdc1               1       60801   488384001   fd  Linux raid autodetect
/dev/sdd1               1       60801   488384001   fd  Linux raid autodetect

3. Assemble the array

mdadm --assemble /dev/md0 /dev/sdc1 /dev/sdd1

4. Mount the array
mount /dev/md0 /mnt/md0

I tried using UDEV rules to create specific device files.  However, the mdadm utility complains that the files don't have valid superblock.  So mdadm only works with the actual device file as listed above. 

Any ideas?

Offline

#2 2008-08-05 22:37:41

Factory
Member
Registered: 2008-02-24
Posts: 108

Re: How to auto mount RAID 1 when drives are powered up

Offline

#3 2008-08-06 00:23:46

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: How to auto mount RAID 1 when drives are powered up

To have a raid 1 array requires three drives.  What you have outlined is a raid0 array with two drives.

To cause that to automount use /etc/rc.local wherein you enter the assemble command and the mount -t ext3 /mnt/md0 /mnt/md command.

Works like a charm for raid0.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#4 2008-08-08 13:30:50

Factory
Member
Registered: 2008-02-24
Posts: 108

Re: How to auto mount RAID 1 when drives are powered up

lilsirecho wrote:

To have a raid 1 array requires three drives.  What you have outlined is a raid0 array with two drives.

To cause that to automount use /etc/rc.local wherein you enter the assemble command and the mount -t ext3 /mnt/md0 /mnt/md command.

Works like a charm for raid0.

Nope. Raid 1 is a mirror array with at least 2 drives.

http://en.wikipedia.org/wiki/Redundant_ … ard_levels

Offline

#5 2008-08-08 16:10:27

lilsirecho
Veteran
Registered: 2003-10-24
Posts: 5,000

Re: How to auto mount RAID 1 when drives are powered up

I stand corrected.  Thank you.  I recommend the /etc/rc.local setup for your scheme.


Prediction...This year will be a very odd year!
Hard work does not kill people but why risk it: Charlie Mccarthy
A man is not complete until he is married..then..he is finished.
When ALL is lost, what can be found? Even bytes get lonely for a little bit!     X-ray confirms Iam spineless!

Offline

#6 2008-08-10 06:11:18

Factory
Member
Registered: 2008-02-24
Posts: 108

Re: How to auto mount RAID 1 when drives are powered up

Also, one  could simply add the scheme to mdadm.conf, then mount the device (/dev/md0) using fstab. Easy peasy, no rc.local involved.

Offline

Board footer

Powered by FluxBB