+reregister_mounts() {
+ cat /etc/mtab | while read -r fs mntpnt fstype opts rest ; do
+ fs=`printf '%b\n' "$fs"`
+ mntpnt=`printf '%b\n' "$mntpnt"`
+ if [ "$fstype" == "zfs" ] ; then
+ if [ "$mntpnt" == "/" ] ; then
+ mount -f -o zfsutil -t zfs --move / /removethismountpointhoweverpossible
+ umount --fake /removethismountpointhoweverpossible
+ else
+ umount --fake "$mntpnt"
+ fi
+ elif echo "$fs" | grep -q "^/dev/zd" ; then
+ if [ "$mntpnt" == "/" ] ; then
+ mount -f -t "$fstype" --move / /removethismountpointhoweverpossible
+ umount --fake /removethismountpointhoweverpossible
+ else
+ umount --fake "$mntpnt"
+ fi
+ fi
+ done
+ cat /proc/mounts | while read -r fs mntpnt fstype opts rest ; do
+ fs=`printf '%b\n' "$fs"`
+ mntpnt=`printf '%b\n' "$mntpnt"`
+ if [ "$fstype" == "zfs" ] ; then
+ mount -f -t zfs -o zfsutil "$fs" "$mntpnt"
+ elif echo "$fs" | grep -q "^/dev/zd" ; then
+ mount -f -t "$fstype" -o "$opts" "$fs" "$mntpnt"
+ fi
+ done
+}