Notes on RAID for Ubuntu

From Wildsong
Jump to navigationJump to search

Shorthand notes on how to convert a new Ubuntu system to RAID 1

Install Ubuntu Server

System has 12GB of RAM

System has two 250GB drives (actually a 320 and a 250, I ignore the extra space for now)

During installation create 6 partitions on each drive, so that the system can be converted to RAID 1 (mirrored)

1   1GB  /boot     wont be raid, so we can boot!
2  10GB  /raidroot where the system will be eventually
3  10GB  /         initial install location
4        EXT
5  24GB  SWAP      won't be raided, so we will have 48GB of swap
6 200GB /raidvar   will be raided /var partition

Partitions are far bigger than they need to be but the data on this system will live on an NFS server and on another RAID array to be installed later. Making the boot partitions 1 GB means in a pinch an entire copy of Linux can be installed there.

Do the installation. After it's done install the package to manage raid

apt-get install mdadm

Create RAID filesystems

In /etc/raidtab

# Root partition will be here
raiddev /dev/md0
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/sda2
        raid-disk       0
        device          /dev/sdb2
        raid-disk       1

# After successfully installing a bootable copy of /dev/sda3 on /dev/md0
# uncomment this to bounce a backup copy of the root to /dev/md1
#raiddev /dev/md1
#        raid-level      1
#        nr-raid-disks   2
#        nr-spare-disks  0
#        persistent-superblock 1
#        device          /dev/sda3
#        raid-disk       0
#        device          /dev/sdb3
#        raid-disk       1

raiddev /dev/md2
        raid-level      1
        nr-raid-disks   2
        nr-spare-disks  0
        persistent-superblock 1
        device          /dev/sda6
        raid-disk       0
        device          /dev/sdb6
        raid-disk       1