mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Change /etc/mtab to /proc/self/mounts
Fix misleading error message: "The /dev/zfs device is missing and must be created.", if /etc/mtab is missing. Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Eric Desrochers <eric.desrochers@canonical.com> Closes #4680 Closes #5029
This commit is contained in:
committed by
Brian Behlendorf
parent
25e2ab16be
commit
792517389f
@@ -40,11 +40,16 @@
|
||||
|
||||
verify_runnable "global"
|
||||
|
||||
log_assert "zfs fails with unexpected scenarios."
|
||||
log_assert "zfs fails with unexpected scenario."
|
||||
|
||||
#verify zfs failed if ZFS_DEV cannot be opened
|
||||
ZFS_DEV=/dev/zfs
|
||||
|
||||
if is_linux; then
|
||||
# On Linux, we use /proc/self/mounts, which cannot be moved.
|
||||
MNTTAB=
|
||||
fi
|
||||
|
||||
for file in $ZFS_DEV $MNTTAB; do
|
||||
if [[ -e $file ]]; then
|
||||
$MV $file ${file}.bak
|
||||
@@ -55,4 +60,4 @@ for file in $ZFS_DEV $MNTTAB; do
|
||||
$MV ${file}.bak $file
|
||||
done
|
||||
|
||||
log_pass "zfs fails with unexpected scenarios as expected."
|
||||
log_pass "zfs fails with unexpected scenario as expected."
|
||||
|
||||
Reference in New Issue
Block a user