--- etc/rc.d/zfs 2010-01-25 06:27:11.000000000 +0000 +++ etc/rc.d/zfs 2009-04-12 16:59:35.000000000 +0000 @@ -23,6 +23,14 @@ zfs_start_main() { + # If root is read-only, mount a tmpfs on /zfs to provide + # a writable mountpoint, if not already + if [ -d /zfs ] && mount | grep ' on / ' | grep -q 'read-only' && \ + ! mount | grep -q ' on /zfs (tmpfs' + then + mount -t tmpfs -o size=65536 tmpfs /zfs + fi + zfs mount -a zfs share -a if [ ! -r /etc/zfs/exports ]; then @@ -50,6 +58,12 @@ { zfs unshare -a zfs unmount -a + + # If /zfs is a tmpfs, unmount it + if mount | grep -q ' on /zfs (tmpfs' + then + umount -f /zfs + fi } zfs_stop()