Ubuntu – How to automount a fake raid

dmraidraid

Hardware

  • Asus K8N4-E Deluxe Mobo
  • Sil 3114 fake raid, onboard
  • 2 Seagate 250 gb hd, hosting my /home
  • A backup on a separate hard disk of /home

What I have so far

I've made the raid using the Sil 3114 firmware. I'm using raid level 1. I have a bash script I run as root as soon as I get a prompt:

dmraid -ay
mount /dev/mapper/sil*1 /home

The problem

I have to logon as root and use that stupid bash script every boot. Ubuntu isn't automatically understanding the raid volume. I haven't put the raid volume in fstab because it doesn't exist on boot. How do I have /home from my fakeraid automounted at boot?

Best Answer

Here are the steps needed to setup fakeraid and get relevant partitions auto-mounted:

  1. Install the dmraid package:

    sudo apt-get install dmraid
    
  2. Reboot (this is because dmraid adds itself into initramfs)

  3. The fakeraid device should appear e.g.:

    $ ls /dev/mapper/*
    brw-rw---- 1 root disk 252,   0 Dec  6 16:21 /dev/mapper/isw_dhdhchcbaf_Dima
    brw------- 1 root root 252,   1 Dec  6 16:21 /dev/mapper/isw_dhdhchcbaf_Dima1
    crw------- 1 root root  10, 236 Dec  6 16:22 /dev/mapper/control
    

    Above, *Dima is the fakeraid device, while *Dima1 is the partition. If you don't have *N, you need to create a partition table, create a partition, format ot with a filesystem and reboot again.

  4. In Ubuntu, all partitions are mounted by UUID by default. Let's find out UUID:

    $ sudo blkid
    [sudo] password for xnox: 
    /dev/sda: TYPE="isw_raid_member" 
    /dev/sdb: TYPE="isw_raid_member" 
    /dev/mapper/isw_dhdhchcbaf_Dima1: UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae" TYPE="ext4" 
    /dev/sdc1: UUID="A904-D2E7" TYPE="vfat" 
    /dev/sdc2: UUID="6669d411-80c3-41cc-a629-ad84e1ee6854" TYPE="ext4" 
    /dev/sdc3: UUID="2bf263f1-753f-4b2e-92a6-b00381515e0c" TYPE="swap" 
    /dev/sdd1: UUID="C499-1A68" TYPE="vfat" 
    

    See that the wanted one is UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae"

  5. Therefore the /etc/fstab entry would be:

    UUID="92edd1fd-94c5-4617-b829-fa4a8378b7ae" /srv/dima ext4 defaults 0 0
    
Related Question