Sync usage with man page.
[netbsd-mini2440.git] / etc / rc.d / mountall
blob3f40e886608261801f6a6a3fabfef6e214920c6f
1 #!/bin/sh
3 # $NetBSD: mountall,v 1.7 2009/10/05 22:39:27 haad Exp $
6 # REQUIRE: mountcritremote named ypbind
7 # PROVIDE: mountall
9 $_rc_subr_loaded . /etc/rc.subr
11 name="mountall"
12 start_cmd="mountall_start"
13 stop_cmd="mountall_stop"
15 mountall_start()
17 echo 'Mounting all filesystems...'
18 if [ -f /etc/zfs/zpool.cache ]; then
19 # Get ZFS module loaded (and thereby, zvols created).
20 zfs list > /dev/null 2>&1
21 # Initialize zvols so they can be mounted
22 zfs volinit
23 # Mount file systems noted in fstab.
24 mount -a
25 # Mount ZFS file systems.
26 zfs mount -a
27 else
28 # Mount file systems noted in fstab.
29 mount -a
33 mountall_stop()
35 echo 'Unmounting all filesystems...'
36 if [ -f /etc/zfs/zpool.cache ]; then
37 # Unmount ZFS file systems.
38 zfs unmount -a
39 # Unmount file systems noted in fstab.
40 umount -a
41 # Unload ZFS module, so disk devices are closed.
42 modunload zfs
43 else
44 # Otherwise, just deal with fstab.
45 umount -a
49 load_rc_config $name
50 run_rc_command "$1"