[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#637086: sets up ZFS filesystems for automated mount



Package: partman-zfs
Version: 5
Severity: important

mount.d/zfs sets ZFS filesystems up for automated mount.  Automated mount
is very dangerous because it leads to collision when two ZFS-based operating
systems are installed in the same pool.

If ZFS is used for /, it will be overlaid on top of the real /, making /dev
useless (and rendering system unbootable on both sides).

If ZFS is used for other subdirectories, a mix of both operating systems
will be used.  Results are unpredictable.

As a workaround, zfsutils doesn't automatically mount/unmount filesystems
that have been marked for automated mount.  See changelog entry for 8.2-3:

http://packages.debian.org/changelogs/pool/main/z/zfsutils/zfsutils_8.2-3/changelog

Attached patch switches partman-zfs to legacy mount.  However, it can't be
currently used because of bug #637082.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-0-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/commit.d/format_zfs b/commit.d/format_zfs
index 3736365..1d75e81 100755
--- a/commit.d/format_zfs
+++ b/commit.d/format_zfs
@@ -63,11 +63,11 @@ for dev in $DEVICES/*; do
 			fi
 
 			code=0
-			local fs=${device##/dev/zvol/}
+			local fs=${device#/dev/zvol/}
 			log-output -t partman --pass-stdout \
 				zfs destroy "${fs}" >/dev/null || code=$?
 			log-output -t partman --pass-stdout \
-				zfs create -o mountpoint=none "${fs}" >/dev/null || code=$?
+				zfs create -o mountpoint=legacy "${fs}" >/dev/null || code=$?
 			sync
 			db_progress STOP
 
diff --git a/mount.d/zfs b/mount.d/zfs
index 9d6fc36..31df7e2 100755
--- a/mount.d/zfs
+++ b/mount.d/zfs
@@ -11,7 +11,7 @@ pass=$6
 
 case $type in
     zfs)
-	zfs set mountpoint=/${mp#/} ${fs#/dev/zvol/} || exit 1
+	mount -t zfs ${fs#/dev/zvol/} ${mp} || exit 1
 	exit 0
 	;;
 esac

Reply to: