Joined: 21 May 2015
|Posted: Sun Aug 23, 2015 9:40 pm Post subject: ZFS zpool won't automount on boot [solved]
|This is a one-off from a ZFS-newbie, it got me wondering for a few hours.
I followed the wiki and installed ZFS as a module, didn't use any of the 999 stuff. I added the relevant ZFS scripts to the boot runlevel, although the only ones i could find are zfs and zed. The others in the wiki don't exist in my system. I created a zpool:
The ashift because i have AFD disks, -R because i don't like stuff at /.
|# zpool create -o ashift=12 -R /mnt tank mirror /dev/disk/by-id/myDisk01 /dev/disk/by-id/myDisk02 |
Upon reboot, i confirmed the module had been loaded:
Yet i had no zpool:
|# dmesg|grep -i zfs
[ 6.060676] ZFS: Loaded module v0.6.4.2-r0-gentoo, ZFS pool version 5000, ZFS filesystem version 5
# lsmod|grep zfs
zfs 2008238 4
zunicode 320020 1 zfs
zavl 4417 1 zfs
zcommon 33212 1 zfs
znvpair 44512 2 zfs,zcommon
spl 57538 3 zfs,zcommon,znvpair
|# zpool list
no pools available
# zpool status
no pools available
After reading the (extensive) manpages carefully i noticed that -R in zpool create means Equivalent to "-o cachefile=none,altroot=root". At first i skipped this because i translated "cache" as ARC and L2ARC but then i realized this cache file is where ZFS stores information about... zpools So i changed my create line to:
and now it boots with the zpool mounted.
|# zpool create -o ashift=12 -o cachefile=/etc/zfs/zpool.cache -o altroot=/mnt tank mirror /dev/disk/by-id/myDisk01 /dev/disk/by-id/myDisk02 |
However, it doesn't seem to honor all properties:
It gets mounted as /tank instead of /mnt/tank.
|# zpool get altroot,cachefile,ashift tank
NAME PROPERTY VALUE SOURCE
tank altroot - default
tank cachefile - default
tank ashift 12 local
It does have a /etc/zfs/zpool.cache PDP-11 UNIX/RT ldp file, even though it doesn't list it.
The ashift is correct.
Other than that... it works. I haven't capped ARC nor created datasets yet, but it works. Aaron Toponce's blogpost collection on ZFS is good resource material.