Existem algumas questões semelhantes sobre este problema, mas nenhuma resposta funcionou para mim e, obviamente, eles não funcionaram para os outros caras, ou porque nenhuma resposta foi marcada como solução. Então eu tento de novo:
Com o Ubuntu Server 16.04 com kernel 4.4.0-122-genérico, minha regra do udev para montar minha unidade de backup e executar o script de backup não funciona mais. Antes da atualização 16.04 em 14.04 tudo funcionou como esperado.
A regra do udev:
# 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", ATTRS{idVendor}=="1058", ATTRS{idProduct}=="0827", RUN+="/bin/mount -o $env{mount_options} /dev/%k /mnt/backup"
# Exit
LABEL="media_by_label_auto_mount_end"
Aqui estão algumas saídas:
/ var / log / syslog
May 4 10:58:33 homeserver kernel: [ 369.067146] usb 5-1: new SuperSpeed USB device number 2 using xhci_hcd
May 4 10:58:33 homeserver kernel: [ 369.086138] usb 5-1: New USB device found, idVendor=1058, idProduct=0827
May 4 10:58:33 homeserver kernel: [ 369.086143] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
May 4 10:58:33 homeserver kernel: [ 369.086146] usb 5-1: Product: My Passport 0827
May 4 10:58:33 homeserver kernel: [ 369.086149] usb 5-1: Manufacturer: Western Digital
May 4 10:58:33 homeserver kernel: [ 369.086152] usb 5-1: SerialNumber: 57584D314136353348563358
May 4 10:58:33 homeserver kernel: [ 369.134012] usb-storage 5-1:1.0: USB Mass Storage device detected
May 4 10:58:33 homeserver kernel: [ 369.134115] scsi host5: usb-storage 5-1:1.0
May 4 10:58:33 homeserver kernel: [ 369.134727] usbcore: registered new interface driver usb-storage
May 4 10:58:33 homeserver kernel: [ 369.146936] usbcore: registered new interface driver uas
May 4 10:58:34 homeserver kernel: [ 370.135338] scsi 5:0:0:0: Direct-Access WD My Passport 0827 1016 PQ: 0 ANSI: 6
May 4 10:58:34 homeserver kernel: [ 370.135669] scsi 5:0:0:1: Enclosure WD SES Device 1016 PQ: 0 ANSI: 6
May 4 10:58:34 homeserver kernel: [ 370.140066] sd 5:0:0:0: Attached scsi generic sg4 type 0
May 4 10:58:34 homeserver kernel: [ 370.143101] scsi 5:0:0:1: Attached scsi generic sg5 type 13
May 4 10:58:34 homeserver kernel: [ 370.143390] sd 5:0:0:0: [sdd] Spinning up disk...
May 4 10:58:40 homeserver kernel: [ 371.146453] .ready
May 4 10:58:40 homeserver kernel: [ 375.917572] sd 5:0:0:0: [sdd] 1953458176 512-byte logical blocks: (1.00 TB/931 GiB)
May 4 10:58:40 homeserver kernel: [ 375.919918] sd 5:0:0:0: [sdd] Write Protect is off
May 4 10:58:40 homeserver kernel: [ 375.919924] sd 5:0:0:0: [sdd] Mode Sense: 47 00 10 08
May 4 10:58:40 homeserver kernel: [ 375.921057] sd 5:0:0:0: [sdd] No Caching mode page found
May 4 10:58:40 homeserver kernel: [ 375.921358] sd 5:0:0:0: [sdd] Assuming drive cache: write through
May 4 10:58:40 homeserver kernel: [ 375.930525] sdd: sdd1
May 4 10:58:40 homeserver kernel: [ 375.932315] ses 5:0:0:1: Attached Enclosure device
May 4 10:58:40 homeserver kernel: [ 375.935978] sd 5:0:0:0: [sdd] Attached SCSI disk
May 4 10:58:41 homeserver ntfs-3g[11397]: Version 2015.3.14AR.1 integrated FUSE 28
May 4 10:58:41 homeserver ntfs-3g[11397]: Mounted /dev/sdd1 (Read-Write, label "Backup", NTFS 3.1)
May 4 10:58:41 homeserver ntfs-3g[11397]: Cmdline options: rw,relatime,utf8,gid=100,umask=002
May 4 10:58:41 homeserver ntfs-3g[11397]: Mount options: rw,utf8,allow_other,nonempty,relatime,default_permissions,fsname=/dev/sdd1,blkdev,blksize=4096
May 4 10:58:41 homeserver ntfs-3g[11397]: Global ownership and permissions enforced, configuration type 7
May 4 10:58:41 homeserver ntfs-3g[11397]: Warning : using problematic uid==0 and gid!=0
$ mount
/dev/sdd1 on /mnt/backup type fuseblk (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
$ df -h
df: /mnt/backup: Transport endpoint is not connected
$ ls -l / mnt /
ls: cannot access '/mnt/backup': Transport endpoint is not connected
total 4
d????????? ? ? ? ? ? backup
drwxr-xr-x 2 root root 4096 Sep 20 2016 portable
Obrigado pela sua ajuda!