[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: md0 + UUIDs for member disks



Hello,

On Fri, Dec 29, 2023 at 06:17:07PM +0100, Felix Natter wrote:
> Andy Smith <andy@strugglers.net> writes:
> > But to be absolutely sure you may wish to totally ignore md0 and
> > its member devices during install as all their data and the
> > metadata on their member devices will still be there after
> > install. You should just be able to see the assembled array in
> > /proc/mdstat, and then mount the filesystem from /etc/fstab.
> > Totally ignoring these devices during install avoids you making
> > a mistake where you alter one of them.
> 
> So /dev/md0 will be automatically assembled when I boot the system
> (cat /proc/mdstat), and I can mount it using UUID?

Yes, if the filesystem on /dev/md0 had a UUID before, it will still
have one when the devices are plugged in to another system (or the
same system after a reinstall).

> I couldn't do this on another system, where the software raid(1) is for
> the root filesystem, though. But as I understood you, in the case of the
> root fs, the above mentioned problem does not occur?

What problem do you refer to?

The only thing that does sometimes happen when moving MD arrays
around is that the name of the md device might need to be changed.

For example, if you have a set of drives that have an md0 on them
and want to move them to a system that already has an md0. The new
system won't assemble that as md0 since it already has an md0 that
has a different UUID. Worse, if you don't do anything and boot such
a system with all the drives installed, it may be arbitrary as to
WHICH ONE gets called md0! It will depend upon which one mdadm
starts assembling first. The other one will be renamed, often to
something weird like md127.

To solve that problem one would list the pairs of array names and
array UUIDs in /etc/mdadm/mdadm.conf. If the root filesystem is on
an md array then the initramfs also has to be updated, to get a copy
of mdadm.conf into that.

But that is a bit of an advanced concern that you probably do not
have. Normally /etc/mdadm/mdadm.conf is basically empty.

Thanks,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting


Reply to: