Hi, i have an external usb hdd, and this udev rule for automounting an external usb hard drive, connect after tc has booted.
KERNEL!="sd[a-z][0-9]", GOTO="mnt_by_label_auto_mount_end"
# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p %N"
# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"
# Global mount options
ACTION=="add", ENV{mount_options}="relatime"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /mnt/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/%E{dir_name}"
# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /mnt/%E{dir_name}", RUN+="/bin/rmdir /mnt/%E{dir_name}"
# Exit
LABEL="mnt_by_label_auto_mount_end"
if i connect the external hdd after TC has booted the drive will be mounted, but if i reboot and the drive is not fast enough to be recognized at boot, i dont want to use waitusb=XX cause slows down booting, udev does not mount the drive again, even if i try
sudo udevadm control --reload-rules && sudo udevadm trigger
is there anyway that the drive will be mounted from the udev rule or do i need a script running in the background and waits till found the drive and mount them ?
thanks.