Welcome! Log In Create A New Profile

Advanced

[NSA325v2] Moving rootfs from USB to HDD

Posted by l.scorcia 
[NSA325v2] Moving rootfs from USB to HDD
February 27, 2022 06:33AM
Hello,
I have been testing my Debianized NSA325v2 with OpenMediaVault for the last weeks and it works very well. When I set it up, I updated uBoot and hosted the rootfs on an external USB disk while keeping the original mdraid (mirror) on the internal HDDs. Now I would like to move the rootfs from the external USB disk to the internal HDDs.

I am considering two options, a) moving everything inside the raid array and booting from there, or b) resizing the RAID array and hosting rootfs on one of the disks as a different partition.

The first option would probably be the easiest in case of a drive failure as the device would just boot from the healthy disk, am I right? Assuming that uBoot can boot from an mdraid partition of course.
The second option would probably make the booting process easier, but would require some juggling with partitions with all of the additional risks.

It seems like https://forum.doozan.com/read.php?2,27308 is also describing a third option: two different RAID arrays, a small one for rootfs, and a larger one for data on the remaining space. I think this could work too, but it requires erasing both disks and I'd prefer to avoid that.

Do you have any suggestion/guide? Can uBoot start the device from an mdraid array? Can I just copy the content of the current rootfs on the existing raid array?



Edited 1 time(s). Last edit at 02/27/2022 06:34AM by l.scorcia.
Re: [NSA325v2] Moving rootfs from USB to HDD
February 27, 2022 04:52PM
l.scorcia,

> I am considering two options, a) moving everything
> inside the raid array and booting from there, or
> b) resizing the RAID array and hosting rootfs on
> one of the disks as a different partition.
>
> The first option would probably be the easiest in
> case of a drive failure as the device would just
> boot from the healthy disk, am I right? Assuming
> that uBoot can boot from an mdraid partition of
> course.

Not exactly. U-Boot does not understand RAID.

In a typical setup, the kernel files uImage/zImage and uInitrd must be stored in flash. And then after the kernel started, it will have the ability to recognized the RAID array to mount the rootfs.

The --metadata approach used by bobafetthotmail is good too.

I would use the 2nd option if I use RAID. For home use, RAID is way overkilled and brings lots of headache, IMO. For a home network, a good automatic backup procedure with rsync is the simplest to manage.

The rootfs should be separated from the data. And since you already have USB rootfs, you can copy it to the real partition in the 2nd option. And recreate this HDD rootfs at will. The rest of the disk space can be regular partitions, or RAID partitions.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: