fsmithred | Are there any cases where /dev/sdX* or /dev/vdX* have subdirectories under them? | 12:01 |
---|---|---|
fsmithred | find /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 |
fsmithred | RAID 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 |
fsmithred | what unintended consequences might there be? | 12:04 |
xrogaan | fsmithred: 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 |
xrogaan | https://unix.stackexchange.com/ maybe? | 13:00 |
rrq | fsmithred: aren't you better off using "blkid -odevice" ? | 14:45 |
fsmithred | rrq, 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 |
rrq | and otherwise you could use "find /dev /dev/mapper -mindepth 1 -maxdepth 1" | 14:54 |
fsmithred | has to be maxdepth 2 or else it only shows /dev/mapper in the list, not the volumes inside | 14:54 |
rrq | mmm with /dev/mapper as search point it'll go 1 step below that | 14:55 |
fsmithred | yeah, but I only want one find command, and it has to find the physical partitions, too | 14:55 |
fsmithred | I'm testing blkid as we speak, and it may work well | 14:56 |
rrq | "find /dev /dev/mapper -mindepth 1 -maxdepth 1" | 14:56 |
fsmithred | yeah, but then how to find /dev/sda1? | 14:56 |
fsmithred | another find command | 14:56 |
rrq | nope that's under /dev | 14:56 |
fsmithred | oh | 14:56 |
fsmithred | I didn't know you could give it two locations | 14:57 |
rrq | but the grep pattern needs change for the lvm link names | 14:57 |
fsmithred | we might have rejected blkid because we didn't want /dev/mapper to show up | 14:57 |
fsmithred | what I was going to do would put everything in /dev/mapper in the list, but blkid just shows the relevant items | 14:58 |
fsmithred | I might switch to that | 14:58 |
fsmithred | it eliminates that complex search string | 14:59 |
rrq | blkid --probe --match-types ext2,ext3,ext4 $(blkid -odevice) -odevice | 14:59 |
fsmithred | blkid | awk -F: '{if ($0 !=~ "'$esp_dev'") {print $1 }}' | 14:59 |
fsmithred | don't need to restrict it to ext filesystems. Someone might pre-format with something else. | 15:01 |
rrq | right | 15:03 |
fsmithred | I posted the wrong one. Should not have the '=' in there. | 15:08 |
rrq | and exclude swap partitions too maybe | 15:08 |
fsmithred | and with -odevice it shows my encrypted volume, which may be useful if I add code to create encrypted lvm. | 15:09 |
fsmithred | good idea. Not sure how we haven't run into problems with swap. | 15:09 |
fsmithred | can I put two search patterns in my awk, or just run it twice? | 15:17 |
rrq | can do: $0 !~ "'$esp_dev'" && $0 !~ "swap" | 15:18 |
fsmithred | yea, like that looks good | 15:18 |
fsmithred | thanks | 15:18 |
rrq | another: blkid --probe --usages filesystem $(blkid -odevice) -odevice | 15:18 |
rrq | though I'm not sure that filtering is right either | 15:19 |
rrq | awk filtering might be better | 15:21 |
fsmithred | yeah, that last one shows the encrypted volume | 15:22 |
fsmithred | gotta go. bbl. | 15:29 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!