Current-Users archive

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

Re: raidframe and gpt





On 2024-03-17 12.04, B Harder wrote:


On Mar 16, 2024, at 23:16, Greg Oster <oster%netbsd.org@localhost> wrote:

RAIDframe doesn't understand NAME=gpt-label.  Use /dev/dk<n> , and then set the RAID set to autoconfigure.  It'll magically figure out what devices need to be glued together.

Hey Greg, can you explain that magic in any level of detail?

Sure... How about a somewhat lower level with a bit of hand-waving :)

As the kernel is booting up, rf_autoconfig() (from rf_netbsdkintf.c) is set to run after all devices are initialized.

rf_autoconfig() calls rf_find_raid_components(), which goes through all the devices on the system (first looking at wedges, and then at 'disks'), and identifying any partitions that are of type "RAID" (handwaving occurs here.) The component labels of all those RAID partitions are stuffed into a single list for later processing.

One rf_find_raid_components() is complete, rf_create_auto_sets() is then called. This goes through the list of components created earlier, and sorts them into groups of components based on the component labels. The next step happens in rf_buildroothack(), which takes the set of sets of components. For each set of components, rf_have_enough_components() is called, and that determines whether or not there are sufficient components to bring up that RAID set (possibly in degraded mode). If there are sufficient components, then rf_auto_config_set() is called with that set of components, and if all is still well, then that particular RAID set is configured (to the RAID device on which it was last configured, if that device is available).

So in a nutshell, the component labels (preferably with a different serial number for ease of differentiation) are used to figure out which components belong together. RAIDframe doesn't care if they've moved to a different SCSI or SATA or dk device -- it only cares that the labels are consistent and that it can find enough components to get the RAID set operational.

Hope that's a useful level of detail. :)

Later...

Greg Oster



One more quuestion: the raidctl man page talks about partitioning the
raid<n> device using mbr partitions.  Is it possible to use GPT here?
Will the resulting wedges show up automatically?

You can use GPT instead of mbr.  Wedges should show up automatically (I'm pretty sure they do, but since I do NFS exporting of mine, I stuck with MBR so the filesystem ID doesn't change every time the n in dk<n> for the RAID deivce changes :( )

It seems so much simpler to use ccd(4) but there's a nasty memory
allocation bug which makes it unuseable for now.

Thanks in advance!

If you're using -current, note that you can now use:

raidctl raid0 create mirror /dev/dk0 /dev/dk1

to do a simple RAID config without needing to use the config file...

Later...

Greg Oster


Home | Main Index | Thread Index | Old Index