2

I wish to install Linux Mint 11 with RAID 1 for my /home. I was wondering if I can install RAID 1 during the installation from the Live CD.

I have managed to set up RAID from the Live CD and install Linux Mint 11 to it, but on reboot it will not recognize the RAID volume as mdadm is not installed. Can I install RAID drivers from my Live CD onto the installed Mint using chroot and get Mint to recognise the volumes on reboot? Is there a better alternative?

I know this would be a trivial exercise using the Alternate CD in Ubuntu but Mint does not have an Alternate CD (at least that I aware of).

My machine setup:

disk 1 . 120GB SSD mount /
disk 2 . 1TB spindle raid 1 mount /home
disk 3 . 1TB spindle raid 1 mount /home
1

3 Answers 3

1

Yes, you can use chroot to install mdadm:

sudo -s
for f in sys proc dev ; do mount --bind /$f /mnt/$f
chroot /mnt
apt-get install mdadm

Replace /mnt with wherever you mounted your root filesystem.

1
  • Thanks, this works. you may want to issue echo nameserver 8.8.8.8 >/etc/resolv.conf if apt-get fails to resolve ubuntu package server names after the chroot (this is a Google public DNS)
    – user506747
    Oct 8, 2015 at 1:55
1

I tried different solutions to make RAID 0 and none worked. I used my imagination and I did it. So, I leave here my humble contribution, because I have used Linux for years, but I am not an expert. You know... if the system works, you don't use your knowledge. What do I think about? The Ubuntu site says that grub installs in RAID 1. When my installation is finished, livecd would not accept the partition I chose. But... why make RAID to boot??? My solution...

  • Run LiveCD Mint
  • Open the terminal
apt-get update
dd if=/dev/zero of=/dev/sda bs=1M status=progress
dd if=/dev/zero of=/dev/sdb bs=1M status=progress
fdisk /dev/sda
  • type "n" to new partition
  • choose "1"
  • choose default beginning
  • type "+500M" (I tried 200 and 300 and got a "no space cause raid use metadata")
  • type "a" to make it "bootable"
  • type "n" again
  • choose "2"
  • choose default beginning and end
  • type "t"
  • type "fd"
  • type "w" to write
  • make the same to sdb
  • probably you got something like that:

    /dev/sda1   *              2048   1026047   1024000    500M 83 Linux
    /dev/sda2               1026048 488397167 487371120  232,4G fd Linux RAID autodetect
    
apt-get install mdadm
apt-get install raidutils

I think raidutils is optional – I don't know.

mdadm --create /dev/md2 --level=0 --raid-devices=2 /dev/sda2 /dev/sdb2

I choose to boot in sda1 and after install grub in sdb2, in case of problem in sda1 – no problem, it's small space. No raid to boot - It worked fine.

cat /proc/mdstat

Is raid active? Ok

mkfs.ext4 /dev/md2
  • Try to install liveCD and chose "advanced option"
  • click mouse in md2 to change it to "journaling ext4" - in my case, the first option
  • choose format
  • and choose "/" ok
  • right below choose "sda" to device to bootloader installation

After installation, don't reboot

Open the terminal again

sudo mount /dev/md2 /target/
sudo mount --bind /dev/ /target/dev/
sudo mount --bind /sys/ /target/sys/
sudo mount --bind /proc/ /target/proc/
sudo mount /dev/sda1 /target/boot/

cat /etc/resolv.conf >> /target/etc/resolv.conf

Here I got a "permission denied". No problem. I opened one file and copy the text to other

sudo xed /etc/resolv.conf

copy text, leave it in the empty file below and save

sudo xed /target/etc/resolv.conf

sudo chroot /target 
sudo apt-get update
sudo apt-get install mdadm
sudo grub-install /dev/sda

That's all. Reboot and have fun.

0

I had to do this a few times, and the following shows some detailed examples of configuring both / and /home under a RAID when installing Linux Mint 11:

(1) boot from the live CD

(2) setup the software RAID

mint ~ # apt-get -y install mdadm 
mint ~ # mdadm --assemble --scan 
mint ~ # parted /dev/sda 
(parted) mklabel gpt 
(parted) mkpart primary ext3 1MB 500MB 
(parted) mkpart primary ext4 500MB 50.5GB 
(parted) mkpart primary linux-swap 50.5GB 114.5GB 
(parted) mkpart primary ext4 114.5GB 100% 
(parted) quit 

mint ~ # parted /dev/sdb 
(parted) mklabel gpt 
(parted) mkpart primary ext3 1MB 500MB 
(parted) mkpart primary ext4 500MB 50.5GB 
(parted) mkpart primary linux-swap 50.5GB 114.5GB 
(parted) mkpart primary ext4 114.5GB 100% 
(parted) quit 
mint ~ # mkfs.ext3 /dev/sda1 
mint ~ # mkfs.ext4 /dev/sda2 
mint ~ # mkfs.ext4 /dev/sda4 
mint ~ # mkfs.ext3 /dev/sdb1 
mint ~ # mkfs.ext4 /dev/sdb2 
mint ~ # mkfs.ext4 /dev/sdb4 
mint ~ # mdadm --create /dev/md0 --level 1 --raid-devices 2 /dev/sd[ab]2 
mint ~ # mdadm --create /dev/md1 --level 1 --raid-devices 2 /dev/sd[ab]4 

(3) Wait until it is done syncing:

mint ~ # watch cat /proc/mdstat 

(4) install the OS, while not yet choosing whether or not to reboot

When prompted to "Allocate drive space", choose "Something else" so that the already created RAID partitions can be used.

Double click /dev/md0 to create a partition on it. The size should be about 50 GB. double click the now available "free space" under md0, and specify "Ext4" and mount point /. Do the same thing for md1, except choose /home -- the size should almost be 2 TB.

Double click /dev/sda1, select "Ext3" and /boot -- the size should almost be 500 MB.

Double click /dev/sda3, and select "swap area". Do the same for /dev/sdb3. The size should be about 64 GB.

Select /dev/sda for the boot loader installation. Finish the GUI installation, but DON'T reboot yet.

(5) install mdadm on the installed system and reconfigure GRUB (double check that everything including /boot and /home are still mounted in target by the installer):

mint ~ # mount --bind /dev/ /target/dev 
mint ~ # mount -t proc proc /target/proc 
mint ~ # mount -t sysfs sys /target/sys/ 
mint ~ # chroot /target 
mint / # apt-get install mdadm 
mint / # cat /etc/mdadm/mdadm.conf 
mint / # apt-get install --reinstall grub-pc 
mint / # exit

(6) click "Restart Now" from the gui installer

1
  • A nice short 45 step process. Easy peasy.
    – MikeP
    May 11, 2017 at 21:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .