Help - Search - Members - Calendar
Full Version: Software RAID Under Debian
MSFN Forums > Software, Hardware, Media and Games Central > Other Operating Systems

   
Google Internet Forums Unattended CD/DVD Guide
gamehead200
Hey guys,

I've been Googling for few hours but haven't found any descriptive guides on how to setup a software RAID under Debian, specifically a JBOD array (just a bunch of disks) or Linear RAID. I've read a bit about mdadm, but really have no clue where to start...

Why do I want this? So that I can combine a bunch of hard drives into a larger virtual one. I have done it under Windows, but have no idea how to do it under Linux.

Any help would be very much appreciated. smile.gif
allen2
Look for mdadd, mdcreate, mdrun commands.
http://tldp.org/HOWTO/Software-RAID-HOWTO.html
gamehead200
This is what I've been doing:

Set up a partition on /dev/hdb, /dev/hdc, and /dev/hdd. Then, I ran:
CODE
mdadm --create --verbose /dev/md0 --level=linear --raid-devices=3 /dev/hdb1 /dev/hdc1 /dev/hdd1

And it created /dev/md0.

I ran:
CODE
cat /proc/mdstat
and it would show up in there... Then I added a file system to /dev/md0 by running:
CODE
mke2fs -j /dev/md0
and then mounted it under /files by running:
CODE
mount /dev/md0 /files


I also ran:
CODE
echo "DEVICES /dev/hdb /dev/hdc /dev/hdd" > /etc/mdadm/mdadm.conf

mdadm --brief --detail --verbose /dev/md0 >> /etc/mdadm/mdadm.conf
and added this line in /etc/fstab:
CODE
/dev/md0  /files  ext3  defaults  0  0


The, after reboot, it wouldn't exist anymore! What am I doing wrong?
tain
EDIT: I misread your post. Sorry.
gamehead200
QUOTE (TAiN @ Sep 25 2006, 07:24 PM) *
I haven't used mdadm, but it looks like you need to add the mounted drive to your fstab. Mounting doesn't get saved to a hard config.
QUOTE
pico /etc/fstab



I did. Check out my last step.

Edit: Not a problem! tongue.gif
gamehead200
Success!!!!!!!! Here are my exact steps!

1. Created a partition on each drive and set the type as Linux Raid Autodetect (FD).
2. Ran the following on each partition to clear the superblock in the MD:
CODE
mdadm --zero-superblock /dev/hdb1

3. Created the array:
CODE
mdadm --create --verbose /dev/md0 --level=linear --raid-devices=3 /dev/hdb1 /dev/hdc1 /dev/hdd1

4. Gave it a filesystem:
CODE
mke2fs -j /dev/md0

5. Added the following line in /etc/fstab:
CODE
/dev/md0 /files ext3 rw,user 0 0

6. Copied the RAID configuration to the mdadm.conf file:
CODE
mdadm --detail --scan >> /etc/mdadm.conf

7. Mounted everything:
CODE
mount -a

8. Rebooted, and everything still shows up in /files!! biggrin.gif

CODE
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/hda1              9487640    406704   8598988   5% /
tmpfs                    59640         0     59640   0% /dev/shm
/dev/md0              44332080     32828  42047276   1% /files


Thanks to TAiN for doing some 1337 Googling! biggrin.gif
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.