Log in

View Full Version here: : Linux and Raids


AstralTraveller
03-03-2020, 08:34 PM
I have one of those simple questions to which Mr Google refuses to find an answer :ashamed:.

I've had a hard drive failure and I've decided to replace the old drive with a Level 1 RAID. I've read up on mdadm and it all sounds easy peazy - except for one issue :question:. I use Linux Mint but I also have OpenSuSE installed on a separate partition in case Mint falls over. And it has been useful. So, if I have mdadm installed on both OSes can they both access and read/write to the array? I can find plenty of articles on allowing Windows and Linux to access an array but nothing about two flavours of Linux. Since the superblock is common across Linux I think it should work. Does anyone know for sure?

PS The Raid is for data storage, not for booting.

gary
03-03-2020, 10:01 PM
Hi David,

Off hand, I can't think of any reason why it wouldn't work.

For example, use LVM and create a mirrored volume.

You should be able to mount it from either OS.

AstralTraveller
04-03-2020, 01:59 PM
Thanks Gary. I hadn't considered LVM. It looks very powerful and should do the job but at the moment the learning curve looks quite steep. What advantages would it have over 'mdadm'?

gary
04-03-2020, 04:07 PM
Hi David,

Ignoring RAID for one moment and just concentrating on LVM, that in itself
provides the potential advantage of abstracting your storage and having
"virtual partitions" that you can more easily expand or shrink.

These days, personally, I tend not to create many partitions. But for
example if you have ever created say a /tmp partition and later on wished
you had made it bigger or smaller, then LVM makes that a lot easier to do.

If you were just going to use the mirrored disks as one big partition,
then there is no compelling reason I can think of to use LVM.

However, if you do use LVM then the ability to create a mirrored volume
is in-built into the lvcreate command, so it then means you don't have
to use mdadm.

It's been probably three years since I last did it and as you know
things can change rapidly so I would recommend an additional Google
first before going down the LVM path and using it to do the mirroring.
I'd hate to give you a bum steer.

In looking at my own notes, you can't put the /boot partition under
LVM because the GRUB boot loader won't be able to read it.

In notes to myself, I recorded the following :-

In the event of RAID disk mirror failure -
See https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administrati on/mirror_create.html
See also https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administrati on/mirror_repair.html
See also /etc/lvm/lvm.conf
In the event of a RAID failure it will be reported in the syslog and a manual lvconvert --repair will have to be instigated

The above two references would not be the most up to date but might
provide a starting point for your further consideration.

AstralTraveller
04-03-2020, 09:00 PM
Hi Gary,

Thanks for going to all that effort. In the end I stuck with mdadm and now have it working. OpenSuSE also recognises the array, so all good there too.

I mucked around for a while trying to be fancy. Late last night I read how you can create an array from a disk containing data by adding it to an array (of 2) while listing the second drive as 'missing', then add the second disk and then resync. So I copied (slooowly) from the NAS overnight and tried it. Nah. Wasted about 45min getting it wrong before I finally conceded and started from scratch. Data is copying as I type.

OICURMT
06-03-2020, 02:41 PM
mdadm is standarized accross all distros, including the ARM version of Linux.


Example: I had a critical failure of my RAID5 array on an ARMv6 and could not recover it as the boot partition was fried. I loaded a Live CDROM of AV Linux and rebuilt the array with my drives hanging out of my desktop, then performed a backup (12Tb), reloaded the ARM OS on the boot partition, re-installed the drives (2x6Tb, 2x3Tb) into the ARM NAS for a final rebuild. Took me 3 days...


No issues at all.
OIC!

AstralTraveller
08-03-2020, 02:53 PM
Thanks for the verification. It was looking like that was the the case. It makes sense and is very Linux: once someone has built something everyone else just uses that system.

Raid 5 is a bit scary for me but it seems you are a more advanced user. I know how to mount a drive but not how to hang it. :P