Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » Tips, Tricks & Tutorials

Post new topic   This topic is locked: you cannot edit posts or make replies.
RAID Setup on SMS
View previous topic :: View next topic  
Author Message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Sun Jan 02, 2011 9:41 pm    Post subject: RAID Setup on SMS Reply with quote

All the info about this how to is documented already by slackware team at
http://sms.it-ccs.com/isos/SMS-Current/README_RAID.TXT
but let's make it as simpler as we can.

Once you boot with SMS.Native.CD-Install-1.x.x.iso before you run setup
you need to partition your disk.
On this example I used
Code:
/dev/sda1   *          63    14651279     7325608+  83  Linux
/dev/sda2        14651280    16771859     1060290   82  Linux swap


1. Prepare disks for RAID 1 Array (clone /dev/sda to /dev/sdb)
Code:
sfdisk -d /dev/sda | sfdisk /dev/sdb

2. Create RAID 1 Array for root partition
Code:
mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sda1 /dev/sdb1

3. Create RAID 1 Array for swap partition
Code:
mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sda2 /dev/sdb2

4. Setup swap area
Code:
mkswap /dev/md1

5. Create RAID 5 Array for home partition
Code:
mdadm --create /dev/md2 --level 5 --raid-devices 3 /dev/sdc /dev/sdd /dev/sde


Start setup and choose as swap partition /dev/md1, choose as root partition /dev/md0, for home /dev/md2.
Ignore partition /dev/sd[ab]1 /dev/sd[ab]2 and continue with setup.
When it's time to choose a kernel choose a generic one, since huge kernels complains with initrd images, although they may work just fine.

When setup finish don't reboot your server.

You need to chroot to your newly system
Code:
chroot /mnt

And edit /etc/lilo.conf to something like
Code:
append="root=/dev/md0"
raid-extra-boot = mbr-only
LBA32
boot = /dev/md0
prompt
timeout = 30
compact
change-rules
reset
vga = 791
image = /boot/vmlinuz
  root = /dev/md0
  label = SMS
 initrd = /boot/initrd.gz
  read-only


The most important is to create the initrd image with
Code:
mkinitrd -c -k 2.6.35.7-smp -m ext4 -f ext4 -r /dev/md0 -R

Where
-k your kernel
-m your modules (-m ext3,ext4,reiserfs you might need a controller)
-f root filesystem
-r root partition
-R add support for RAID in initrd.

SMS generic kernels have built in support for ext2 ext3 ext4 and jfs.

run lilo and ignore the warnings.
exit and reboot your server.

-Using a huge kernel-
You can use a huge kernel without an initrd.bz if you like but to recognize raid arrays at boot you need to edit /etc/rc.d/rc.S and add between udev and lvm
Code:
progressbar 10
# Re-assemble RAID volumes:
/sbin/mdadm -As

And final type to add your arrays in mdadm.conf
Code:
mdadm -Es >> /etc/mdadm.conf

-Notification of degraded arrays -
You can add in your /etc/rc.d/rc.local
Code:
/sbin/mdadm -Ff /dev/md[0-9] -i /var/run/mdadm.pid

So by adding your mail address in /etc/mdadm.conf, you will be notified when arrays get degraded.
Or you can have it all in one line
Code:
/sbin/mdadm -Ff /dev/md[0-9] -i /var/run/mdadm.pid -m root@locahost

- Video Tutorial -
______________________



You can download the video in .mkv format.
raidsetup.mkv 4.4MB

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    SMS Forum Index » Tips, Tricks & Tutorials All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional