Index: en_US.ISO8859-1/books/handbook/disks/chapter.xml =================================================================== --- en_US.ISO8859-1/books/handbook/disks/chapter.xml +++ en_US.ISO8859-1/books/handbook/disks/chapter.xml @@ -508,6 +508,66 @@ da0: <STECH Simple Drive 1.04> s/n WD-WXE508CAN263 detached (da0:umass-sim0:0:0:0): Periph destroyed + + Automounting Removable Media + + + The -media &man.autofs.5; map is + supported starting with &os; 10.2-RELEASE. + + + USB devices can be automatically + mounted by uncommenting this line in + /etc/auto_master: + /media -media -nosuid + + Second step is to add the following lines to + /etc/devd.conf; default configuration + file contains them, but in the comments section: + # Discard autofs caches, useful for the -media special map. +notify 100 { + match "system" "GEOM"; + match "subsystem" "DEV"; + action "/usr/sbin/automount -c"; +}; + + + Reload the configuration if &man.autofs.5; + and &man.devd.8; are already running: + &prompt.root; service automount reload +&prompt.root; service devd reload + + &man.autofs.5; and &man.devd.8; can be enabled at boot + time by adding these lines to + /etc/rc.conf: + + autofs_enable="YES" +devd_enable="YES" + + Start the services immediately with: + + &prompt.root; service automount start +&prompt.root; service automountd start +&prompt.root; service autounmountd start +&prompt.root; service devd start + + + Each file system that can be automatically mounted appears + as a directory in /media/. The directory + is named after the file system label. If the label is + missing, the directory is named after the device node. + + The file system is transparently mounted on the first + access, and unmounted after a period of inactivity. + Automounted drives can also be unmounted manually: + + &prompt.root; automount -fu + + This mechanism is typically used for memory cards and + USB memory sticks. It can be used with + any block device, including optical drives or + iSCSI LUNs. +