Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZFS zpool won't automount on boot [solved]
View unanswered posts
View posts from last 24 hours

Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message

Joined: 21 May 2015
Posts: 34

PostPosted: Sun Aug 23, 2015 9:40 pm    Post subject: ZFS zpool won't automount on boot [solved] Reply with quote

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:
# zpool create -o ashift=12 -R /mnt tank mirror /dev/disk/by-id/myDisk01 /dev/disk/by-id/myDisk02
The ashift because i have AFD disks, -R because i don't like stuff at /.

Upon reboot, i confirmed the module had been loaded:
# 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
Yet i had no zpool:
# 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:
# 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
and now it boots with the zpool mounted.

However, it doesn't seem to honor all properties:
# zpool get altroot,cachefile,ashift tank
tank    altroot    -          default
tank    cachefile  -          default
tank    ashift     12         local
It gets mounted as /tank instead of /mnt/tank.
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum