The problem
Ubuntu (and Debian) doesn’t have support for the SATA RAID (also called FakeRAID since some of the functionality is provided by software) controllers being shipped on recent motherboards. The software to handle FakeRAID arrays in Linux is DMRAID. How do I install such systems?
.
Preliminary Operations
You will need to configure your RAID using the bios utility (Ctrl+M for me on startup) : just select your disks, create the logical unit selecting your desired raid mode (0 or 1 for me), save and boot with a desktop live CD.
Note: in this example I’m using Fujitsu Siemens Primergy RX100 S4 equipped with two 160Gb SATA drives, and I’m creating a RAID0 array, with Ubuntu Linux 7.10 Gutsy Gibbon
.
1st phase – create your partitions
To create your partitions you’ll need that your RAID is reconized from your system. Unfortunately, at the time I’m writing, Ubuntu does not include DMRAID support in its install procedure, so you’ll need to start with a live CD, activate DMRAID support and proceed to partitioning.
- start your system with an Ubuntu Desktop CD (select your language if needed)
- open a terminal (CTRL-ALT-F1), set a new root password wih “sudo passwd root”
- go on with “su – ” (digit your password)
- edit /etc/apt/sources.list, uncomment universe packages
- “apt-get update”
- install dmraid: “apt-get install dmraid”
- Launch fdisk specifying the shorter device you find under /dev/mapper/dxxx (dxxx is the file device with shorted name, es.: dxxxa28 is the correct one, dxxxa281 the wrong one)
- create a primary partition of 316GB, the other with the remaining space (we’ll use it for swap)
- n <enter>
- p <enter>
- 1<enter>
- <enter>
- +316GB
- create a primary partition with the remaining space:
- n <enter>
- p <enter>
- 2 <enter>
- <enter>
- <enter>
- change second partition type:
- t <enter>
- 2 <enter>
- 82 <enter>
- save with “w”, <enter>
- restart your system with “reboot”
.
2nd phase – installing a minimal ubuntu
To format your partitions you’ll need DMRAID module loaded. So you’ll need to repeat the first six previous steps.
- format your root partition
- mkfs -t ext3 /dev/mapper/dxxx1 (select the device ending with 1)
- prepare a local area for the installation procedure: create a local folder, mount your formatted partition on that folder, bind and mount the necessary stuff
- mkdir /target
- mount /dev/mapper/dxxx1 /target
- mkdir /target/dev
- mount – - bind /dev/ /target/dev
- mkdir /target/proc
- mount -t proc proc /target/proc
- mkdir /target/sys
- mount -t sysfs sys /target/sys
- proceed installing a minimal ubuntu
- apt-get install debootstrap
- debootstrap gutsy /target
- copy essential files on your partition
- cp /etc/apt/sources.list /target/etc/apt/
- cp /etc/resolv.conf /target/etc/
- cp /etc/hosts /target/etc/
- cp /etc/network/interfaces /target/etc/network/
- switch on your new system, re-mount /proc, /sys, /dev
- mount – - bind /dev/ /target/dev
- mount -t proc proc /target/proc
- mount -t sysfs sys /target/sys
- chroot /target
- install a basic ubuntu system
- apt-get update
- apt-get install language-pack-en
- apt-get install ubuntu-standard linux-generic dmraid grub
- create a user, if you want
- useradd pippo
- passwd pippo
- mkdir /home/pippo
- chown pippo /home/pippo
- set root password
- passwd root
.
3rd phase – boot loader configuration
Yes, you’ll need to configure grub
- copy grub essential files
- mkdir /boot/grub
- cp /usr/lib/grub/i386-pc/stage1 /boot/grub/
- cp /usr/lib/grub/i386-pc/stage2 /boot/grub/
- cp /usr/lib/grub/-pc/* /boot/grub/
This will copy the staging file for the various filesystem in your boot partition. In my example the directory is “/usr/lib/grub/i386-pc/” and the files that are copied are “e2fs_stage1_5″, “jfs_stage1_5″,…
- configure di grub
- grub (enters grub interactive shell)
- device (hd0) /dev/mapper/dxxx (the shorter, so the logical disk, not the partition)
- root (hd0,0)
- setup (hd0)
- quit (exit from grub shell)
- update-grub (update grub files)
- configure grub menu
- edit grub menu.lst: “vi /boot/grub/menu.lst”
- check groot is pointing to hd0,0 (it should be necessary to uncomment that line)
- check that savedefault is commented (normally is)
- modify, inside “kernel” items, the “root” value to “/dev/mapper/dxxx1″ (your root partition)
- configure static mount under /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/mapper/ddf1_LogicalDrive_01 / ext3 defaults 0 1
/dev/mapper/ddf1_LogicalDrive_02 none swap sw 0 0
- reboot
Bottom line
Well, you’ve done! Remember that if you mounted a RAID0 device Linux at startup will probe your disks and he’ll wrongly detect a bad partition table: ignore error messages http://osdir.com/ml/linux.ataraid/2006-10/msg00019.html
Little tips:
- if you need to reconfigure your keyboard use:
http://www.basictrading.biz/2006/12/08/ubuntu-server-keyboard/ (”dpkg-reconfigure console-setup”)
- if you need to reconfigure your locale:
http://blog.andrewbeacock.com/2007/01/how-to-change-your-default-locale-on.html
- if you need to change hostname:
“vi edit /etc/hostname” (reboot)
. - if you need to check swap status:
http://elleuca.blogspot.com/2006/11/swappature.html
(” swapon -s”)
Links
http://www.ubuntu-in.org/wiki/SATA_RAID_Howto
https://help.ubuntu.com/community/FakeRaidHowto
http://salaros.blogspot.com/2007/07/installare-ubuntu-704-su-raid0-in-dual.html
Try the kernel raid functionality, it’s much more stable and safe than the bios driven one. It could be a bit faster too.
See (among others)
http://linux.yyz.us/why-software-raid.html
Comment by uberto — April 1, 2008 @ 11:55 pm |
Thanks, I’m currently using it somewhere, but if I have a fakeraid I alway prefee DMRAID because:
– it will easily work in a dual boot mode
– arrays may be rebuilt using BIOS (even if OS is lost)
– performance are almost equal (in both cases the CPU will do most of the work)
Comment by Bruno Bossola — April 2, 2008 @ 11:10 am |
Very interesting, but unfortunately I didn’t get it to work. Ended up with Grub loading and then a list of I/O erros, when experimenting with my Fujitsu-Siemens Primergy Econel 102 S2 with two 160Gb SATA drives, installing Ubuntu 7.10 Gutsy Gibbon.
I’m sort of a newbie, so it was probably because I did something wrong when getting stuck. Here is a bit of feedback…
“edit /etc/apt/sources.list, uncomment universe packages”
- I didn’t know how to edit, but in the end managed to do a “vi /etc/apt/sources.list” (and get out again)
“mount –bind /dev/ /target/dev”
- resulted in an error, but “mount –-bind /dev/ /target/dev” worked
“cp /etc/network/interfaces /etc/network/”
- wouldn’t copy to same location, so I guessed “cp /etc/network/interfaces /target/etc/network/”
“cp /usr/lib/grub/i386-pc/”
- didn’t work, so I guessed “cd /usr/lib/grub/i386-pc/”
“modify, inside “kernel” items”
- so this would be those to or three instances at the end of the file?
And then I got totally stuck when editing /etc/fstab. Should I erase the lines that were already in the file? I chose to, and then rebooted, and got the I/O errors.
Comment by rokur — April 3, 2008 @ 5:31 pm |
Topic 1
You should uncomment universe packages.
> “edit /etc/apt/sources.list, uncomment universe packages”
> – I didn’t know how to edit, but in the end managed to do
> a “vi /etc/apt/sources.list” (and get out again)
>
Right, vi should do the job
The contents of the /etc/apt/sources.list file may look something like this:
## sources.list
## General comments about the sources.list file
deb http://archive.ubuntu.com/ubuntu dapper main restricted
deb-src http://archive.ubuntu.com/ubuntu dapper main restricted
## Comment about the ‘Update’ repositories
## Comments about the role of the updates
deb http://archive.ubuntu.com/ubuntu dapper-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu dapper-updates main restricted
## Comment on the ‘Universe’ repositories
## Comment about the support limitations of Universe & Multiverse
## repositories as well as licence restrictions and update policies.
## Please satisfy yourself as to your rights to use the software.
# deb http://archive.ubuntu.com/ubuntu dapper universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu dapper universe multiverse
You just have to uncomment this last two lines (remove ‘# ‘ from the start of the line)
Topic 2:
> “mount –bind /dev/ /target/dev”
> – resulted in an error, but
> “mount –-bind /dev/ /target/dev” worked
>
This is a wordpress/theme/whatever issue: in the text two dashes are present… uhm… I’ll put a space between them
Topic 3:
> “cp /etc/network/interfaces /etc/network/”
> – wouldn’t copy to same location, so I guessed
> “cp /etc/network/interfaces /target/etc/network/”
>
You’re right, I’ll fix it in the article
Topic 4:
I’ll fix in in the article
> “cp /usr/lib/grub/i386-pc/”
> – didn’t work, so I guessed “cd /usr/lib/grub/i386-pc/”
>
I completely miss a piece of code
It should be read:
cp /usr/lib/grub/-pc/* /boot/grub/
This will copy the staging file for the various filesystem in your boot partition. In my example the directory is “/usr/lib/grub/i386-pc/” and the files that are copied are “e2fs_stage1_5″, “jfs_stage1_5″,…
Topic 5
> “modify, inside “kernel” items…”
> – so this would be those to or three instances at the
> end of the file?
>
Yes, your menu.lst will look something like this:
title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/mapper/ddf1_LogicalDrive_01 ro
initrd /boot/initrd.img-2.6.22-14-generic
title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/mapper/ddf1_LogicalDrive_01 ro single
initrd /boot/initrd.img-2.6.22-14-generic
title Ubuntu 7.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
Topic 6
> And then I got totally stuck when editing /etc/fstab.
> Should I erase the lines that were already in the file?
> I chose to, and then rebooted, and got the I/O errors.
>
Yes, you have to redefine standard mount points. Apart from /proc (standard) you will have to configure mount point / (your root directory) on dmraid device 01 and select your swap partition (device 02)
Bottom line
I don’t know where the problem you’re experiencing may happen… it seems you successfully configured your dmraid device don’t you? If you boot from a live CD, get dmraid package installed, you’re able to read/write from the raid device, aren’t you? So it should be a problem with phase 3, a grub problem or a mount problem. You should double check your grub configuration, /boot/grub/menu.lst and /etc/fstab
Anyway, thanks for your great feedback! If you need more help drop me a mail, maybe I’ll be able to give you more advices, even if I’m also a noob in linux
You may check also on these pagese:
https://help.ubuntu.com/community/FakeRaidHowto
http://www.ubuntu-in.org/wiki/SATA_RAID_Howto
Comment by Bruno Bossola — April 4, 2008 @ 11:30 am |
Right, I tried and failed again, and will send you an email request then. I think that maybe I’ve misunderstood how to name the root partition in /boot/grub/menu.lst and /etc/fstab, since I get this error message right before Grub fails: “ALERT! /dev/mapper/ddf1_4c534920202020808627c3000000003527711500000a281 does not exist. Dropping to a shell!”
Comment by rokur — April 4, 2008 @ 5:07 pm |
Hallo.
After I followed all Your steps, when I try to boot Ubuntu from grub, i get a message saying the root string is false (/dev/mapper/xxx1). How can i fix it?
Thx
Comment by g — April 26, 2008 @ 3:07 pm |
It would be great if you could update this posting to include better explanations of the steps (the theory behind each step I mean). It would be a great help for those of us familiar with the concepts, but not the system. For example, what is the mapper directory? when is it created? What are the partition steps (where you just have the commands listed)? What is the theory behind the partition layout? Is swap raided? Is boot raided? Can the computer boot from raid (both hard drives)?
…
In any case, thanks for the instructions.
Comment by Chris — May 15, 2008 @ 4:37 am |
I think you’ve got a great tutorial here, but to be honest, I guess I’m a little too green to understand it all.
I’m currently trying to install Ubuntu 8.04 Desktop with RAID 5 and have been failing miserably. I have FakeRAID on the motherboard (Intel ICH8R) and I’ve tried that and software raid with no luck. The Ubuntu installer doesn’t seem to even acknowledge the FakeRAID (though I now understand why from reading your post) and when setting up software RAID 5, neither grub nor lilo will install (they generate fatal errors).
I read something that said neither grub nor lilo will work on RAID 5 period (unless it’s hardware RAID) which was rather disappointing.
One thing I’ve noticed though, is that I’ve been trying to set up all 4 of my disks as one great big RAID 5 partition assigned to / (root). Some of the tutorials I’ve been reading make it sound like I should be creating SEVERAL partitions. I’m not really sure if I need to or not. I fail to see the need for a swap partition (I have 8GB of DDR2-800 ram in the box), but maybe I do need all those partitions?
Your tutorial is somewhat easy to follow for a complete linux noob, but when you get to the parts about editing files, well… I don’t have the vi commands memorized (except for how to quit!) and most linux noobs have probably never even used it. It might be a good idea to add a list of the basic vi commands they’ll need to get those edits done.
Some clarification on whether or not grub would boot from a raid 5 partition or not and if not, I guess we just set up a /boot partition using raid 1? How big should this partition be? I don’t want to waste space I don’t have to…
Thanks again for the tutorial. Hopefully I don’t end up staying up *all* night on this. I’m going to try the software raid route again and create a raid 1 boot partition and a small swap partition and see if I can manage to get this beast running. I’d really much rather do the FakeRAID thing as it makes things a lot easier for me if a hard drive ever does die.
What would really be awesome is if Ubuntu:
a) Had that dmraid thing built into the installer (these FakeRAID controllers are commonplace now).
b) Was a little more intuitive about the partitioning and RAID setup stuff so n00bs like me could just say “I wanna use raid 5, with these disks, please make it happen” without all the partitioning and crap. I shouldn’t need to *know* Linux to install it on my machine.
Maybe I’m asking too much?
I’m saving your page to my Google notebook so I can post my results later.
Comment by Jason — June 15, 2008 @ 6:49 am |
Wow, I really want to set-up the software RAID, but this is just too much. Ubuntu has to automate this process.
Comment by Paul Weiss — June 17, 2008 @ 9:37 am |
I just did this today. Worked really well. Now I am trying to figure out how to break it. I pulled a drive. The OS throws a system change error. But when I try to do an ls -l on /etc for example I get an infinit it seems list of I/O errors. I figured, you loose a drive it keeps chugging along but with errors. I didnt expect it to crash the OS. But when you shut down, put drive back in, then boot back up, shes good as new.
RAID1 on a new HP DL320 G5p with the embedded Intel RAID. Two 160GB Seagate drives.
Comment by Justin — June 18, 2008 @ 9:38 am |
Somehow i missed the point. Probably lost in translation
Anyway … nice blog to visit.
cheers, Flushness
Comment by Flushness — June 19, 2008 @ 3:31 pm |
Man, i’m having a problem when i have to repeat the six previous steps, when i install dmraid it doesn’t create nothing at /dev/mappper/xxxxx , where before it created a “via_xxxxxxxxxx”, something like this…what can i do?
Comment by Diego — June 29, 2008 @ 11:21 pm |
Hi, I just upgraded to Ubuntu 8.04 and I’m trying to access Raid Volumes which are created by the Intel Storage manager on Windows. It works nicely with a Knoppix Live CD but not with Ubuntu.
I’m already stuck at the first problem, I can’t install dmraid.
When I’m entering “sudo apt-get install dmraid”
I get the message ‘Couldn’t find package dmraid’. Synaptic package manager doesn’t find it either. Help! Is dmraid still available on 8.04?
Cheers,
Martin
Comment by Martin — August 10, 2008 @ 11:22 am |
@Martin
dmraid is not included by default in 8.04, you have to edit /etc/apt/sources.list and refresh as stated in the article.
Comment by Bruno Bossola — August 13, 2008 @ 3:40 pm |
Hi.. please help.
I have installed dmraid on my Ubuntu 8.04 server. I have mirrored 2 SATA 320GB hard drives on my Intel Software RAID motherboard – S3210SHLC
The setup is like this –
80GB Ubuntu – non RAID
320GB x 2 – isw – RAID mirror – volume label – abraid203 – dmraid – mounted on /home1
My dmraid was working properly until one of my hard disks failed. I put in a new 320 GB as a replacement.
In the Intel RAID utility (bios/post) – it shows my raid volume “Status” as “REBUILD” – but does not give me an option to Rebuild in the utility itself. I repeat – there is no option to REBUILD RAID in the intel utility.
It gives the message “RAID will be Rebuilt in the Operating System”
I left the PC on for a day but my RAID doesnot rebuild on it’s own.
Here is the biggest question “HOW DO I REBUILD MY RAID USING dmraid?”
My RAID status in linux is currently as follows
dmraid -r
/dev/sdc: isw, “isw_eedegdeef”, GROUP, ok, 625142445 sectors, data@ 0
/dev/sdb: isw, “isw_eedegdeef”, GROUP, ok, 625142445 sectors, data@ 0
dmraid -s
*** Group superset isw_eedegdeef
–> Active Subset
name : isw_eedegdeef_abraid203
size : 625137920
stride : 128
type : mirror
status : ok
subsets: 0
devs : 2
spares : 0
i give the command
fdisk /dev/mapper/isw_eedegdeef_abraid203
Command (m for help): v
625137927 unallocated sectors
it verifies the new hard disk as unallocated sectors.
I’m stuck at this point. If dmraid doenot have an option to rebuild then the only option is to change the motherboard or get a seperate RAID card and create a new RAID set.
Thanks,
Please reply if you can help.
Comment by dmraidusr — August 23, 2008 @ 7:49 pm |
very difficult to follow, looks like I am back to vista 64, annoying that vista only asks for a raid driver and everything just works compared to this.
Comment by deci — August 25, 2008 @ 6:25 am |
Thanks, this did the trick, and it’s still required with Ubuntu 8.10 which doesn’t include dmraid either.
You might want to note a few things:
1) This process works but with a few tweaks if the Ubuntu partition is not the first one. In my case, Windows is on my first partition (yeah, I should get rid of that…). So I had to tweak the fdisk commands (e.g., create partitions 2 and 3, not 1 and 2) and the grub commands a bit to make it work (e.g., “(hd0,1)” not “(hd0,0)).
2) Afterwards, I think you should warn folks that you will truly have a minimal install. This means no GUI desktop, for example. You might want to give a link or pointer on installing gnome, which is what most newbies would have expected to see.
Comment by Larry — December 17, 2008 @ 4:29 am |
@15: can you just rebuild in Bios?
With my promise running Fakeraid (dmraid) I can have it rebuild in bios… However… that is really suboptimum, as it can’t be running and utilized while it is rebuilding… Does anyone have an answer as to whether or not there is a way (manually is fine) to rebuild the dmraid array while running (assume raid 1 ofcourse, as a failed drive in raid 0 means SOL).
Thanks
Comment by darkskypoet — January 19, 2009 @ 3:40 pm |
I tried that with the Kubuntu 8.04.1 desktop CD and the PC boots and it runs, no problem.
But when u add with the root a user “tuffi” and login in with tuffi, i see only:
$_
and i cannot do anything.
what to must i do?
Tuffi
Comment by Tuffi — January 31, 2009 @ 12:28 am |
[...] basata su RAID software (che mi dicono essere decisamente più stabile e performante rispetto a dmraid) e LVM, ma mi piacerebbe sentire qualche opinione da qualcuno più esperto di me, onde evitare di [...]
Pingback by Fileserver Linux con RAID software e LVM: consigli? - Matteo Moro — February 2, 2009 @ 9:01 am |
Use 8.10 alternate cd…. everything will go automatic during install with stripped or mirrored raid.
greetz…
Comment by lar5 — February 18, 2009 @ 11:28 am |