Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-25-2008, 02:08 PM   #1
Registered: Oct 2005
Distribution: Slackware
Posts: 228

Rep: Reputation: 40
Howto RAID Automount?

I have a RAID-1 mirror setup with 2 external USB drives. The drives are only powered on just before a backup, and powered off when I'm done.

How do I configure linux to automatically assemble the RAID and mount the drives when they are powered up.

The manual process I follow is:
1. Power on the drives.
2. Determine the device files with
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 with
mdadm --assemble /dev/md0 /dev/sdc1 /dev/sdd1
4. Finally, I mount the array with
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.

I could easily write a script to do this for me. However, the script would only work after both drives have powered on an initialized. Usually, it takes 20 seconds after powering them on, before I can see the drives with 'fdisk -l'.

Any ideas?
Old 06-25-2008, 03:12 PM   #2
Alien Bob
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 6,620

Rep: Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913Reputation: 3913
Instead of using fdisk to determine your RAID partitions, and then running a full mdadm command with these partitions, why not let mdadm do the scanning and assembling?
mdadm -Es > /etc/mdadm.conf
mdadm -As
Equivalent to
mdadm --examine --scan > /etc/mdadm.conf
mdadm --assemble --scan
Maybe this link will help too:


Last edited by Alien Bob; 06-25-2008 at 03:13 PM. Reason: Mention README_RAID.TXT


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linear RAID failing to automount at boot metamechanical Linux - General 10 10-29-2006 08:01 PM
Software Raid automount nogetfx Debian 4 02-15-2006 04:19 PM
Howto disable automount feature in Mandrake 10.1 MJatIFAD Linux - General 6 09-27-2005 03:26 AM
Howto set permissions and automount for new drive? andymadigan Debian 4 08-02-2004 10:17 PM
hOwtO autOmOunt fadain Linux - Newbie 5 03-23-2003 01:56 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration