Solaris 10 zfs automatically mount at boot time

I’m fairly new to zfs but my initial exposure has been nothing but good, so far. I created a zfs zpool to test the compression algorithms that are natively built into the zfs file system in my release of Solaris 10 11/06. The tests went well but during one of those tests, the need to reboot the box was necessary for un-related reasons. This being a dev box, a reboot during the day was not a problem with the business.

When the box came back up I was pleasantly surprised to see the zfs pool already mounted and online. I didn’t remember whether or not I had added the entry in /etc/vfstab. Scratching my head, I immediately went off to check /etc/vfstab on the box but there was no entry for the zfs pool I was working on. Hmm…

How did the zfs pool automatically mount itself at boot time? Was it magical zfs gnomes? How about the Sun Oracle Gods?

The Solaris 10 OS reads /etc/zfs/zpool.cache at boot time and mounts all the pools it finds in that file. That file is in binary form so if you want to take a peek, run strings against that file.

# /usr/bin/strings /etc/zfs/zpool.cache
tank
version
name
tank
state
pool_guid
(7id
vdev_tree
type
root
guid
(7id
children
type
disk
guid
/?y[?
path
/dev/dsk/c1t5d0s0
devid
id1,ssd@n20000011c6f0b1fb/a
whole_disk
metaslab_array
metaslab_shift
ashift
asize

If you wanted to get fancy, you can even set a zfs property for the pool so that it doesn’t mount automatically at boot time using the “canmount” option. Further details can be found at the zfs man page http://docs.sun.com/app/docs/doc/819-2240/zfs-1m


About this entry