[pve-devel] [PATCH storage] zfs: set cachefile=none when creating pool

Oguz Bektas o.bektas at proxmox.com
Thu Mar 5 14:16:24 CET 2020


the first rpool we create during setup with our installer has
cachefile=none set.

when this isn't specified, zfs defaults to /etc/zfs/zpool.cache
which later can cause problems

[0]: https://forum.proxmox.com/threads/zfs-mirror-werden-nach-reboot-nicht-mehr-automatisch-gemountet.66222/#post-298984

Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
---
 PVE/API2/Disks/ZFS.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Disks/ZFS.pm b/PVE/API2/Disks/ZFS.pm
index 551f21a..78484eb 100644
--- a/PVE/API2/Disks/ZFS.pm
+++ b/PVE/API2/Disks/ZFS.pm
@@ -371,7 +371,7 @@ __PACKAGE__->register_method ({
 	    PVE::Diskmanage::locked_disk_action(sub {
 		# create zpool with desired raidlevel
 
-		my $cmd = [$ZPOOL, 'create', '-o', "ashift=$ashift", $name];
+		my $cmd = [$ZPOOL, 'create', '-o', "cachefile=none", "ashift=$ashift", $name];
 
 		if ($raidlevel eq 'raid10') {
 		    for (my $i = 0; $i < @$devs; $i+=2) {
-- 
2.20.1




More information about the pve-devel mailing list