You are not logged in.

#1 2009-09-23 13:07:02

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

Installing Arch w/ RAID Config

I normally install all my Debian / CentOS Linux installations using software RAID which uses the 'fd' id. Normally this is done during the disk partitioning section of the install. When I create my Arch disk partitions, I change the "type" to "fd" from "83" and it shows up but I never get an option to configure the software RAID like I would in the previously mentioned distributions. I don't know how I would do this and am asking here.

I have three drives and I am trying to learn how to install Arch Linux on all three drives configured in a RAID array.

Thanks in advance for any assistance!


./

Offline

#2 2009-09-23 22:56:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

The Arch installer doesn't hold your hand through RAID configuration. You need to set it up manually before starting the installer. There's a very good write up in the wiki about it.

Offline

#3 2009-09-29 15:31:35

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

Re: Installing Arch w/ RAID Config

Thanks. I will check out the wiki. My question is I have 3 completely identical drives:

hda - Wester Digital 320 GB P-ATA
hdb - Wester Digital 320 GB P-ATA
hdc - Wester Digital 320 GB P-ATA

My question is how do I configure and partition them all in order to get the most redundant mirror? I am guessing because I only have 3 drives I can only use RAID1, right? Any ideas how I should configure the RAID before I go through the Wiki?


./

Offline

#4 2009-09-29 22:20:50

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

With 3 drives you can use RAID-0, 1 or 5.

RAID-0 will give you 0 redundancy with the most efficient use of space (960gb available).
RAID-1 will give you the most redundancy with the least efficient use of space (320gb available).
RAID-5 will give you a balance between redundancy and efficiency (640gb available)

Offline

#5 2009-10-01 14:31:30

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

Re: Installing Arch w/ RAID Config

fukawi2 wrote:

RAID-5 will give you a balance between redundancy and efficiency (640gb available)

So I would like simply like to use RAID 5. I am following the wiki and am still a bit confused. When I am going through the installer (cfdisk) I can see all 3 disks. I am just not understanding how I partition them up to create equal space on all three drives for my RAID array.
For example, the Wiki has the following info:

We'll use cfdisk to do this partitioning. We want to create 3 partitions on each of the three drive:

Partition 1 (/boot): 100MB, type FD, bootable
Partition 2 (swap): 2048MB, type FD
Partition 3 (LVM): <Rest of the drive>, type FD

Am I to create the same 3 partitions on each drive? Also why LVM on partition 3? I don't want to use LVM. I simply want RAID 5 only. What should I set the mount point as for partition 3? Could that just be /?


./

Offline

#6 2009-10-01 22:18:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

Grub can't boot from RAID-5, so you'll have to keep a partition free to use as /boot. For simplicities sake, it's easier to create the same partition on all 3 drives to keep everything the same for when it comes to the RAID part.

There is no point putting Swap on RAID, so create a swap partition on each drive. You can use all 3, so your total swap space will be the combination of all 3 partitions.

That seems to be a typo in the wiki - partition type FD is Linux Software RAID, so someone (I think maybe even me!) forgot to change 'LVM' to 'RAID'.

There is no mount point for the third partitions - these become your RAID array (/dev/md0) and then this is mounted as /

Last edited by fukawi2 (2009-10-01 22:19:30)

Offline

#7 2009-10-02 19:13:13

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

Re: Installing Arch w/ RAID Config

OK thanks so much. That info now makes sense. I booted from my Arch installer disk and performed the following:

- setup network
- configure local disks in cfdisk (as described in the Wiki)
- I then assume I am to switch to another TTY window and load the mdadm modules. I go to another TTY window and login as root and run the following:

# modprobe raid1
# modprobe raid5

Is that correct? The Wiki is a little vague at that point.

I then am also able to use mdadm --create on all 3 partitions I created. No errors, Where I am now stuck is how do I assign mount points to the RAID /dev/mdx partitions I created? When I go back to the installer on TTY1, it just sees /dev/sda1...2...3 and so on. Do I need to continue to assign mount points from TTY2 in command line mode? Or should I return back to TTY1 which is where I originally ran the Arch installer?

Please help!


./

Offline

#8 2009-10-02 20:12:44

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

Re: Installing Arch w/ RAID Config

Devices to be mounted have to have filesystems established.

Most create raid activities with mdadm require to mkfs.

Don't know if this is required for 0xfd, however , since it is linux raid autodetect.

My use of md0 required it to have a filesystem created on the raid array md0.

All of the raid info in the wiki seems to intermix info between methods...confusing.............


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

#9 2009-10-02 23:35:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

Carlwill wrote:
# modprobe raid1
# modprobe raid5

Is that correct?

You only need to modprobe the type you're going to use - raid5 according to your earlier post.

Carlwill wrote:

I then am also able to use mdadm --create on all 3 partitions I created. No errors, Where I am now stuck is how do I assign mount points to the RAID /dev/mdx partitions I created? When I go back to the installer on TTY1, it just sees /dev/sda1...2...3 and so on. Do I need to continue to assign mount points from TTY2 in command line mode? Or should I return back to TTY1 which is where I originally ran the Arch installer?

From the wiki:

mdadm --create /dev/md0 --level=5 --raid-devices=3 /dev/hda3 /dev/hdb3 /dev/hdc3

You'll need to change hdaX to sdaX of course. I'll fix that in the wiki after I post this. Does that give you an error?

Once that's done, you can `mkfs -t TYPE /dev/md0` replacing TYPE with the file system type you want to use of course.

Offline

#10 2009-10-03 00:15:18

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

Re: Installing Arch w/ RAID Config

I don't know if this needs to be said or if it matters at all but I am using the 'netinst' disk. The installer is straight forward but when I follow the wiki, I am guessing I am to assume I need to switch to a TTY2 window, right?

When I do so and login as root (no password via Live installer CD), there I can run the 'mdadm' command fine and I get no errors at all. It works fine and when I run the fdisk -l, I can see my /dev/md0 device. I am guessing I can also run the 'mkfs -t ext4 /dev/md0' command fine. I haven't tried it yet but am guessing it will work fine assuming the Live installer has ext4 support.

I don't understand when I need to switch back to the installer I switched from on TTY1? I would still need to switch back and create a mount point, right? I want to set /dev/md0 to be my root partition. What am I missing here? I just get confused after I create my RAID5 partition, how I complete the install as I normally would via 'netinst'?


./

Offline

#11 2009-10-03 07:25:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

Change back to the installer after you've done the mkfs stage. If you enter the "Setup Disk"* menu then /dev/md0 should be listed under your other /dev/sda etc devices. Make sure you don't mount any of the raid partitions (eg, /dev/sda3) otehrwise you'll clobber your RAID!

* I can't remember the exact name of that step, it's been a while.

Offline

#12 2009-10-03 15:56:04

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

Re: Installing Arch w/ RAID Config

Fukawi

Thanks for walking me through this guide. I am going to give it a try before the weekend is over. I will post back hopefully my success or any questions I encounter. I appreciate everything you have posted!!!


./

Offline

#13 2009-10-03 19:01:47

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

Re: Installing Arch w/ RAID Config

So in 'cfdisk' I partitioned all three disks as followed:

/dev/sda:
sda1 = 1024 fd
sda2 = 512 swap
sda3 =  remaining 300+GB fd

/dev/sdb:
sdb1 = 1024 fd
sdb2 = swap
sdb3 = remaining 300+GB fd

/dev/sdc:
sdc1 = 1024 fd
sdc2 = 512 swap
sdc3 = remaining 300+GB fd

I wrote all changes to disk in 'cfdisk' utility.

I then ran:

# modprobe raid1
# modprobe raid5

That went fine with no errors:

I then created the array for /dev/sdx1 and /dev/sdx3 ONLY. I did not follow the Wiki instructions and create a RAID on /dev/sdx2 since there is no point in creating a RAID array on swap, right? I think you noted this above unless I mis-understood.

Once that was done creating both /dev/md0 and /dev/md1, I created a file system on them:

# mkfs.ext4 /dev/md0
# mkfs.ext4 /dev/md1

That took some time since /dev/md0 was my huge RAID5 array and /dev/md1 was my smaller bootable RAID1 array that I will be assigning to /boot.

So basically I noticed and someone may want to note this if they decide to update the Wiki. After you build the RAID on your drives, you need to run the command "partprobe" so when you switch back to the installer, the newly created partitions /dev/mdx are visible and you can then assign a file system and mount point via the original installer. If you don't run the partprobe command, the installer only uses partitions you created during cfdisk which is not the /dev/mdx.

Thanks again for all your help!


./

Offline

#14 2009-10-04 07:17:54

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

No problem -- GRUB still doesn't support ext4 IIRC, so I think you may have trouble booting from your sdX1 array...

And yes, swap on raid is pointless.

Offline

#15 2009-10-05 17:30:50

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

Re: Installing Arch w/ RAID Config

Looks like after the system installed and I selected to load on Grub on /dev/md0 (/boot), I rebooted the machine and it complained it could not find /dev/md1. It said it could not find it and I should try rootdelay=10 on the kernel line in grub. Nothing worked and it can't boot properly. I really am just lost and think I should give up. When I created the system again last night, I did:

/dev/md0
sda1
sdb1
sdc1

I then mounted the /dev/md0 as /boot (bootable) via ext3 file system.

/dev/md1
sda3
sdb3
sdc3

I then mounted the /dev/md1 as / via ext4 file system.

During the setup when asked to install / load Grub, it asks if /boot is a part of software RAID and I said yes. I pointed it to /dev/md0.

All this and the system just wont boot. It loads Grub and I select Arch Linux and it starts to load but fails to find /dev/md1.


./

Offline

#16 2009-10-05 18:09:05

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

Re: Installing Arch w/ RAID Config

Perhaps the boot in ext3 cannot allow ext4 in /dev/md1?


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

#17 2009-10-05 18:11:29

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

Re: Installing Arch w/ RAID Config

Huh? I did not think it mattered what partition was formatted as what. I know that Grub can't support ext4 so I formatted it as ext3.


./

Offline

#18 2009-10-05 20:00:52

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

Re: Installing Arch w/ RAID Config

I ended up starting from scratch again and did /dev/md0 (boot) and /dev/md1(/) both as ext3. When I rebooted, the same thing. It waits 10 seconds to start /dev/md1 and it fails.

I think I am close to giving up...


./

Offline

#19 2009-10-05 21:25:11

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

You should be OK with your setup up to this point, however this is the trickiest part... I've spent much time trying to get this part working when I've been installing on RAID wink

1. What is your HOOKS array in mkinitcpio.conf?
2. I found for some reason drives sometimes swap around at boot time which caused me problems:
http://bbs.archlinux.org/viewtopic.php?id=70008

Last edited by fukawi2 (2009-10-05 21:25:29)

Offline

#20 2009-10-06 21:24:47

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

Re: Installing Arch w/ RAID Config

fukawi2 wrote:

You should be OK with your setup up to this point, however this is the trickiest part... I've spent much time trying to get this part working when I've been installing on RAID ;)

1. What is your HOOKS array in mkinitcpio.conf?

At what point do I check this file? Is this after I create the raid array with the 'mdadm --create...' command and before I install packages or after I install Grub?


./

Offline

#21 2009-10-06 22:00:36

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

When you are going through the installer and it asks you to check all your configuration files like rc.conf, locale.conf, hosts.allow etc. One of those files listed is mkinitcpio.conf

But that doesn't matter now, you're past that stage... Just boot the installers, assemble the RAID, mount it and check the current file. There's docs in the wiki about how to manually assemble the RAID, mount it and chroot into it.

Last edited by fukawi2 (2009-10-06 22:01:30)

Offline

#22 2009-10-07 20:32:32

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

Re: Installing Arch w/ RAID Config

I checked that file. I found nothing in there in reference to RAID or /dev/mdx.

I thank you for your help but I find the Wiki to be extremely vague and just too complex for what it's worth. I guess I am just frustrated at this point and don't see myself getting this sorted out.


./

Offline

#23 2009-10-07 22:11:27

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Installing Arch w/ RAID Config

Carlwill wrote:

I checked that file. I found nothing in there in reference to RAID or /dev/mdx.

The question was what it the HOOKS array from that file? wink

It should look something like this:

HOOKS="base udev autodetect pata scsi sata usbinput keymap lvm2 encrypt filesystems"

Yours will almost certainly be slightly different though.

Offline

#24 2009-10-07 22:19:07

daf666
Member
Registered: 2007-04-08
Posts: 470
Website

Re: Installing Arch w/ RAID Config

This is a little dusty, I hope it can help (Installing Arch on a RAID (for dummies)): http://bbs.archlinux.org/viewtopic.php?id=37872

Offline

#25 2009-10-07 23:43:47

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: Installing Arch w/ RAID Config

You can always try to add something like this

md=0,/dev/sda1,/dev/sdb1 md=1,/dev/sda2,/dev/sdb2

to your kernel line, where md=0 =/dev/md0 and md1=/dev/md1 (just change it to reflect your drive setup)

This tells the kernel which drives should be in the array, then you can mess with getting initrd to autodetect (so-to-speak) the raid


Website - Blog - arch-home
Arch User since March 2005

Offline

Board footer

Powered by FluxBB