Linux software RAID1 arrays

User discussion and information resource forum for Image products.
Post Reply
P19
Posts: 68
Joined: Mon Feb 03, 2014 6:38 pm

Linux software RAID1 arrays

Post by P19 »

On this page, "http://www.terabyteunlimited.com/kb/article.php?id=579" , it states that IFL supports Linux software RAID. When I backup a single RAID1 array created with mdadm, consisting of more than one disk, would these disks all be backed up individually, or does it simply see the array as one single device and back up whatever is on it as one block? How would it handle restoring such a file if it belongs on multiple mirrored partitions?

If the RAID1 array holds several logical volumes made with LVM, can they be backed up individually, or would the whole array have to be backed up at one time?
TeraByte Support(TP)
Posts: 305
Joined: Wed Aug 31, 2011 4:22 pm

Re: Linux software RAID1 arrays

Post by TeraByte Support(TP) »

P19 wrote:
> On this page,
> "http://www.terabyteunlimited.com/kb/article.php?id=579" , it
> states that IFL supports Linux software RAID. When I backup a single RAID1
> array created with mdadm, consisting of more than one disk, would these
> disks all be backed up individually, or does it simply see the array as one
> single device and back up whatever is on it as one block?

When you back up a RAID1 array with IFL (meaning the array shows up in IFL as a drive), it will just back it up as it does any other drive. It won't be aware that it's made up of more than one physical drive.

> How would it
> handle restoring such a file if it belongs on multiple mirrored partitions?

On restore, the RAID1 array would have to exist and be visible in IFL before the image can be restored.

>
>
> If the RAID1 array holds several logical volumes made with LVM, can they be
> backed up individually, or would the whole array have to be backed up at
> one time?

In this case, you'd have to back them all up at one time, because LVM volumes that are created on a RAID drive are not detected by IFL.
P19
Posts: 68
Joined: Mon Feb 03, 2014 6:38 pm

Re: Linux software RAID1 arrays

Post by P19 »

Hi, Tom

> "On restore, the RAID1 array would have to exist and be visible in IFL before the image can be restored."

Well great! Iif the file system itself was not hosed, I should be able to use mdadm in IFL to bring it up simply enough, like so:

mdadm --assemble --scan

At least that works for me. At that point I could restore. Then again, if the file system did actually need to be recreated, I could still do it with a one liner in my case:

mdadm --create --verbose --level=1 --metadata=1.2 --raid-devices=2 /dev/md0 /dev/sdb /dev/sdc

I don't think rebooting is required at that point, and I should be good to go. Is that consistent with your understanding of it?
TeraByte Support(TP)
Posts: 305
Joined: Wed Aug 31, 2011 4:22 pm

Re: Linux software RAID1 arrays

Post by TeraByte Support(TP) »

P19 wrote:
> Hi, Tom
>
> > "On restore, the RAID1 array would have to exist and be visible in IFL
> before the image can be restored."
>
> Well great! Iif the file system itself was not hosed, I should be able to use mdadm
> in IFL to bring it up simply enough, like so:
>
> mdadm --assemble --scan

If the RAID array is currently intact, the IFL boot disk will automatically detect it on boot, and it should then be visible in IFL without running any commands. Running 'mdadm --assemble --scan' manually won't hurt anything, but it's not necessary in that case.

The automatic detection happens during boot by running the command 'mdadm --examine --scan >> /etc/mdadm/mdadm.conf' Note that if you run the command 'cat /etc/mdadm/mdadm.conf' right after booting, you should see the RAID array defined in that file, which is the result of running the 'mdadm --examine --scan' command.

>
> At least that works for me. At that point I could restore. Then again, if the file
> system did actually need to be recreated, I could still do it with a one liner in my
> case:
>
> mdadm --create --verbose --level=1 --metadata=1.2 --raid-devices=2 /dev/md0
> /dev/sdb /dev/sdc
>
> I don't think rebooting is required at that point, and I should be good to go. Is
> that consistent with your understanding of it?

That command looks OK, except that I'm pretty sure the "/dev/md0" has to go right after the --create. In any case, the 'mdadm' man page shows it that way, which is the way I usually run it.

Note that if you were booting from that array (which you're not in this case), you would typically want to specify the UUID on the command line also, to keep it the same as the original one (because grub uses it). That can be done with the "--uuid=" command line option, as is covered in the man page.
Post Reply