[ZFS] Automount na reboot werkt niet (Debian Jessie)

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • Simkin
  • Registratie: Maart 2000
  • Laatst online: 09:53
Ik heb onlangs ZFS/SPl gecompileerd vanuit source omdat de ZFS module niet meer geladen werd na een kernel update. Dit heeft mijn ZFS probleem slechts gedeeltelijk opgelost aangezien ik nu elke keer een "zpool import poolnaam" uit moet voeren om mijn pool te mounten ("zpool import -a" werkt ook).

Na wat gegoogle kwam ik erachter dat er een service bestaat die hier verantwoordelijk is (correct me please) maar deze lijkt niet goed te werken en het lukt me niet om alleen het probleem op te lossen. Mocht iemand een idee hebben dan hoor ik het heel graag!

root@nas:~# uname -a
code:
1
Linux nas 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u1 (2016-09-03) x86_64 GNU/Linux


root@nas:~# dmesg | grep ZFS
code:
1
[    4.241067] ZFS: Loaded module v0.7.0-rc2_78_gd57f03e, ZFS pool version 5000, ZFS filesystem version 5


root@nas:~# systemctl status zfs-import-cache
code:
1
2
3
4
5
● zfs-import-cache.service
   Loaded: masked (/dev/null)
   Active: inactive (dead)

Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.

root@nas:~# systemctl daemon-reload
root@nas:~# systemctl disable zfs-import-cache
code:
1
2
Removed symlink /etc/systemd/system/zfs.target.wants/zfs-import-cache.service.
Removed symlink /etc/systemd/system/zfs-mount.service.wants/zfs-import-cache.service.

root@nas:~# systemctl enable zfs-import-cache
code:
1
2
Created symlink from /etc/systemd/system/zfs-mount.service.wants/zfs-import-cache.service to /usr/lib/systemd/system/zfs-import-cache.service.
Created symlink from /etc/systemd/system/zfs.target.wants/zfs-import-cache.service to /usr/lib/systemd/system/zfs-import-cache.service.


Na een reboot wordt de pool niet geïmporteerd en gemount. Volgens mij werkt de service niet? (masked error)

root@nas:~# systemctl stop zfs-import-cache.service
root@nas:~# systemctl start zfs-import-cache.service
code:
1
Failed to start zfs-import-cache.service: Unit zfs-import-cache.service is masked.


root@nas:~# systemctl list-unit-files | grep zfs
code:
1
2
3
4
5
6
zfs-import-cache.service                   masked
zfs-import-scan.service                    masked
zfs-mount.service                          masked
zfs-share.service                          masked
zfs-zed.service                            masked
zfs.target                                 masked


root@nas:~# cat /usr/lib/systemd/system/zfs-import-cache.service
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[Unit]
Description=Import ZFS pools by cache file
DefaultDependencies=no
Requires=systemd-udev-settle.service
After=systemd-udev-settle.service
After=cryptsetup.target
After=systemd-remount-fs.service
Before=dracut-mount.service
ConditionPathExists=/usr/local/etc/zfs/zpool.cache

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/sbin/modprobe zfs
ExecStart=/usr/local/sbin/zpool import -c /usr/local/etc/zfs/zpool.cache -aN

[Install]
WantedBy=zfs-mount.service
WantedBy=zfs.target


root@nas:~# cat /etc/default/zfs
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# ZoL userland configuration.

# To enable a boolean setting, set it to yes, on, true, or 1.
# Anything else will be interpreted as unset.

# Run `zfs mount -a` during system start?
ZFS_MOUNT='yes'

# Run `zfs unmount -a` during system stop?
ZFS_UNMOUNT='yes'

# Run `zfs share -a` during system start?
# nb: The shareiscsi, sharenfs, and sharesmb dataset properties.
ZFS_SHARE='yes'

# Run `zfs unshare -a` during system stop?
ZFS_UNSHARE='yes'

# By default, a verbatim import of all pools is performed at boot based on the
# contents of the default zpool cache file.  The contents of the cache are
# managed automatically by the 'zpool import' and 'zpool export' commands.
#
# By setting this to 'yes', the system will instead search all devices for
# pools and attempt to import them all at boot, even those that have been
# exported.  Under this mode, the search path can be controlled by the
# ZPOOL_IMPORT_PATH variable and a list of pools that should not be imported
# can be listed in the ZFS_POOL_EXCEPTIONS variable.
#
# Note that importing all visible pools may include pools that you don't
# expect, such as those on removable devices and SANs, and those pools may
# proceed to mount themselves in places you do not want them to.  The results
# can be unpredictable and possibly dangerous.  Only enable this option if you
# understand this risk and have complete physical control over your system and
# SAN to prevent the insertion of malicious pools.
ZPOOL_IMPORT_ALL_VISIBLE='no'

# Specify specific path(s) to look for device nodes and/or links for the
# pool import(s). See zpool(8) for more information about this variable.
# It supersedes the old USE_DISK_BY_ID which indicated that it would only
# try '/dev/disk/by-id'.
# The old variable will still work in the code, but is deprecated.
#ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id"

# List of pools that should NOT be imported at boot
# when ZPOOL_IMPORT_ALL_VISIBLE is 'yes'.
# This is a space separated list.
#ZFS_POOL_EXCEPTIONS="test2"

# List of pools that SHOULD be imported at boot by the initramfs
# instead of trying to import all available pools.  If this is set
# then ZFS_POOL_EXCEPTIONS is ignored.
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
# This is a semi-colon separated list.
#ZFS_POOL_IMPORT="pool1;pool2"

# Should the datasets be mounted verbosely?
# A mount counter will be used when mounting if set to 'yes'.
VERBOSE_MOUNT='no'

# Should we allow overlay mounts?
# This is standard in Linux, but not ZFS which comes from Solaris where this
# is not allowed).
DO_OVERLAY_MOUNTS='no'

# Any additional option to the 'zfs import' commandline?
# Include '-o' for each option wanted.
# You don't need to put '-f' in here, unless you want it ALL the time.
# Using the option 'zfsforce=1' on the grub/kernel command line will
# do the same, but on a case-to-case basis.
ZPOOL_IMPORT_OPTS=""

# Full path to the ZFS cache file?
# See "cachefile" in zpool(8).
# The default is "/usr/local/etc/zfs/zpool.cache".
#ZPOOL_CACHE="/usr/local/etc/zfs/zpool.cache"
#
# Setting ZPOOL_CACHE to an empty string ('') AND setting ZPOOL_IMPORT_OPTS to
# "-c /usr/local/etc/zfs/zpool.cache" will _enforce_ the use of a cache file.
# This is needed in some cases (extreme amounts of VDEVs, multipath etc).
# Generally, the use of a cache file is usually not recommended on Linux
# because it sometimes is more trouble than it's worth (laptops with external
# devices or when/if device nodes changes names).
#ZPOOL_IMPORT_OPTS="-c /usr/local/etc/zfs/zpool.cache"
#ZPOOL_CACHE=""

# Any additional option to the 'zfs mount' command line?
# Include '-o' for each option wanted.
MOUNT_EXTRA_OPTIONS=""

# Build kernel modules with the --enable-debug switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG='no'

# Build kernel modules with the --enable-debug-dmu-tx switch?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'

# Keep debugging symbols in kernel modules?
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_DKMS_DISABLE_STRIP='no'

# Wait for this many seconds in the initrd pre_mountroot?
# This delays startup and should be '0' on most systems.
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'

# Wait for this many seconds in the initrd mountroot?
# This delays startup and should be '0' on most systems. This might help on
# systems which have their ZFS root on a USB disk that takes just a little
# longer to be available
# Only applicable for Debian GNU/Linux {dkms,initramfs}.
ZFS_INITRD_POST_MODPROBE_SLEEP='0'

# List of additional datasets to mount after the root dataset is mounted?
#
# The init script will use the mountpoint specified in the 'mountpoint'
# property value in the dataset to determine where it should be mounted.
#
# This is a space separated list, and will be mounted in the order specified,
# so if one filesystem depends on a previous mountpoint, make sure to put
# them in the right order.
#
# It is not necessary to add filesystems below the root fs here. It is
# taken care of by the initrd script automatically. These are only for
# additional filesystems needed. Such as /opt, /usr/local which is not
# located under the root fs.
# Example: If root FS is 'rpool/ROOT/rootfs', this would make sense.
#ZFS_INITRD_ADDITIONAL_DATASETS="rpool/ROOT/usr rpool/ROOT/var"

# Optional arguments for the ZFS Event Daemon (ZED).
# See zed(8) for more information on available options.
#ZED_ARGS="-M"

Acties:
  • +1 Henk 'm!

  • Simkin
  • Registratie: Maart 2000
  • Laatst online: 09:53
Opgelost, sorry voor de spam. De services moesten ge-umasked worden (weer wat geleerd)

root@nas:/# systemctl unmask zfs-* (voor elke zfs service)
root@nas:/# systemctl list-unit-files | grep zfs
code:
1
2
3
4
5
6
zfs-import-cache.service                   enabled
zfs-import-scan.service                    enabled
zfs-mount.service                          enabled
zfs-share.service                          enabled
zfs-zed.service                            enabled
zfs.target                                 enabled

Acties:
  • 0 Henk 'm!

  • Sando
  • Registratie: Januari 2007
  • Niet online

Sando

Sandoichi

Exact het zelfde probleem hier.

Moest je ook nog
systemctl enable
en
update-rc.d
doen? Of is dat redundant?

Ben je er ooit achter gekomen waarom deze services masked zijn? Het gebeurt nog steeds, dus het is ergens goed voor.

Update: Dit geldt voor Ubuntu servers. Op Debian zijn de services 'generated':

code:
1
2
3
4
5
# systemctl list-unit-files | grep zfs
zfs-import.service                                                     generated
zfs-mount.service                                                      generated
zfs-share.service                                                      generated
zfs-zed.service                                                        generated

[ Voor 48% gewijzigd door Sando op 07-12-2017 13:33 ]

🇪🇺 Buy from EU (GoT)