Gentoo Archives: gentoo-user

From: Volker Armin Hemmann <volkerarmin@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] preserving zpool mountpoint on boot?
Date: Mon, 14 Sep 2015 05:30:48
Message-Id: 55F65B7B.4020305@googlemail.com
In Reply to: [gentoo-user] preserving zpool mountpoint on boot? by "Nuno Magalhães"
1 Am 13.09.2015 um 21:20 schrieb Nuno Magalhães:
2 > Greetings,
3 >
4 > If i export/import a zpool, the altroot property is not preserved so
5 > it always gets mounted at /.
6 >
7 > In /etc/init.d/zfs, the import line reads
8 > $ZPOOL import -c $ZPOOL_CACHE -aN 2>/dev/null || true
9 > so no -options there.
10 >
11 > I've also tried with
12 > zpool import -o altroot=/mnt -o cachefile=/etc/zfs/zpool.cache poolname
13 > which works, but the cache file only lives until export, so i assume
14 > it's not some kind of configuration save point. A simple import
15 > afterwards will place the pool at / again. Same for -R.
16 >
17 > Is there some option i can put in /etc/modprobe.d/zfs.conf (which
18 > currently doesn't exist)?
19 >
20 no
21
22 man zfs
23
24 Mount Points
25 Creating a ZFS file system is a simple operation, so the number
26 of file systems per system is likely to be numerous. To cope with this, ZFS
27 automatically manages mounting and unmounting file systems
28 without the need to edit the /etc/fstab file. All automatically managed
29 file sys-
30 tems are mounted by ZFS at boot time.
31
32
33 By default, file systems are mounted under /path, where path
34 is the name of the file system in the ZFS namespace. Directories are created
35 and destroyed as needed.
36
37
38 A file system can also have a mount point set in the mountpoint
39 property. This directory is created as needed, and ZFS automatically mounts
40 the file system when the zfs mount -a command is invoked
41 (without editing /etc/fstab). The mountpoint property can be inherited,
42 so if
43 pool/home has a mount point of /export/stuff, then pool/home/user
44 automatically inherits a mount point of /export/stuff/user.
45
46
47 A file system mountpoint property of none prevents the file
48 system from being mounted.
49
50
51 If needed, ZFS file systems can also be managed with traditional
52 tools (mount, umount, /etc/fstab). If a file system's mount point is set to
53 legacy, ZFS makes no attempt to manage the file system, and the
54 administrator is responsible for mounting and unmounting the file system.

Replies

Subject Author
Re: [gentoo-user] preserving zpool mountpoint on boot? "Nuno Magalhães" <nunomagalhaes@××××××.pt>