You are not logged in.

#1 2010-01-06 16:34:31

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Adding 3 S-ATA Drives to my PC (RAID)

I have a working single drive Arch system. I today installed 3 identical drives on the machine (S-ATA) & created a RAID 5 array for the 3 drives. The OS itself is on /dev/sda which is not a member of the RAID. I simply want to create one single RAID 5 device (/dev/md0) and mount it to a new folder called /mystuff. The OS and MBR will still be independent of the RAID.

mdadm --create --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc1 /dev/sdd1

So the RAID has been created but now I don't know what config files I need to edit. The Wiki is pretty confusing for this scenario. Do I just need to add the mount point to /etc/fstab or do I need to add entries into rc.conf & mkinitcpio.conf?

I read this which makes no sence to me according to my config file:

Edit /etc/mkinitcpio.conf to include raid in the HOOKS array. Place it before autodetect but after sata, scsi and pata (whichever is appropriate for your hardware).

???

Below is my config file:

HOOKS="base udev autodetect pata scsi sata mdadm filesystems"

Can someone please tell me what files and things I will need to modify in order to do what I am trying to do above?


./

Offline

#2 2010-01-06 18:01:46

madeye
Member
From: Denmark
Registered: 2006-07-19
Posts: 331
Website

Re: Adding 3 S-ATA Drives to my PC (RAID)

I've done something similar in the past, although I used lvm to create and manage the partitions in my raid.
(I made a guide for myself at that time. Here is the link if you should be interrested: http://paranoidix.dk/linux/arch/hardware-raid-and-lvm )

If you just want to use the raid without lvm it should be enough to create partitions using cfdisk og another partition manager. (someone please correct me if I'm wrong here)

cfdisk /dev/md0

One primary partition would create the node /dev/md0p1

Now the filesystem can be made

mkfs.ext3 /dev/md0p1

Afterwards you can add it to fstab and mount them like any other partition.


MadEye | Registered Linux user #167944 since 2000-02-28 | Homepage

Offline

#3 2010-01-06 18:07:52

Carlwill
Member
From: Orlando, FL
Registered: 2008-10-06
Posts: 560
Website

Re: Adding 3 S-ATA Drives to my PC (RAID)

Thanks for your reply. I created the partion /dev/md0p1 and then formatted it via:

mkfs.ext4 /dev/md0p1

Now I am going to attempt to mount it manually to a mount point and it that works, inject it into fstab.


./

Offline

#4 2010-01-07 00:46:19

Ultraman
Member
Registered: 2009-12-24
Posts: 242

Re: Adding 3 S-ATA Drives to my PC (RAID)

If you just want to use the raid without lvm it should be enough to create partitions using cfdisk og another partition manager. (someone please correct me if I'm wrong here)

You can actually skip that step and make a filesystem directly on the raid device /dev/md0.

mkfs.ext4 /dev/md0

Works just like you would do is on e.g.: /dev/sda1

The kernel can auto-detect mdadm raid disks on boot and assemble them accordingly. Just make sure you changed the partition type on the disks to "fd". The Linux raid autodetect type.

You can also create a /etc/mdadm.conf file with information of your RAID array. mdadm can generate that for you by simply removing the original file (or changing it's name), and doing

# mdadm –D –-scan >> /etc/mdadm.conf

You can add "mdadm" to your HOOKS and regenerate the initcpio to include it.

# mkinitcpio -g /boot/kernel26.img

Although perhaps this step is not necessary in your case, as you are not booting off RAID right?
Your kernel can simply load the module to use the mdadm array instead of needing it in it's initcpio.

After that, it should be working. Mount it to check and insert into fstab like you would any disk partition.
UUID also works. You can look it up by using "blkid" (needs to be run as root) or "ls -lF /dev/disk/by-uuid" (can be run as user)

Last edited by Ultraman (2010-01-07 00:46:31)

Offline

Board footer

Powered by FluxBB