Skip to content

Commit

Permalink
init.d/zfs-mount: Don't fsck or mount/umount fstab entries
Browse files Browse the repository at this point in the history
This is better handled by existing OS toolset.

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Damian Szuberski <[email protected]>
Signed-off-by: omni <[email protected]>
Issue openzfs#7374
Closes openzfs#12780
  • Loading branch information
omnivagant authored and andrewc12 committed Sep 23, 2022
1 parent 6b7293c commit c967e24
Showing 1 changed file with 0 additions and 82 deletions.
82 changes: 0 additions & 82 deletions etc/init.d/zfs-mount.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,50 +71,6 @@ do_mount()
zfs_action "Mounting ZFS filesystem(s)" \
"$ZFS" mount "-a$verbose$overlay" "$MOUNT_EXTRA_OPTIONS"

# Require each volume/filesystem to have 'noauto' and no fsck
# option. This shouldn't really be necessary, as long as one
# can get zfs-import to run sufficiently early on in the boot
# process - before local mounts. This is just here in case/if
# this isn't possible.
check_boolean "$VERBOSE_MOUNT" && \
zfs_log_begin_msg "Mounting volumes and filesystems registered in fstab"

read_mtab "^/dev/(zd|zvol)"
read_fstab "^/dev/(zd|zvol)"
i=0; var="FSTAB_0"
while [ -n "$(eval echo "\$$var")" ]
do
mntpt=$(eval echo "\$$var")
dev=$(eval echo "\$FSTAB_dev_$i")
if ! in_mtab "$mntpt" && ! is_mounted "$mntpt" && [ -e "$dev" ]
then
check_boolean "$VERBOSE_MOUNT" && \
zfs_log_progress_msg "$mntpt "
fsck "$dev" && mount "$mntpt"
fi

i=$((i + 1))
var=$(eval echo "FSTAB_$i")
done

read_mtab "[[:space:]]zfs[[:space:]]"
read_fstab "[[:space:]]zfs[[:space:]]"
i=0; var=$(eval echo "FSTAB_$i")
while [ -n "$(eval echo "\$$var")" ]
do
mntpt=$(eval echo "\$$var")
if ! in_mtab "$mntpt" && ! is_mounted "$mntpt"
then
check_boolean "$VERBOSE_MOUNT" && \
zfs_log_progress_msg "$mntpt "
mount "$mntpt"
fi

i=$((i + 1))
var=$(eval echo "FSTAB_$i")
done
check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0

return 0
}

Expand All @@ -129,44 +85,6 @@ do_unmount()
# this isn't possible.
zfs_action "Unmounting ZFS filesystems" "$ZFS" unmount -a

check_boolean "$VERBOSE_MOUNT" && \
zfs_log_begin_msg "Unmounting volumes and filesystems registered in fstab"

read_mtab "^/dev/(zd|zvol)"
read_fstab "^/dev/(zd|zvol)"
i=0; var="FSTAB_0"
while [ -n "$(eval echo "\$$var")" ]
do
mntpt=$(eval echo "\$$var")
dev=$(eval echo "\$FSTAB_dev_$i")
if in_mtab "$mntpt"
then
check_boolean "$VERBOSE_MOUNT" && \
zfs_log_progress_msg "$mntpt "
umount "$mntpt"
fi

i=$((i + 1))
var=$(eval echo "FSTAB_$i")
done

read_mtab "[[:space:]]zfs[[:space:]]"
read_fstab "[[:space:]]zfs[[:space:]]"
i=0; var="FSTAB_0"
while [ -n "$(eval echo "\$$var")" ]
do
mntpt=$(eval echo "\$$var")
if in_mtab "$mntpt"; then
check_boolean "$VERBOSE_MOUNT" && \
zfs_log_progress_msg "$mntpt "
umount "$mntpt"
fi

i=$((i + 1))
var=$(eval echo "FSTAB_$i")
done
check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0

return 0
}

Expand Down

0 comments on commit c967e24

Please sign in to comment.