Install Linux Mint 17 to mdadm RAID array

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read how to get help
Arp
Level 3
Level 3
Posts: 115
Joined: Mon Mar 11, 2013 8:41 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by Arp » Sun Nov 06, 2016 9:11 am

Hi,

Is the first post in this thread still valid for mint 18? Because I installed to a usb drive, and this is too slow for my taste, but I only have a raid 5 in the computer, so the only option would be to install to the raid (how can the raid be assembled before the system is booted?) or to somehow have just enough on the usb stick to assemble the array from there and continue booting from the raid.

bennabiy
Level 1
Level 1
Posts: 9
Joined: Thu Aug 01, 2013 11:02 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by bennabiy » Sun Apr 23, 2017 11:08 am

I have not personally set up Linux Mint 18 in this fashion, but I would assume it will still work with some minor adjusting.

I also would like to add the following for clarity (I will edit the original post as well). Someone PMed me with a request for more info on what a certain set of commands do, so I would like to add my response to help others... Originally this was a post to help me remember the steps for the future and assumes certain understanding of the commands to know what to copy / paste and what is generic information.

Response below:

Here is a breakdown of the commands:
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 folders 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


Let me know if you need more clarity.

rippy
Level 1
Level 1
Posts: 2
Joined: Fri Dec 08, 2017 12:55 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by rippy » Fri Dec 08, 2017 1:10 am

I just wanted to say what a great resource this thread has been.

I've just successfully installed 18.3 on a pair of RAID0 nvme m.2 960 EVOs using GPT and EFI on a new Threadripper system I've built. Looking forward to a ridiculously fast mint system very shortly once I transfer from my current machine. :D

Thanks all for the great info posted here!

Note, I'm hoping that the keywords above might help others that just discovered that nvme raid on x399 is fakeraid find this post on google. Not necro-posting without reason (I hope).

User avatar
coffee412
Level 5
Level 5
Posts: 964
Joined: Mon Nov 12, 2012 7:38 pm
Location: Indiana, USA
Contact:

Re: Install Linux Mint 17 to mdadm RAID array

Post by coffee412 » Fri Dec 08, 2017 4:53 am

rippy wrote:I just wanted to say what a great resource this thread has been.

I've just successfully installed 18.3 on a pair of RAID0 nvme m.2 960 EVOs using GPT and EFI on a new Threadripper system I've built. Looking forward to a ridiculously fast mint system very shortly once I transfer from my current machine. :D

Thanks all for the great info posted here!

Note, I'm hoping that the keywords above might help others that just discovered that nvme raid on x399 is fakeraid find this post on google. Not necro-posting without reason (I hope).
So, How do you like the Threadripper???

Like to hear you impression of it. I couldnt afford it at the time and it was not out when I upgraded. I have the x1800 which is sweet!
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! ***************

rippy
Level 1
Level 1
Posts: 2
Joined: Fri Dec 08, 2017 12:55 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by rippy » Mon Dec 11, 2017 3:34 am

coffee412 wrote:So, How do you like the Threadripper???

Like to hear you impression of it. I couldnt afford it at the time and it was not out when I upgraded. I have the x1800 which is sweet!
Pretty good so far. Everything working well as far as I can tell. I'm running an all core 4.0 GHz overclock (1920x so 12 core 24 thread) with 32GB of ram @ 3200MHZ. Along with the NVME RAID, this thing is FAST. :wink:

Still need to do stability testing with this OC and see if I can go a bit higher, but I did some gaming just now and no issue at all. Not a super CPU intensive task, but still.

No issue so far in mint 18.3 with the hardware. Using Aorus Gamaing 7 board and everything working out of the box. Only GPU and microcode showed up in drivers. WiFi, Bluetooth, ethernet, USB, etc. all working perfectly.

Needless to say, I'm pretty happy with my choice. :D

nevl
Level 1
Level 1
Posts: 21
Joined: Mon Mar 06, 2017 12:44 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by nevl » Thu Jan 18, 2018 3:53 am

Hii,.. wanna ask something, I've been searching how to install linux mint on raid for almost 2 weeks,.. :roll:
I wanna install LM18.3 to HP Proliant MicroServer Gen8.
actually this post is the best tutorial for installing LM to mdadm raid, but there's no explanation about partition or example of the partitions. I had read Laurent85's explanation to i8igmac (how has success installing and booting), but my installation is always fail to boot.
in my case, I had 4 HD and wanna create raid 10, using legacy BIOS.
my partition:
sda 500GB
-sda1 1GB bios boot
-sda2 497GB raid
-sda3 2GB swap

sdb 500GB
-sdb1 498GB raid
-sdb2 2GB swap

sdc 500GB
-sdc1 498GB raid
-sdc2 2 swap

sdd 500GB
-sdd1 498GB raid
-sdd2 2 swap

/dev/md0 +- 989GB (ext4)

I used cfdisk for make the partitions. and on installer I'm using manual disk format, make the /dev/md0 as / and format only swap partitions.

I already follow this step from Laurent85's:
sudo mount /dev/md0 /mnt
sudo mount -o bind /dev /mnt/dev
sudo chroot /mnt mount /proc
sudo chroot /mnt mount /sys
sudo chroot /mnt mount /dev/pts
sudo cp -a /run/resolvconf/resolv.conf /mnt/run/resolvconf/resolv.conf
sudo su
chroot /mnt
apt update
apt install mdadm
apt install grub-pc
grub-install /dev/sda -> on my installaton I tried grub-install /dev/sda1 and error
grub-install /dev/sdb
sync
exit
exit
I fail while trying to chroot /mnt mount /proc (same fail on /sys and /dev/pts), the error like "there's no /proc on /etc/fstab" (I forgot the full error)
and get error too on intalling grub.

anyone can help me, and sorry for my bad english..
NevL

User avatar
catweazel
Level 19
Level 19
Posts: 9205
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Install Linux Mint 17 to mdadm RAID array

Post by catweazel » Thu Jan 18, 2018 4:04 am

nevl wrote:anyone can help me
Try these instructions: viewtopic.php?t=127676#p695514

It's from 2013 but I reviewed it and it should still apply. If you have issues, start a new thread.
¡uʍop ǝpısdn sı buıɥʇʎɹǝʌǝ os ɐıןɐɹʇsnɐ ɯoɹɟ ɯ,ı

Laurent85
Level 16
Level 16
Posts: 6070
Joined: Tue May 26, 2015 10:11 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by Laurent85 » Thu Jan 18, 2018 4:43 am

nevl wrote: I already follow this step from Laurent85's:
sudo mount /dev/md0 /mnt
sudo mount -o bind /dev /mnt/dev
sudo chroot /mnt mount /proc
sudo chroot /mnt mount /sys
sudo chroot /mnt mount /dev/pts
sudo cp -a /run/resolvconf/resolv.conf /mnt/run/resolvconf/resolv.conf
sudo su
chroot /mnt
apt update
apt install mdadm
apt install grub-pc
grub-install /dev/sda -> on my installaton I tried grub-install /dev/sda1 and error
grub-install /dev/sdb
sync
exit
exit
I fail while trying to chroot /mnt mount /proc (same fail on /sys and /dev/pts), the error like "there's no /proc on /etc/fstab" (I forgot the full error)
and get error too on intalling grub.
Those instructions were for LM 17.x. On LM 18.x change instructions as follow:

Code: Select all

sudo mount /dev/md0 /mnt
sudo mount -o bind /dev /mnt/dev
sudo chroot /mnt mount -t proc proc /proc
sudo chroot /mnt mount -t sysfs sysfs /sys
sudo chroot /mnt mount -t devpts devpts /dev/pts
sudo mount -o bind /run/resolvconf /mnt/run/resolvconf
sudo su
chroot /mnt
apt update
apt install mdadm
apt install grub-pc
grub-install /dev/sda
grub-install /dev/sdb
sync
exit
exit
grub-install /dev/sda -> on my installaton I tried grub-install /dev/sda1 and error
Install grub in the MBR of sda, not in sda1. Grub will on its own use sda1 to store its core.img when free space missing. Your 1GB sda1 partition is way too large, only a few MB is required, say 2-4MB.
Image

nevl
Level 1
Level 1
Posts: 21
Joined: Mon Mar 06, 2017 12:44 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by nevl » Sat Jan 20, 2018 8:22 am

Hi Laurent85, thanks for your reply.
I just wanna make sure that my partitions is correct? I had 4 drives, must I create 4 boot bios (or other partitions type) on each drive witch each 4MB and grub-install on 4 drives ?
NevL

Laurent85
Level 16
Level 16
Posts: 6070
Joined: Tue May 26, 2015 10:11 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by Laurent85 » Sat Jan 20, 2018 5:09 pm

nevl wrote:Hi Laurent85, thanks for your reply.
I just wanna make sure that my partitions is correct? I had 4 drives, must I create 4 boot bios (or other partitions type) on each drive witch each 4MB and grub-install on 4 drives ?
You can. Installing grub in the mbr of all drives you wiil be able to boot wathever the drive failing.
Image

BlackBox
Level 1
Level 1
Posts: 2
Joined: Sat Jan 20, 2018 4:09 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by BlackBox » Mon Jan 22, 2018 4:54 am

Hi all.
How can I use this guide to install LMDE2 to mdadm RAID1 array?
I don't have ubiquity, so I can't launch it with option -b.
The LMDE2 installer doesn't let me choose RAID install option.

Laurent85
Level 16
Level 16
Posts: 6070
Joined: Tue May 26, 2015 10:11 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by Laurent85 » Mon Jan 22, 2018 7:57 am

It's possible to install in expert mode. Provide the partitioning of your drives you want to use.
Image

BlackBox
Level 1
Level 1
Posts: 2
Joined: Sat Jan 20, 2018 4:09 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by BlackBox » Mon Jan 22, 2018 10:53 am

I will create new topic in LMDE 2 Forums -> Installation & Boot.
Last edited by BlackBox on Tue Jan 23, 2018 5:09 am, edited 1 time in total.

Laurent85
Level 16
Level 16
Posts: 6070
Joined: Tue May 26, 2015 10:11 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by Laurent85 » Mon Jan 22, 2018 11:46 am

Your request deserves its own thread, can you please delete your previous post and copy paste your message into a new topic, thanks.
Image

nevl
Level 1
Level 1
Posts: 21
Joined: Mon Mar 06, 2017 12:44 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by nevl » Tue Jan 23, 2018 10:11 pm

Laurent85 wrote:
nevl wrote:Hi Laurent85, thanks for your reply.
I just wanna make sure that my partitions is correct? I had 4 drives, must I create 4 boot bios (or other partitions type) on each drive witch each 4MB and grub-install on 4 drives ?
You can. Installing grub in the mbr of all drives you wiil be able to boot wathever the drive failing.
Dear Laurent85, thanks for your guidance, now I can boot mint on Raid 10 HD. and yes iam installing grub in the mbr of all drives..
thank you very very much Laurent85.
NevL

nevl
Level 1
Level 1
Posts: 21
Joined: Mon Mar 06, 2017 12:44 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by nevl » Mon Feb 19, 2018 4:18 am

Hi Laurent85,
I got succeed booting on last configurating LM18 on RAID that you had guided. but today I got my UPS corrupt and while I turn on the LM I got black or blank screen. I used that LM for server monitoring :roll: .
how should I do, to recovery the LM. LM has 4 HD and used RAID 10, all drives already grub installed.


btw, sorry for this question.
NevL

nevl
Level 1
Level 1
Posts: 21
Joined: Mon Mar 06, 2017 12:44 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by nevl » Mon Feb 19, 2018 4:56 am

nevl wrote:
Mon Feb 19, 2018 4:18 am
Hi Laurent85,
I got succeed booting on last configurating LM18 on RAID that you had guided. but today I got my UPS corrupt and while I turn on the LM I got black or blank screen. I used that LM for server monitoring :roll: .
how should I do, to recovery the LM. LM has 4 HD and used RAID 10, all drives already grub installed.


btw, sorry for this question.
Hi Laurent85,
my LM succeed booting right now, I suspect that one HD broken. I'm trying detach off all drives one by one. while I detach drive 4, the LM want display the desktop.
and now my question is how to replace it :D .
NevL

SIM_142
Level 1
Level 1
Posts: 13
Joined: Mon Dec 31, 2018 9:02 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by SIM_142 » Mon Dec 31, 2018 9:10 am

1) Create the partitions on /dev/sda
I chose a very simple approach here with two partitions. The main partition almost fills up the whole disk, only leaving 4GB left for the second partition (swap).
mint ~ # sfdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: dos
Disk identifier: 0x4f1db047

Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 968384511 968382464 461.8G 83 Linux
/dev/sda2 968384512 976773119 8388608 4G 82 Linux swap / Solaris
2) Copy the partition table from SDA to SDB
The following command dumps (-d) the partition table from /dev/sda and inserts it into /dev/sdb:
mint ~ # sfdisk -d /dev/sda | sfdisk /dev/sdb
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: dos
Disk identifier: 0x16a9c579

Old situation:

>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x4f1db047.
Created a new partition 1 of type 'Linux' and of size 461.8 GiB.
/dev/sdb2: Created a new partition 2 of type 'Linux swap / Solaris' and of size 4 GiB.
/dev/sdb3:
New situation:

Device Boot Start End Sectors Size Id Type
/dev/sdb1 * 2048 968384511 968382464 461.8G 83 Linux
/dev/sdb2 968384512 976773119 8388608 4G 82 Linux swap / Solaris

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.
3) Create the raid devices
First I created /dev/md0, which will hold the Linux Mint installation:
mint ~ # mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to contain an ext2fs file system
size=484191232K mtime=Fri May 25 15:31:47 2018
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
mdadm: /dev/sdb1 appears to be part of a raid array:
level=raid1 devices=2 ctime=Fri May 25 12:50:09 2018
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
Then create /dev/md1 which will be used as swap partition:
mint ~ # mdadm --create /dev/md1 --level=1 --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
mdadm: /dev/sdb2 appears to be part of a raid array:
level=raid1 devices=2 ctime=Fri May 25 12:50:23 2018
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md1 started.
4) Wait for the sync to be completed
mint ~ # cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb2[1] sda2[0]
4190208 blocks super 1.2 [2/2] [UU]
resync=DELAYED

md0 : active raid1 sdb1[1] sda1[0]
484060160 blocks super 1.2 [2/2] [UU]
[>....................] resync = 0.7% (3421824/484060160) finish=39.7min speed=201283K/sec
bitmap: 4/4 pages [16KB], 65536KB chunk

unused devices:

Yes, patience you must have.
mint ~ # cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sdb2[1] sda2[0]
4190208 blocks super 1.2 [2/2] [UU]

md0 : active raid1 sdb1[1] sda1[0]
484060160 blocks super 1.2 [2/2] [UU]
bitmap: 0/4 pages [0KB], 65536KB chunk

unused devices:

5) Format the raid device /dev/md0
I will be using an ext4 filesystem, so:
mint ~ # mkfs.ext4 /dev/md0
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done
Creating filesystem with 121015040 4k blocks and 30261248 inodes
Filesystem UUID: 8f662d46-4759-4b81-b879-eb60dd643f41
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
6) Launch the installer
But launch it from the command line:
mint ~ # ubiquity -b
7) In the installer...
When the installer asks how about the installation type, select "Something else":

SIM_142
Level 1
Level 1
Posts: 13
Joined: Mon Dec 31, 2018 9:02 am

Re: Install Linux Mint 17 to mdadm RAID array

Post by SIM_142 » Sat Jan 05, 2019 11:38 am

I'm using Mint Cinnamon 18 and after I were given to mounting drives I got those results.

Mint ~ # mount /dev/md127p1 /mnt; mount /dev/sda2 /mnt/boot/efi
mount: unique device /dev/md127p1 does now not exist
mount: mount factor /mnt/boot/efi does no longer exist
mint ~ # for i in /dev /dev/pts /sys /proc; do mount --bind $i /mnt$i; carried out
mount: mount factor /mnt/dev does no longer exist
mount: mount factor /mnt/dev/pts does no longer exist
mount: mount point /mnt/sys does now not exist
mount: mount point /mnt/proc does no longer existA

knystromrok
Level 1
Level 1
Posts: 2
Joined: Thu Feb 28, 2019 1:29 pm

Re: Install Linux Mint 17 to mdadm RAID array

Post by knystromrok » Thu Feb 28, 2019 4:09 pm

Want to: install Mint on HP Desktop quad i7 with two WD 6TB drives to be mirrored or in RAID.
What I did: forced efi install from usb boot, didn't use "Something Else" option. I have turned off boot security, but still have efi install. I turned on RAID in cmos, but that had no effect. (Might be using SATA0 and SATA3, if that matters)
Goal is: setup Media (Movie) box(not server) with Plex installed.
Don't care if I have to reinstall or fix with mdadm etc. If I have to read mdadm article that's fine just point.
My install did not create/mount a /home directory - is that bad?
My idea was to use 1gb for system partition and 5gb for all else and mirror. 2 3tb partions would be fine too if that is good/better. Also, not sure why my kernel is 4.15.0-45. 4.19.x is installed but not used.
What I have:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 5.5T 0 disk
├─sda1 8:1 0 512M 0 part /boot/efi
└─sda2 8:2 0 5.5T 0 part
├─mint--vg-root 253:0 0 5.5T 0 lvm /
└─mint--vg-swap_1 253:1 0 15.9G 0 lvm [SWAP]
sdb 8:16 0 5.5T 0 disk
├─sdb1 8:17 0 512M 0 part
└─sdb2 8:18 0 5.5T 0 part
sr0 11:0 1 1024M 0 rom
System: Host: keith-HP-EliteDesk-800-G1-TWR Kernel: 4.15.0-45-generic x86_64 bits: 64
compiler: gcc v: 7.3.0 Desktop: Cinnamon 4.0.9 wm: muffin dm: LightDM
Distro: Linux Mint 19.1 Tessa base: Ubuntu 18.04 bionic
Machine: Type: Desktop System: Hewlett-Packard product: HP EliteDesk 800 G1 TWR v: N/A
serial: <filter> Chassis: type: 6 serial: <filter>
Mobo: Hewlett-Packard model: 18E4 serial: <filter> UEFI: Hewlett-Packard v: L01 v02.71
date: 05/09/2017
CPU: Topology: Quad Core model: Intel Core i7-4770 bits: 64 type: MT MCP arch: Haswell
rev: 3 L2 cache: 8192 KiB
flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 54271
Speed: 3264 MHz min/max: 800/3900 MHz Core speeds (MHz): 1: 3264 2: 2782 3: 2905
4: 3538 5: 3369 6: 3442 7: 3709 8: 3406

Drives: Local Storage: total: 10.94 TiB used: 6.77 GiB (0.1%)
ID-1: /dev/sda vendor: Western Digital model: WD6003FZBX-00K5WB0 size: 5.46 TiB
speed: 6.0 Gb/s serial: <filter>
ID-2: /dev/sdb vendor: Western Digital model: WD6003FZBX-00K5WB0 size: 5.46 TiB
speed: 6.0 Gb/s serial: <filter>
ID-3: /dev/sdc type: USB vendor: SanDisk model: Ultra size: 28.64 GiB serial: <filter>
RAID: Hardware-1: Intel SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:1f.2
chip ID: 8086.2822
Partition: ID-1: / size: 5.40 TiB used: 6.76 GiB (0.1%) fs: ext4 dev: /dev/dm-0
ID-2: swap-1 size: 15.89 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/dm-1

Locked

Return to “Installation & Boot”