libera/#devuan-dev/ Sunday, 2022-05-08

fsmithredAre there any cases where /dev/sdX* or /dev/vdX* have subdirectories under them?12:01
fsmithredfind /dev -mindepth 1 -maxdepth 1  | egrep  "*[shv]d[a-z][1-99]|*nvme[0-9]n[0-9]p[1-99]|*mmcblk[0-9]p[1-99]"12:01
fsmithred^^^ That line in refractainstaller finds partitions to use. I want to add support for raid and lvm.12:02
fsmithredRAID is easy. I can just add *md[0-999] but for lvm I need to change maxdepth to 2 so it picks up /dev/mapper/*12:03
fsmithredwhat unintended consequences might there be?12:04
xrogaanfsmithred: I've never seen subdirectories. As for the rest, I believe you'd have better feedback if you asked on a mailing list or user forums.12:59
xrogaanhttps://unix.stackexchange.com/ maybe?13:00
rrqfsmithred: aren't you better off using "blkid -odevice" ?14:45
fsmithredrrq, I don't know. I have a vague memory that there is some reason we didn't use blkid, but that was 10 years ago.14:50
rrqand otherwise you could use "find /dev /dev/mapper -mindepth 1 -maxdepth 1"14:54
fsmithredhas to be maxdepth 2 or else it only shows /dev/mapper in the list, not the volumes inside14:54
rrqmmm with /dev/mapper as search point it'll go 1 step below that14:55
fsmithredyeah, but I only want one find command, and it has to find the physical partitions, too14:55
fsmithredI'm testing blkid as we speak, and it may work well14:56
rrq"find /dev /dev/mapper -mindepth 1 -maxdepth 1"14:56
fsmithredyeah, but then how to find /dev/sda1?14:56
fsmithredanother find command14:56
rrqnope that's under /dev14:56
fsmithredoh14:56
fsmithredI didn't know you could give it two locations14:57
rrqbut the grep pattern needs change for the lvm link names14:57
fsmithredwe might have rejected blkid because we didn't want /dev/mapper to show up14:57
fsmithredwhat I was going to do would put everything in /dev/mapper in the list, but blkid just shows the relevant items14:58
fsmithredI might switch to that14:58
fsmithredit eliminates that complex search string14:59
rrqblkid --probe --match-types ext2,ext3,ext4 $(blkid -odevice) -odevice14:59
fsmithredblkid | awk -F: '{if ($0 !=~ "'$esp_dev'") {print $1 }}'14:59
fsmithreddon't need to restrict it to ext filesystems. Someone might pre-format with something else.15:01
rrqright15:03
fsmithredI posted the wrong one. Should not have the '=' in there.15:08
rrqand exclude swap partitions too maybe15:08
fsmithredand with -odevice it shows my encrypted volume, which may be useful if I add code to create encrypted lvm.15:09
fsmithredgood idea. Not sure how we haven't run into problems with swap.15:09
fsmithredcan I put two search patterns in my awk, or just run it twice?15:17
rrqcan do: $0 !~ "'$esp_dev'" && $0 !~ "swap"15:18
fsmithredyea, like that looks good15:18
fsmithredthanks15:18
rrqanother: blkid --probe --usages filesystem $(blkid -odevice) -odevice15:18
rrqthough I'm not sure that filtering is right either15:19
rrqawk filtering might be better15:21
fsmithredyeah, that last one shows the encrypted volume15:22
fsmithredgotta go. bbl.15:29

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!