Andy Smith <a...@strugglers.net> writes:

> Hi Felix,

hello Andy,

thank you for the quick reply!

> On Fri, Dec 29, 2023 at 04:46:10PM +0100, Felix Natter wrote:
>> I have /dev/md0 mounted at /storage which consists of two HDDs.
>> 
>> Now I would like to add an SSD drive for better performance of
>> VMs. Usually, before doing this, I make sure that all of my disks are
>> mounted using UUID and not device names. I do not think this is
>> the case for the two member HDDs of md0 (cat /proc/mdstat).
>> Is there an easy way to fix this?
>
> What are you trying to fix? Filesystems have a UUID. MD RAID devices
> have a UID. And MD RAID member devices also have UUIDs, but they are
> all different *kinds* of UUID. Only filesystems have a filesystem
> UUID that you use in /etc/fstab and other places. You mount things
> by filesystem UUID. You don't mount MD RAID member devices; mdadm
> assembles them.
>
> RAID assembly normally happens automatically by udev finding block
> devices that have the same array id as the one that mdadm is trying
> to incrementally assemble, until all their member devices are found.
>
> So what is it that you are actually wanting to do? If you just want
> to mount whatever filesystem is on md0 by *filesystem* UUID, you do
> that in the normal way as it has nothing to do with MD: you use
> blkid or tune2fs or whatever to read the fs label and put that in
> /etc/fstab.

I was just worried that devices (i.e. /dev/sdx) will change when adding
another drive. I understand that Debian's SW-RAID assembly does not
refer to disks via device names :)

>> If I need to reinstall, can I keep the two member HDDs with all the
>> data, i.e. does the Debian12 installer recognize the member HDDs
>> and will allow me to configure /dev/md0?
>
> Yes. When you come to the partitioning and software RAID section of
> the installer your existing md0 should already be there.

That's very good!

> 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?

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?

Many Thanks and Best Regards,
Felix
-- 
Felix Natter


Reply via email to