Actions
Bug #6464
closedlibbe shouldn't mangle zfs mountpoints
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-11-19
Due date:
% Done:
100%
Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:
Description
Currently, fs-minimal has the following code:
for fs in /var /var/adm /tmp; do readvfstab $fs < $vfstab if [ -n "$mountp" ]; then mounted $mountp $mntopts $fstype < /etc/mnttab && continue checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL mountfs -O $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL continue fi if [ "$rootiszfs" = 1 ]; then mountpt=`zfs get -H -o value mountpoint $be$fs 2>/dev/null` if [ $? = 0 ] ; then if [ "x$mountpt" = "x$fs" ] ; then /sbin/zfs mount -O $be$fs fi fi fi done
If /var is a separate FS, which is a part of BE and you previously mounted BE to some temporary location, on the next boot to this BE /var will not be mounted,
as its mountpoint will be set to something like '/mnt/var' and not '/var'.
The possible fix could look like this:
for fs in /var /var/adm /tmp; do readvfstab $fs < $vfstab if [ -n "$mountp" ]; then mounted $mountp $mntopts $fstype < /etc/mnttab && continue checkfs $fsckdev $fstype $mountp || exit $SMF_EXIT_ERR_FATAL mountfs -O $mountp $fstype $mntopts - || exit $SMF_EXIT_ERR_FATAL continue fi if [ "$rootiszfs" = 1 ]; then mountpt=`zfs get -H -o value mountpoint $be$fs 2>/dev/null` if [ $? = 0 ] ; then if [ "x$mountpt" != "x$fs" ] ; then /sbin/zfs set mountpoint=$fs $be$fs fi /sbin/zfs mount -O $be$fs fi fi done
Related issues
Updated by Alexander Pyhalov almost 6 years ago
The following workaround to boot scripts was suggested: http://buildzone.oi-build.r61.net/6464/, however, it was noted, that real issue is not in boot scripts, but in libbe, which shouldn't change zfs mountpoint property while mounting BE.
Updated by Alexander Pyhalov over 5 years ago
- Subject changed from /lib/svc/method/fs-minimal should correct fs mountpoints to libbe shouldn't mangle zfs mountpoints
After discussion on mailing list it was evident that root cause of the issue is default libbe behavior. Currently when it mounts boot environment, it sets zfs mountpoints of BE's filesystems to temporary location. In fact, it shouldn't touch zfs mountpoint properties of corresponding datasets and just use plain mount(2) to mount them.
Updated by Electric Monk over 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit 3a8761925c0ebb25868080d8dd07b12a2cc0d0ea
commit 3a8761925c0ebb25868080d8dd07b12a2cc0d0ea Author: Alexander Pyhalov <apyhalov@gmail.com> Date: 2016-12-22T18:01:17.000Z 6464 libbe shouldn't mangle zfs mountpoints Reviewed by: Igor Kozhukhov <igor@dilos.org> Reviewed by: Toomas Soome <tsoome@me.com> Approved by: Dan McDonald <danmcd@omniti.com>
Updated by Dan McDonald over 5 years ago
- Related to Bug #7767: 6464's call to mount() is incomplete added
Actions