Currently my distribution of choice (ArchLinux) has an automounting script like this:
KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"
But that will automount only partitions up to sdX9. I do have USB drives with 6 or more partitions (that is, starting from 5, up to 12, 13, 19).
All partitions have VFAT on them and have labels (the label is used for naming the mountpoint).
I have tried to modify it to:
KERNEL!="sd[a-z][0-9]+", GOTO="media_by_label_auto_mount_end"
but that doesn't work.
So how to make it work for sdb5, sdb42 or sdb31337 likewise?
Thanks.
Addendum
I've just tried the \d+?
method, udevadm monitor says:
KERNEL[1295719513.473653] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb (block)
KERNEL[1295719513.473687] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb1 (block)
KERNEL[1295719513.473706] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb5 (block)
KERNEL[1295719513.473725] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb6 (block)
KERNEL[1295719513.473743] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb7 (block)
KERNEL[1295719513.473761] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb8 (block)
KERNEL[1295719513.473791] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb9 (block)
KERNEL[1295719513.473811] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb10 (block)
KERNEL[1295719513.473830] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb11 (block)
KERNEL[1295719513.473848] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb12 (block)
UDEV [1295719513.593213] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb (block)
UDEV [1295719514.959983] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb5 (block)
UDEV [1295719514.960053] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb1 (block)
UDEV [1295719514.961528] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb6 (block)
UDEV [1295719514.963793] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb9 (block)
UDEV [1295719514.964930] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb10 (block)
UDEV [1295719514.965794] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb12 (block)
UDEV [1295719514.967418] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb8 (block)
UDEV [1295719514.968466] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb7 (block)
UDEV [1295719514.973757] add /devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1:1.0/host29/target29:0:0/29:0:0:0/block/sdb/sdb11 (block)
But it doesn't work either. If I leave the default rule, sdb5-9 are mounted properly.
KERNEL!="sd[a-z]\d+?", GOTO="media_by_label_auto_mount_end"