fstab-syncSection: Maintenance Commands (8) |
fstab-syncSection: Maintenance Commands (8) |
fstab-sync [-cv?] [-a|--add UDI] [-r|--remove UDI] [-c|--clean] [-v|--verbose] [-?|--help] [--usage]
This program serves one major purpose: Update the file systems table file /etc/fstab and create/remove mount points in /media in response to HAL events. This program is usually never run directly from a shell; instead it is invoked as a callout from the /etc/hal/device.d directory by the HAL daemon.
Additionally, this program offers an option of removing any trace of its previous actions from the file systems table file. Specifically this happens when invoked by the HAL daemon for the root computer device object which only happens when the HAL daemon is starting up. Thus, when starting the HAL daemon, the /etc/fstab file will be completely sanitized, e.g. all entries previously added by the fstab-sync program will be removed. When probing for hardware during the startup of the HAL daemon, the fstab-sync program will be invoked several times to add new entries to the /etc/fstab file.
All entries added to /etc/fstab by fstab-sync can be identified by the use of the option managed in the options field. This option is a no-op; it is only used to uniquely identify entries added by the fstab-sync program.
When the /etc/fstab file is written by fstab-sync, a comment with a link to this manual page is added to the file.
By default, the /usr/share/hal/fdi/90defaultpolicy/storage-policy.fdi file specifies the policy - this file should never be edited by the system administrator as it might get updated by the OS vendor for security updates. Instead, system- or site-specific rules can be put in the /usr/share/hal/fdi/95userpolicy directory.
Device information files are processed for every hal device object in the /usr/share/hal/fdi/ directory in alphabetical order including directories. Hence, files in the 90defaultpolicy directory are processed before files 95userpolicy directory, 95userpolicy/a.fdi is processed before 95userpolicy/b.fdi and so on. In addition, directives in specific files are processed in a top-down fashion.
A number of sample policy files for various uses should be available in the /usr/share/doc/hal-0.4.0/conf directory. For example, the policy file storage-non-fixed.fdi ensures that only fixed optical and floppy drives gets tagged as mountable which ensures that e.g. hard disk partitions on a fixed disk won't get added to the /etc/fstab file. Similarly the storage-skip-all.fdi file will ensure no entries are ever added.
The fstab-sync program uses flock(2) for locking the /etc/fstab file when adding or removing entries. This happens when the HAL daemon starts up, when there's a media change event or when a storage device is hotplugged.