+353 897002291

+353 897005369

Access raid drives from Linux

Please read all comments before just running commands - Make sure you understand what you are doing before doing it :)

To install mint 17 to a mdadm raid array (existing) -

CODE: SELECT ALL

						mint@mint:~ $ sudo su -
root@mint:~ # apt-get install mdadm
which will install the mdadm to the live environment (note - this is temporary and only applies to the current booted session. If you reboot, you will need to do this step again).

CODE: SELECT ALL

						root@mint:~ # mdadm --assemble --scan
which activates the existing raid array. If you do not have a raid array set up, please look online for more documentation on proper setup of a mdadm software raid. This is beyond the scope of this post.

Now from this point, if you tried to run the installer, it will show you the raid drive(s) and will seem like all is well. It will fail when it goes to install grub-efi-amd64-signed because the chroot it created to install to does not have mdadm installed, and the installer will bail out, not finishing the install process including cleanup.

To avoid this mess, launch the installer from the command line with the option -b.
Open a terminal (on most systems, CTRL-ALT-T is a shortcut for this, otherwise open Mate Terminal) and then run the following:

CODE: SELECT ALL

						root@mint:~ # ubiquity -b
This will finish normally, and then close the installer. DO NOT select the option to reboot. Say you want to continue testing. If you reboot at this stage, you will not be able to boot up.

Next you will need to do the manual chroot setup / install of grub.

CODE: SELECT ALL

						root@mint:~ # mount /dev/md127p1 /mnt; mount /dev/sda2 /mnt/boot/efi
root@mint:~ # for i in /dev /dev/pts /sys /proc; do mount --bind $i /mnt$i; done
root@mint:~ # echo "nameserver 4.2.2.4" > /mnt/etc/resolv.conf
root@mint:~ # chroot /mnt
Here is a breakdown of the commands:
Assuming that /dev/md127p1 is my / raid partition (yours could be different)
/dev/sda2 is my EFI boot partition (which mounts at /boot/efi normally) (yours could be different)
/mnt is an empty folder which exists, functioning as our place to "build" our directory structure for the new system. You could use any folder which exists, and replace /mnt in the following commands with the full path to the folder you choose.

The following line:

CODE: SELECT ALL

						root@mint:~ # mount /dev/md127p1 /mnt; mount /dev/sda2 /mnt/boot/efi
mounts your root raid partition to /mnt (this could be any empty, but existing folder) and then mounts the EFI boot partition within the correct folder inside the root partition.
/dev/sda2 would change to whatever partition you set for your EFI boot partiton

The following:

CODE: SELECT ALL

						root@mint:~ # for i in /dev /dev/pts /sys /proc; do mount --bind $i /mnt$i; done
bind mounts (basically a way to have a folder in two places at once) certain directories into your new root partition. These directories are essential for being able to install software and such in a later step.

The following:

CODE: SELECT ALL

						root@mint:~ # echo "nameserver 4.2.2.4" > /mnt/etc/resolv.conf
writes a nameserver for dns resolution within the new root, allowing for software install (this will be overwritten upon your actual running of the system and is temporary)

The following:

CODE: SELECT ALL

						root@mint:~ # chroot /mnt
switches to your new environment you just set up and will be just like you were booted to it. This allows you to install software, edit configs etc as if you were booted to the system in console mode. 

man pages are a great resource for finding out about commands as well, if what I have said does not make sense...

e.g.

CODE: SELECT ALL

						$ man chroot
$ man mount


At this point, you should be looking at the directory structure of your new install on your new drive (PLEASE remember to replace the devices, including the raid devices with names that fit your system) I figure if you are following this, you are at least a little knowledgeable about these kinds of things.

Next install mdadm into your chroot:

CODE: SELECT ALL

						root@mint:/ # apt-get install mdadm
...
root@mint:/ # apt-get install shim-signed grub-efi-amd64-signed
After that all should be well and then it is just manual cleanup of mounts left to do.

CODE: SELECT ALL

						root@mint:/ # exit
root@mint:~ #for i in dev/pts dev sys proc; do umount /mnt/$i; done
root@mint:~ # exit
mint@mint:~ $ 
(Remember - if you changed /mnt in the previous commands, remember to do so here as well)

Then you should be ready to install grub to your /dev/sda (fill in the proper device for your system)
this should match whatever you have as your boot drive. It could be /dev/sdb or /dev/sdc etc...

CODE: SELECT ALL

						mint@mint:~ $ sudo grub-install /dev/sda
Reboot and it "should work"

Hope this helps!
Last edited by bennabiy on Sun Apr 23, 2017 11:56 am, edited 1 time in total.
 
i8igmac
Level 1
Level 1
Posts: 10
Joined: Fri Mar 02, 2012 5:50 pm

Re: Install Linux Mint 17 to mdadm RAID array

Post by i8igmac » Thu Dec 31, 2015 1:29 am

i have been searching for threads related to 'raid linux mint install'... trying to understand this process...

so, im trying to setup raid0. maybe i misunderstand the partitioning structure. 

i have 2 identical ssd's, both partitioned in the same way... 

CODE: SELECT ALL

						Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d7015

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048       53247       25600   83  Linux
/dev/sda2           53248   234441647   117194200   83  Linux

CODE: SELECT ALL

						Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00082905

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048       53247       25600   83  Linux
/dev/sdb2           53248   234441647   117194200   83  Linux

CODE: SELECT ALL

						sudo mdadm --create /dev/md1 --verbose --level=0 --raid-devices=2 /dev/sda1 /dev/sdb1
sudo mdadm --create /dev/md2 --verbose --level=0 --raid-devices=2 /dev/sda2 /dev/sdb2
so, now i have 2 raid arrays, md1 and md2... i dont plan on using linux-swap as my understanding is this will preserve the life of the ssd's... 

is this how a person would start off the install? it would really help to see instructions for setting up the partitions... or is this not the way it should be done?
User avatar
coffee412
Level 5
Level 5
Posts: 855
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact: 

Re: Install Linux Mint 17 to mdadm RAID array

Post by coffee412 » Thu Dec 31, 2015 6:52 am

Have you seen this?

http://raider.sourceforge.net/

I used it to convert my single install to a Raid1 without a hitch.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics 
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
 
i8igmac
Level 1
Level 1
Posts: 10
Joined: Fri Mar 02, 2012 5:50 pm

Re: Install Linux Mint 17 to mdadm RAID array

Post by i8igmac » Thu Dec 31, 2015 11:25 am

raider does look useful, but i dont see the option for raid0.
User avatar
coffee412
Level 5
Level 5
Posts: 855
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact: 

Re: Install Linux Mint 17 to mdadm RAID array

Post by coffee412 » Thu Dec 31, 2015 12:31 pm

i8igmac wrote:raider does look useful, but i dont see the option for raid0.
Oops. I guess it doesnt do raid0. 

sorry.
Ryzen x1800 Asus Prime x370-Pro 32 gigs Ram RX480 graphics 
IceWarp 12.0.3 * Mint 18.3 * RAID 1/5 * OpenVPN * Linux since kernel 2.0.36
************* Get Your Linux on! ***************
 
Laurent85
Level 15
Level 15
Posts: 5727
Joined: Tue May 26, 2015 10:11 am

Re: Install Linux Mint 17 to