public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: karl@aspodata.se
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Fun with mdadm (Software RAID)
Date: Fri, 20 Dec 2024 18:44:53 +0100 (CET)	[thread overview]
Message-ID: <20241220174453.4E33285A435A@turkos.aspodata.se> (raw)
In-Reply-To: <Z2WNHabueBfFD0jj@MAC.fritz.box>

Alan Mackenzie:
> On Fri, Dec 20, 2024 at 15:50:53 +0100, karl@aspodata.se wrote:
...
> Because I didn't know about it.  I found out about it this morning, and
> immediately tested it by setting up an
> "md=126,/dev/nvme0n1p4,/dev/nvme1n1p4" on the kernel command line, using
> the rescue disk to make the "preferred minor"s wrong, and testing it.
> It worked!
> 
> If I understand things correctly, with this mechanism one can have the
> kernel assemble the RAID arrays at boot up time with a modern metadata,
> but still without needing the initramfs.  My arrays are still at
> metadata 0.90.

Please tell if you make booting with metadata 1.2 work.
I havn't tested that.

///

...
> >  And... what is the need for dynamic minors now when dev_t is 32bits:
> Dynamic minors?  I don't think I follow you, here.

If you partition the md device, the partitions will get a device with a
dynamic minor.

# mdadm -C /dev/md11 -n 1 -l 1 --force /dev/sdc2
# mdadm -C /dev/md10 -n 1 -l 1 -e 0 --force /dev/sdc1
... create partitions
# fdisk -l /dev/md10
...
Device      Boot Start    End Sectors  Size Id Type
/dev/md10p1       2048  22527   20480   10M 83 Linux
/dev/md10p2      22528 192383  169856 82.9M 83 Linux
# fdisk -l /dev/md11
...
Device      Boot  Start     End Sectors  Size Id Type
/dev/md11p1        2048  206847  204800  100M 83 Linux
/dev/md11p2      206848 1757183 1550336  757M 83 Linux
# cat /sys/block/md10/md10p1/dev 
259:0
# cat /sys/block/md10/md10p2/dev 
259:1
# cat /sys/block/md11/md11p1/dev 
259:2
# cat /sys/block/md11/md11p2/dev 
259:3

$ grep -A2 '259 block' /Net/git/linux-stable/Documentation/admin-guide/devices.txt 
 259 block      Block Extended Major
                  Used dynamically to hold additional partition minor
                  numbers and allow large numbers of partitions per device

So, to boot to a md device partition (as /) might be a hit and miss 
unless you use some initramfs magic.

Regards,
/Karl Hammar




  reply	other threads:[~2024-12-20 17:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-20 10:47 [gentoo-user] Fun with mdadm (Software RAID) Alan Mackenzie
2024-12-20 14:50 ` karl
2024-12-20 15:28   ` Alan Mackenzie
2024-12-20 17:44     ` karl [this message]
2024-12-20 20:19       ` Alan Mackenzie
2024-12-20 20:38         ` Hoël Bézier
2024-12-20 20:53           ` Alan Mackenzie
2024-12-20 22:02         ` karl
2024-12-30  4:08           ` Frank Steinmetzger
2024-12-20 22:02         ` karl
2024-12-21 12:43           ` Alan Mackenzie
2024-12-21 16:36             ` Alan Mackenzie
2024-12-21 16:45               ` karl
2024-12-21 16:58                 ` Alan Mackenzie
2024-12-22 13:08                   ` Alan Mackenzie
2024-12-22 12:16             ` Wols Lists
2024-12-22 12:08         ` Wols Lists
2024-12-22 12:02       ` Wols Lists
2024-12-22 13:43         ` Alan Mackenzie
2024-12-22 15:29           ` Peter Humphrey
2024-12-22 16:53             ` Wols Lists
2024-12-22 20:05               ` Alan Mackenzie
2024-12-25 21:16                 ` Steven Lembark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241220174453.4E33285A435A@turkos.aspodata.se \
    --to=karl@aspodata.se \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox