Mint Install Notes

From Labrats.us
Revision as of 15:34, 13 December 2018 by Sfiggins (talk | contribs) (Created page with "== Background Information == I wanted to run a desktop with two drives in RAID 1 (Mirroring) mode for data protection. Red Hat and CentOS support the hardware RAID controlle...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Background Information

I wanted to run a desktop with two drives in RAID 1 (Mirroring) mode for data protection. Red Hat and CentOS support the hardware RAID controller, but Ubuntu, Mint and Debian Workstations do not, and do not natively support the software RAID. The instructions below are how I overcame the Workstation limitation.

Hardware Configuration

Ensure that you start with 2 drives of equal size, and that they are not configured for hardware RAID.

Boot from Mint install disc in "Live" mode

There are many steps before you get to run the installation program, so make sure that you are running in the "Live" or "try is out" mode.

Start terminal window

Become root

mint@mint ~ $ sudo su -

mint ~ # 

Install mdadm package

mint ~ # apt-get install mdadm

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  default-mta mail-transport-agent
The following NEW packages will be installed:
  mdadm
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 520 kB of archives.
After this operation, 1,190 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ saucy/main mdadm amd64 3.2.5-5ubuntu2 [520 kB]
Fetched 520 kB in 1s (378 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mdadm.
(Reading database ... 162316 files and directories currently installed.)
Unpacking mdadm (from .../mdadm_3.2.5-5ubuntu2_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 38 changed doc-base files, 6 added doc-base files...
Registering documents with scrollkeeper...
Setting up mdadm (3.2.5-5ubuntu2) ...
Generating mdadm.conf... done.
 Removing any system startup links for /etc/init.d/mdadm-raid ...
update-initramfs is disabled since running on read-only media
 * Starting MD monitoring service mdadm --monitor                        [ OK ] 
Processing triggers for ureadahead ...

For existing RAID Installations

Scan for existing RAID setup

mint ~ # mdadm --assemble --scan

mdadm: /dev/md/0 has been started with 2 drives.
mdadm: /dev/md/1 has been started with 2 drives.

Check the detail on the assembled RAID devices

mint ~ # mdadm --detail /dev/md0

/dev/md0:
        Version : 1.2
  Creation Time : Mon Apr 21 11:46:38 2014
     Raid Level : raid1
     Array Size : 127360 (124.40 MiB 130.42 MB)
  Used Dev Size : 127360 (124.40 MiB 130.42 MB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Tue Apr 22 13:55:33 2014
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : mint:0  (local to host mint)
           UUID : 27f315b1:3e277fef:1a307b24:ea4df3eb
         Events : 19

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

mint ~ # mdadm --detail /dev/md1

/dev/md1:
        Version : 1.2
  Creation Time : Mon Apr 21 11:46:17 2014
     Raid Level : raid1
     Array Size : 976502848 (931.27 GiB 999.94 GB)
  Used Dev Size : 976502848 (931.27 GiB 999.94 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Tue Apr 22 13:53:14 2014
          State : clean 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : mint:1  (local to host mint)
           UUID : 177d7ce2:924e598c:dc94b11a:58bc19c7
         Events : 26

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2

Check for lvm configuration

mint ~ # lvdisplay 

  --- Logical volume ---
  LV Path                /dev/vg1/lv2
  LV Name                lv2
  VG Name                vg1
  LV UUID                eIkzAc-CE77-jRyT-KFAu-hez5-ebcz-1FFJ0M
  LV Write Access        read/write
  LV Creation host, time mint, 2014-04-21 13:27:02 -0600
  LV Status              available
  # open                 2
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
   
  --- Logical volume ---
  LV Path                /dev/vg1/lv1
  LV Name                lv1
  VG Name                vg1
  LV UUID                BOKjom-ftnd-Vj7P-BvX4-uhKw-0Fm1-u6OVNC
  LV Write Access        read/write
  LV Creation host, time mint, 2014-04-21 13:28:43 -0600
  LV Status              available
  # open                 1
  LV Size                927.00 GiB
  Current LE             237312
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

For new Mint Installations

Zero Drives

Zero the first drive to ensure that the drive is empty.

mint ~ # dd if=/dev/zero of=/dev/sda bs=1048576

dd: writing ‘/dev/sda’: No space left on device
953870+0 records in
953869+0 records out
1000204886016 bytes (1.0 TB) copied, 6393.41 s, 156 MB/s

Also zero the second drive to ensure that it is empty.

mint ~ # dd if=/dev/zero of=/dev/sdb bs=1048576

dd: writing ‘/dev/sdb’: No space left on device
953870+0 records in
953869+0 records out
1000204886016 bytes (1.0 TB) copied, 5814.41 s, 172 MB/s

Partition Drives

*** NOTE: You will want to increase the /boot partition from 128M to 256M. 128M will be too small to have more than one kernel installed, and this will cause you grief.

Option 1 fdisk

mint ~ # fdisk /dev/sda

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted. 

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-1953525167, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1953525167, default 1953525167): +128M

Command (m for help): a
Partition number (1-4): 1

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 
Using default value 2
First sector (264192-1953525167, default 264192): 
Using default value 264192
Last sector, +sectors or +size{K,M,G} (264192-1953525167, default 1953525167): 
Using default value 1953525167

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000780e2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      264191      131072   fd  Linux raid autodetect
/dev/sda2          264192  1953525167   976630488   fd  Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
mint ~ # fdisk /dev/sdb

The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-1953525167, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-1953525167, default 1953525167): +128M

Command (m for help): a
Partition number (1-4): 1

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): 
Using default response p
Partition number (1-4, default 2): 
Using default value 2
First sector (264192-1953525167, default 264192): 
Using default value 264192
Last sector, +sectors or +size{K,M,G} (264192-1953525167, default 1953525167): 
Using default value 1953525167

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): fd
Changed system type of partition 2 to fd (Linux raid autodetect)

Command (m for help): p

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000b76e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      264191      131072   fd  Linux raid autodetect
/dev/sdb2          264192  1953525167   976630488   fd  Linux raid autodetect

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Option 2 cfdisk

Partition the first drive

mint ~ # cfdisk /dev/sda

This prings up the menu-driven partitioning program. You will set up 2 partitions, set the type to FD, set the first partition to be bootable, and then write the partition table. The partitions should look similar to that below.

                           cfdisk (util-linux 2.20.1)

                              Disk Drive: /dev/sda
                      Size: 1000204886016 bytes, 1000.2 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 121601

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sda1        Boot        Primary   Linux raid autodetect              131.61 
    sda2                    Primary   Linux raid autodetect          1000073.29*










     [ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print   ]
     [   Quit   ]  [   Type   ]  [  Units   ]  [  Write   ]
                               
            Write partition table to disk (this might destroy data)

When the program quits, you will get a response that the partition table has changed.

Disk has been changed.

WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.

Set up the partition table for the second drive.

mint ~ # cfdisk /dev/sdb

This bring us the same menu-based application, and you do the same to this drive.

                           cfdisk (util-linux 2.20.1)

                              Disk Drive: /dev/sdb
                      Size: 1000204886016 bytes, 1000.2 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 121601

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sdb1        Boot        Primary   Linux raid autodetect              131.61 
    sdb2                    Primary   Linux raid autodetect          1000073.29*










     [ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print   ]
     [   Quit   ]  [   Type   ]  [  Units   ]  [  Write   ]

            Write partition table to disk (this might destroy data)


Confirtmation that the partition table wrote to the disk.

Disk has been changed.

WARNING: If you have created or modified any
DOS 6.x partitions, please see the cfdisk manual
page for additional information.

Validate The Partition Tables

mint ~ # fdisk -l /dev/sda

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      257039      128488+  fd  Linux raid autodetect
Partition 1 does not start on physical sector boundary.
/dev/sda2          257040  1953525167   976634064   fd  Linux raid autodetect
mint ~ # fdisk -l /dev/sdb

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63      257039      128488+  fd  Linux raid autodetect
Partition 1 does not start on physical sector boundary.
/dev/sdb2          257040  1953525167   976634064   fd  Linux raid autodetect
mint ~ # cfdisk -P s /dev/sda

Partition Table for /dev/sda

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary           0      257039     63      257040 Linux raid auto (FD) Boot
 2 Primary      257040  1953525167*     0  1953268128*Linux raid auto (FD) None
mint ~ # cfdisk -P s /dev/sdb

Partition Table for /dev/sdb

               First       Last
 # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag
-- ------- ----------- ----------- ------ ----------- -------------------- ----
 1 Primary           0      257039     63      257040 Linux raid auto (FD) Boot
 2 Primary      257040  1953525167*     0  1953268128*Linux raid auto (FD) None

Create RAID volumes

We will delay creating the first RAID array that will be used to house the /boot partition as the Mint installer has issues.

IGNORE THE NEXT COMMAND

mint ~ # mdadm --create /dev/md0 --metadata=0.90 --level=raid1 --raid-devices=2 /dev/sda1 /dev/sdb1

mdadm: array /dev/md0 started.

Create the second drive array. This will house our LVM.

mint ~ # mdadm --create /dev/md1 --level=raid1 --raid-devices=2 /dev/sda2 /dev/sdb2

mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
Continue creating array? yes
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md1 started.

Validate the RAID Array.

mint ~ # mdadm --detail /dev/md1

/dev/md1:
        Version : 1.2
  Creation Time : Tue Apr 22 23:12:20 2014
     Raid Level : raid1
     Array Size : 976502848 (931.27 GiB 999.94 GB)
  Used Dev Size : 976502848 (931.27 GiB 999.94 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Tue Apr 22 23:12:20 2014
          State : clean, resyncing 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

  Resync Status : 1% complete

           Name : mint:1  (local to host mint)
           UUID : 6046228f:32784aeb:8a3c6dc6:0ce79271
         Events : 0

    Number   Major   Minor   RaidDevice State
       0       8        2        0      active sync   /dev/sda2
       1       8       18        1      active sync   /dev/sdb2

Create lvm volumes

Create the physical lvm volume.

mint ~ # pvcreate /dev/md1
  Physical volume "/dev/md1" successfully created

Validate the physical lvm volume.

mint ~ # pvdisplay 

  "/dev/md1" is a new physical volume of "931.27 GiB"
  --- NEW Physical volume ---
  PV Name               /dev/md1
  VG Name               
  PV Size               931.27 GiB
  Allocatable           NO
  PE Size               0   
  Total PE              0
  Free PE               0
  Allocated PE          0
  PV UUID               I7upUe-X1ry-zms2-AlFZ-TVCg-yJcI-CApP5M

Create the volume group.

mint ~ # vgcreate vg1 /dev/md1
  Volume group "vg1" successfully created

Validate the volume group.

mint ~ # vgdisplay 
  --- Volume group ---
  VG Name               vg1
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               931.26 GiB
  PE Size               4.00 MiB
  Total PE              238403
  Alloc PE / Size       0 / 0   
  Free  PE / Size       238403 / 931.26 GiB
  VG UUID               sgvBNE-x48c-QeXm-dV8E-BHAr-Eg9l-aajczw

Create the first logical volume. Leave enough room for your swap volume.

mint ~ # lvcreate -L 927G vg1 -n lv1

  Logical volume "lv1" created

Create the swap volume.

mint ~ # lvcreate -L 4G vg1 -n lv2

  Logical volume "lv2" created

Validate the new lvm volumes.

mint ~ # lvdisplay

  --- Logical volume ---
  LV Path                /dev/vg1/lv2
  LV Name                lv2
  VG Name                vg1
  LV UUID                1UuUtB-pqxh-NBHl-V2H7-0K6z-5sA6-OeYSl9
  LV Write Access        read/write
  LV Creation host, time mint, 2014-04-22 23:23:55 +0000
  LV Status              available
  # open                 0
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0
   
  --- Logical volume ---
  LV Path                /dev/vg1/lv1
  LV Name                lv1
  VG Name                vg1
  LV UUID                MnhRh8-zNAU-G3gl-X4g2-xKsJ-dyfj-7ZH7Ii
  LV Write Access        read/write
  LV Creation host, time mint, 2014-04-22 23:24:21 +0000
  LV Status              available
  # open                 0
  LV Size                927.00 GiB
  Current LE             237312
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

Format the Volumes

Format the TEMPORARY "/boot" volume.

mint ~ # mkfs.ext4 /dev/sda1

mke2fs 1.42.8 (20-Jun-2013)
/dev/sda1 alignment is offset by 512 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=4 blocks, Stripe width=4 blocks
32128 inodes, 128384 blocks
6419 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
16 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks:  
	8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

Format the "/" volume.

mint ~ # mkfs.ext4 /dev/vg1/lv1

mke2fs 1.42.8 (20-Jun-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
60751872 inodes, 243007488 blocks
12150374 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
7416 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done     

Make the swap volume.

mint ~ # mkswap  /dev/vg1/lv2

mkswap: /dev/vg1/lv2: warning: don't erase bootbits sectors
        on whole disk. Use -f to force.
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=20d4a4a2-f385-4de3-bb42-039153d92c21

Run installer

When asked for partition information, choose "do something else" option, and set up the partition tables there. Use /dev/vg1/lv1 for the "/" volume, /dev/sda1 as the "/boot" volume, and /dev/vg1/lv2 as the "swap" volume. Do not use /dev/sdb1 for anything.

Continue the setup, filling out the optional dialogues.

When installation finishes, click "continue testing".

Create the /dev/md0 RAID for /boot

Mount the newly created system to /mnt

mint ~ # mount /dev/vg1/lv1 /mnt
mint ~ # mount /dev/sda1 /mnt/boot

Copy the /mnt/boot directory to /mnt/var/tmp/boot.sda1

mint ~ # cp -pr /mnt/boot /mnt/var/tmp/boot.sda1

Unmount /dev/sda1

mint ~ # umount /mnt/boot

Destroy the /dev/sda1 filesystem

mint ~ # shred -v -n 1 /dev/sda1

shred: /dev/sda1: pass 1/1 (random)...

Create the /dev/md0 RAID that will house /boot.

mint ~ # mdadm --create /dev/md0 --metadata=1.0 --level=raid1 --raid-devices=2 /dev/sda1 /dev/sdb1

mdadm: array /dev/md0 started.

Validate the RAID Array.

mint ~ # mdadm --detail /dev/md0

/dev/md0:
        Version : 1.0
  Creation Time : Wed Apr 23 14:55:58 2014
     Raid Level : raid1
     Array Size : 128448 (125.46 MiB 131.53 MB)
  Used Dev Size : 128448 (125.46 MiB 131.53 MB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Wed Apr 23 14:55:58 2014
          State : clean, resyncing (DELAYED) 
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : mint:0  (local to host mint)
           UUID : cd97e632:b0d6a849:03f97bba:68c49564
         Events : 0

    Number   Major   Minor   RaidDevice State
       0       8        1        0      active sync   /dev/sda1
       1       8       17        1      active sync   /dev/sdb1

Create new filesystem on /dev/md0

mint ~ # mkfs.ext4 /dev/md0

mke2fs 1.42.8 (20-Jun-2013)
/dev/md0 alignment is offset by 512 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=4 blocks, Stripe width=4 blocks
32128 inodes, 128448 blocks
6422 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
16 block groups
8192 blocks per group, 8192 fragments per group
2008 inodes per group
Superblock backups stored on blocks: 
	8193, 24577, 40961, 57345, 73729

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done 

Mount new /boot partition

mint ~ # mount /dev/md0 /mnt/boot

Copy /mnt/var/tmp/boot.sda1 /mnt/boot

mint ~ # cp -pr /mnt/var/tmp/boot.sda1/* /mnt/boot/

Copy important bit over to the destination

mint / # mount -o bind /dev /mnt/dev/

mint / # mount -o bind /dev/pts /mnt/dev/pts

mint / # mount -o bind /proc /mnt/proc

mint / # mount -o bind /sys /mnt/sys

mint / # cp /etc/resolv.conf /mnt/etc/

CHROOT into the new installation to install mdadm and grub

CHROOT

Execure the chroot command

mint / # chroot /mnt

Install mdadm in the destination system

mint grub # apt-get install mdadm

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Recommended packages:
  default-mta mail-transport-agent
The following NEW packages will be installed:
  mdadm
0 upgraded, 1 newly installed, 0 to remove and 265 not upgraded.
Need to get 520 kB of archives.
After this operation, 1,190 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ saucy/main mdadm amd64 3.2.5-5ubuntu2 [520 kB]
Fetched 520 kB in 6s (81.6 KB/s)
Preconfiguring packages ...
Selecting previously unselected package mdadm.
(Reading database ... 164540 files and directories currently installed.)
Unpacking mdadm (from .../mdadm_3.2.5-5ubuntu2_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 6 added doc-base files...
Registering documents with scrollkeeper...
Setting up mdadm (3.2.5-5ubuntu2) ...
Generating mdadm.conf... done.
 Removing any system startup links for /etc/init.d/mdadm-raid ...
update-initramfs: deferring update (trigger activated)
 * Starting MD monitoring service mdadm --monitor                          [ OK ] 
Processing triggers for ureadahead ...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.11.0-12-generic
Warning: No support for locale: en_US.utf8

mdadm installation may fail, however you may be able to manually install it.

mint / # cd /root/

mint ~ # wget http://launchpadlibrarian.net/135397377/mdadm_3.2.5-5ubuntu2_amd64.deb

--2014-04-22 19:12:33--  http://launchpadlibrarian.net/135397377/mdadm_3.2.5-5ubuntu2_amd64.deb
Resolving launchpadlibrarian.net (launchpadlibrarian.net)... 91.189.89.229, 91.189.89.228
Connecting to launchpadlibrarian.net (launchpadlibrarian.net)|91.189.89.229|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 519554 (507K) [application/x-debian-package]
Saving to: ‘mdadm_3.2.5-5ubuntu2_amd64.deb’

100%[======================================>] 519,554      462KB/s   in 1.1s   

2014-04-22 19:12:40 (462 KB/s) - ‘mdadm_3.2.5-5ubuntu2_amd64.deb’ saved [519554/519554]

mint / # dpkg -i mdadm_3.2.5-5ubuntu2_amd64.deb

Selecting previously unselected package mdadm.
(Reading database ... 162748 files and directories currently installed.)
Unpacking mdadm (from mdadm_3.2.5-5ubuntu2_amd64.deb) ...
Setting up mdadm (3.2.5-5ubuntu2) ...
Generating mdadm.conf... done.
 Removing any system startup links for /etc/init.d/mdadm-raid ...
update-initramfs: deferring update (trigger activated)
 * Starting MD monitoring service mdadm --monitor                        [ OK ] 
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Processing triggers for doc-base ...
Processing 6 added doc-base files...
Registering documents with scrollkeeper...
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.11.0-12-generic
Warning: No support for locale: en_US.utf8

Validate /etc/mdadm/mdadmn.conf file

mint ~ # /usr/share/mdadm/mkconf > /tmp/mdadm.conf
mint ~ # diff /tmp/mdadm.conf /etc/mdadm/mdadm.conf

21d20
< ARRAY /dev/md0 UUID=cd97e632:b0d6a849:03f97bba:68c49564
23a23,24
> # This file was auto-generated on Tue, 22 Apr 2014 19:13:40 -0600
> # by mkconf $Id$

Make changes, as needed.

Run grub-mkconfig

mint ~ # mv /boot/grub/grub.{cfg,bak}
mint ~ # /usr/sbin/grub-mkconfig > /boot/grub/grub.cfg

Install Grub

Install on /dev/sda

mint ~ # grub-install.real /dev/sda

Installation finished. No error reported.

Install on /dev/sdb

mint ~ # grub-install.real /dev/sdb

Installation finished. No error reported.

Update /etc/fstab

You will need to update the /boot directory for the fstab, or you will not mount at boot time. This can be done easily after installation and reboot.