SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I was wondering if anyone has had good/bad experiences with RAID 5 (software/md) on Slackware, as I have four Seagate Barracuda 7200.10's that I was going to put in an RAID 5 array. The setup is mainly for the extra space, speed, and some redundancy. Also, don't plan on adding another drive to the setup for a long time, so no need to worry about any problems with that and RAID 5. Server is an Opteron 170 with 4 GB of RAM, mainly used for network file/print services, and as a development box (Apache/Lighttpd, PHP, MySQL).
It would be serveral different partitions and md devices as I've been told you can't/shouldn't partition an array. Different partitions for /, /home, /tmp, /usr, /usr/src, and /var, and also a small RAID 1 partition for /boot (Can't boot a RAID 5 setup afaik).
Anyone have any thoughts/comments on this? I've done some research and it seems that doing RAID in Slackware isn't all nice and easy as it would be in CentOS or another distro that has RAID capibilities in it's installer.
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345
Rep:
I am running a RAID 5 array on a Slackware 10.2 box. I used the Software RAID HOWTO at the Linux Documentation Project www.tldp.org to set it up. I didn't find it that hard at all. Main problem I had was that one of the refurbished drives I was trying to use wouldn't work, and I had to replace it.
The system doesn't boot from the array, though. I have a separate drive that has / and the rest of the standard filesystem on it. I made a separate directory /srvr that I use as a mount point for the array.
I'm booting from a RAID1 device on Slackware-10.1.
Quote:
seems that doing RAID in Slackware isn't all nice and easy as it would be in CentOS or another distro that has RAID capibilities in it's installer.
True. CentOS has a nice GUI which makes installing into a RAID device convenient. The same is also possible with the Slackware install; it's just a little more "manual" (you need to make the RAID devices before you start the install, change lilo.conf and fstab a bit, etc). You might want to Google for the details of a RAID install on Slackware, otherwise, if you're switching to RAID after the install, the usual HOWTOs apply.
Well I got as far as creating the partitions and raid devices on an already working system, along with a mdadm.con and /etc/raidtab file which I though would help during the install. I did do some Google-ing about Slackware + RAID install, a lot of the hits seemed to be older, but still provided a wealth of information.
Right now I'm just deciding between moving the old system or reinstalling from scratch, the reinstall is winning right now as it would kill time today =)
The RAID how-to sort of describes the setup. I use trailing-edge technology because, basically, I am cheap.
Don't be too cheap, though. Use a UPS (uninterruptible power supply) on your RAID machine. A power failure at the wrong time during writing to the RAID can corrupt the system and make all the data absolutely unrecoverable. If you run a file server 24/7 on a UPS, I recommend getting a UPS with Linux-friendly monitoring so that the server can shut down gracefully in a power outage if you are not there. The actual cross-section for susceptibility may not be too large on lightly-loaded file servers, but if the local flash and flicker utility takes a lot of lightning hits, you are bound to get hit during an array write sooner or later. A UPS requires a certain level of maintenance. The batteries have a limited service life. I use the batteries specifically designed for UPS service and get up to ten years service life from a set of batteries. Generic type gel-cells only seen to give two or three years service. The slight extra price for UPS batteries is more than worth the price. Recycle used batteries, of course. Please do not throw them in the trash. They contain lead.
I use sets of mechanically similar SCA (80-pin hot swappable) SCSI drives which I get for $11.00 to $30.00 apiece. I use adapters to connect to the 68-pin SCSI cables. I was lucky to find removable cartridges for one of the boxes, so it is in fact hot swappable.
I use fdisk to partition them usually into three partitions.
1: The first partition is 20MB or so for a boot partition. This is initially type 83 Linux. I set the bootable flag.
2: Then I allocate 128MB or so swap partition, type 82,
3: I allocate the remainder of the drive as a type 83 partition.
I build ext2 file systems on all the boot partitions.
mkfs -t ext2 /dev/sda1
mkfs -t ext2 /dev/sdb1
etc.
I mkswap on all the swap partitions.
mkswap /dev/sda2
mkswap /dev/sdb2
etc.
I build reiser journaling file systems on the main partitions. Using a journaling file system is one more level of file security that is simply too cheap to pass up.
mkreiserfs /dev/sda3
mkreiserfs /dev/sdb3
etc.
I initially install slackware on the last drive, with only rudimentary pieces disk sets a, ap, and maybe d. That is, I use /dev/sd<lastdrive>2 as root directory. With the fast machines and disk drives, I could go ahead and install everything, but I am simply going to clobber it, so why bother? I make a USB boot stick, which has come in handy many times.
After I get the system so it will boot, I assemble the RAID arrays. I use jed to write /etc/raidtab with all the drives in the arrays, but declare the last drive (the one with Linux installed) as failed. I use mdadm to build the arrays. I confirm the progress of the array assemble by looking at the /proc/mdstat pseudofile.
cat /proc/mdstat
I make mount points for the boot and main RAID arrays.
mkdir /mnt/md0
mount /dev/md0 /mnt/md0
I copy the /boot directory to /mnt/md0.
cp /boot/* /mnt/md0
After the RAID arrays work, I go back with fdisk and change the type of all the partitions in all the disks (except for my last drive, which I am using to bootstrap the whole process) to type fd (Linux raid autodetect).
I reboot with the install CDROM and install everything, using /dev/md1 as swap, using /dev/md2 as / (root) and mounting /dev/md0 on /boot. Well, actually, it sometimes goes better to install just the a package until I work the kinks out and get a bootable system. After I get lilo to install a bootable system, I use mdadm to add the partitions from the last drive (my "bootstrapping" drive) into the RAID arrays. I use fdisk to change the type of the partitions in the last drive to fd Linux raid autodetect. Again, I confirm progress with
cat /proc/mdstat
I have experimentally verified that I can remove any drive from a running system without losing data. I can also use mdadm to add the partitions of the replaced drive back into the arrays.
Be sure to check the array status from time to time with
cat /proc/mdstat
Disks drives, especially cheap used ones, fail. The question is not "Will a drive fail?" The question is "WHEN will a drive fail?" The RAID protects you from single-drive failures (or multiple drive failures, depending on your configuration). After you have lost your redundant drives and any spares, losing one more drive will make all of the data completely unrecoverable. Please don't ask me how I know this. Just pay attention, and perhaps you won't learn it the hard way.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.