pvcreate can't open /dev/md1 exclusively

Christopher Huhn C.Huhn at gsi.de
Fri Jan 24 19:06:08 CET 2025


Hi Matthew,

Am 24.01.25 um 18:18 schrieb Matthew Pounsett:
> The server has four drives:  two SSDs that I'm trying to mirror and put 
> volumes on, and two larger HDDs that FAI should be ignoring.   It does 
> seem to be ignoring the two HDDs now, thanks to help in the last thread.
> […]
> $disklist shows up as expected:
> root at srv03:/etc/lvm# echo $disklist
> sda sdb sdc sdd
 > […]
> root at srv03:/tmp/fai# lsblk
> NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
> sda    8:0    0   7.3T  0 disk
> sdb    8:16   0   7.3T  0 disk
> sdc    8:32   0 447.1G  0 disk
> sdd    8:48   0 447.1G  0 disk
as you can see here the large disks are sda (disk1) and sdb (disk2) 
while the SSDs are sdc and sdd.
This mapping is not stable through reboots, so you have to make sure 
your disks are in the intended order in your disklist.

We use a very basic hook to sort our disks by size:

 > # cat class/31-sortdisks.sh
 > disklist=$(grep -H '^[1-9]' /sys/block/[hsv]d[a-z]/size 
/sys/block/nvme*n[0-9]/size | sort -n -t : -k 2 | cut -f4 -d / | xargs)
 > echo "disklist=\"$disklist\"" >> "$LOGDIR/additional.var"

IIRC there were some discussions on this list on how to create a 
reliably sorted disklist but nothing seem to have made it to the example 
FAI config on github.

Best

Christopher
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4783 bytes
Desc: Kryptografische S/MIME-Signatur
URL: <http://lists.uni-koeln.de/pipermail/linux-fai/attachments/20250124/86c0f7b8/attachment-0001.p7s>


More information about the linux-fai mailing list