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

Re: Where do I find the definitive man page for mdadm?



On Saturday 13 November 2021 07:33:49 Andy Smith wrote:

> Hello,
>
> On Fri, Nov 12, 2021 at 11:42:32AM -0500, Gene Heskett wrote:
> > On Friday 12 November 2021 10:18:07 Dan Ritter wrote:
> > > After you have set them up, mdadm.conf has things like this:
> > >
> > > ARRAY /dev/md/0 metadata=1.2 name=debian:0
> > > UUID=aeac6271:676b1852:04f077d6:fcd285d6 ARRAY /dev/md/1
> > > metadata=1.2 name=debian:1
> > > UUID=d74ff881:2e966c37:ec6ef1ec:75b8cdce ARRAY /dev/md/2
> > > metadata=1.2 name=debian:2
> > > UUID=7c56166b:0d5aed8b:a9d03c45:e9b8080c
> >
> > That doesn't appear to be true. I have run the create which seemed
> > to be ok, then mkfs -text4 /dev/md0, then mounted it at /home2.
> >
> > But /etc/mdadm/mdadm.conf doesn't yet have any of that, only this:
>
> You don't need to list the arrays in /etc/mdadm/mdadm.conf since
> udev assembles arrays based on the metadata that exists on each
> device. It's fine for there to be no ARRAY lines in there. These
> days it's only really useful in recovery situations or for setting
> some special options per array.
>
> You can still do the
>
> # mdadm --detail --scan
>
> to find the lines to put in the mdadm.conf yourself.
>
> > And again, I don't trust UUID's as moving a drive cable to a
> > different socket has invalidated the whole lot of them once before.
> > I would much rather LABEL the array, and mount it in /etc/fstab by
> > that label.
>
> There may be some conceptual error here. The UUIDs you would put in
> /etc/fstab are FILESYSTEM UUIDs, not array UUIDs. Lots of things in
> computing have UUIDs.
>
> After you put a filesystem on each array you can refer to the
> FILESYSTEM label in /etc/fstab. These labels are internal to each
> filesystem and nothing to do with any layer below, such as md.
>
> > LABEL as I recall is a journalctl function? Does it work on
> > raid10's?
>
> Filesystem labels have nothing to do with journalctl. And I don't
> know what you mean by them being "a function".
>
> Again, filesystems (can) have labels, these are a filesystem detail,
> RAID doesn't know nor care.
>
> > Humm, now:
> > gene@coyote:~/AppImages$ sudo mdadm --detail  --scan
> > [sudo] password for gene:
> > ARRAY /dev/md0 metadata=1.2 name=coyote:0
> > UUID=8ad67ef1:a14d63ab:c684ec2b:42a0c011
> >
> > So I should add that last line to which category in mdadm.conf?
>
> mdamd.conf doesn't have categories. You would just append that line
> at the end, ensuring it is all on one line.

And I just found I didn't have an mdadm.conf, and I had figure a new -C would have created it. But 
the last time I ran it, no mdadm.conf was created.

So I made a 2 liner from the --scan output. What else should it have?
ARRAY /dev/md0 metadata=1.2 name=coyote:0 UUID=3d5a3621:c0e32c8a:e3f7ebb3:318edbfb
ARRAY /dev/md1 metadata=1.2 name=coyote:1 UUID=ddb6ffa2:e068b701:f316cc5f:83938a13
You indicate that these are not the UUID's to put in fstab, or do I 
miss-understand?

Experiment after putting those UUID's into fstab
@coyote:etc$ mount /home2
mount: can't find UUID=3d5a3621:c0e32c8a:e3f7ebb3:318edbfb
root@coyote:etc$ mount /snapshot
mount: can't find UUID=ddb6ffa2:e068b701:f316cc5f:83938a13
root@coyote:etc$ mount /dev/md0 -text4 /home2
root@coyote:etc$ mount /dev/md1 -text4 /snapshot
@coyote:etc$ df
Filesystem      1K-blocks      Used  Available Use% Mounted on
udev             16380992         0   16380992   0% /dev
tmpfs             3280240      9516    3270724   1% /run
/dev/sda5      1857400436 317616932 1445362976  19% /
tmpfs            16401180         0   16401180   0% /dev/shm
tmpfs                5120         4       5116   1% /run/lock
tmpfs            16401180         0   16401180   0% /sys/fs/cgroup
/dev/sdb1       229699916     61472  217900640   1% /sdb
/dev/sdc1      1921802432 879249728  944860648  49% /amandatapes
/dev/sda3        47799020   6444388   38896828  15% /var
/dev/sda1          944120    188864     690080  22% /boot
tmpfs             3280236         4    3280232   1% /run/user/1000
/dev/md0       1812963068     77852 1720721940   1% /home2
/dev/md1        100203600     61464   95009032   1% /snapshot

Which nicely demos why I don't trust UUID's. But, why didn't it work?
Why did I have to revert to md0/md1 names to remount them?

> > And for the time being use that UUID in /etc/fstab to mount it to
> > /home2, right?
>
> No, because that is not a filesystem UUID. And you said you wanted
> to mount the filesystem by label anyway. So put whatever label you
> chose when you did mkfs (or when you did it from the installer).

I didn't know mkfs can do labels.

> In a later email you did this:
>
> # mkfs -Text4 …
>
> and got an obscure error.
>
> That's because you did "-T" instead of "-t", which means something
> completely different. You may want to get into the habit of doing:
>
> # mkfs.ext4 …
>
> instead as it's clearer and easier to remember.
>
> Cheers,
> Andy


Cheers, Gene Heskett.
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author, 1940)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page <http://geneslinuxbox.net:6309/gene>


Reply to: