Robert Prus - Solution Architect, Systems Practice - Sun Poland
2007-Jul-19 08:02 UTC
[zfs-discuss] ZFS boot process - where from ZFS knows which pools/datasets should be mounted after OS reboot?
Hi, I have a question concerning booting Solaris (SPARC/X64) with some ZFS storage pools/datasets created and mounted. Where from Solaris/ZFS knows which storage pools/datasets should be mounted after reboot??? ZFS is not using at all /etc/vfstab configuration file (I exclude here case where we set mountpoint=legacy). My understanding is that ZFS kernel modules are writing some information about mounting state of storage pools/datasets to disks just before unloading (of ZFS kernel modules). When Solaris boots, it is loading ZFS kernel modules. These kernel modules are checking all disks devices in /dev, /devices directories for possibility of performing silent ''zpool import -a''. Anybody could confirm/deny above statements??? Greetings and thanks in advance, Robert
Robert Milkowski
2007-Jul-19 08:12 UTC
[zfs-discuss] ZFS boot process - where from ZFS knows which pools/datasets should be mounted after OS reboot?
Hello Systems, Thursday, July 19, 2007, 9:02:06 AM, you wrote: RPSASPSP> Hi, RPSASPSP> I have a question concerning booting Solaris (SPARC/X64) with some ZFS RPSASPSP> storage pools/datasets created and mounted. RPSASPSP> Where from Solaris/ZFS knows which storage pools/datasets should be RPSASPSP> mounted after reboot??? RPSASPSP> ZFS is not using at all /etc/vfstab configuration file (I exclude here RPSASPSP> case where we set mountpoint=legacy). RPSASPSP> My understanding is that ZFS kernel modules are writing some information RPSASPSP> about mounting state of storage pools/datasets to disks just before RPSASPSP> unloading (of ZFS kernel modules). When Solaris boots, it is loading ZFS RPSASPSP> kernel modules. These kernel modules are checking all disks devices in RPSASPSP> /dev, /devices directories for possibility of performing silent ''zpool RPSASPSP> import -a''. RPSASPSP> Anybody could confirm/deny above statements??? Every time you create new pool or import one ine a system, without -R option, the pool name/id and its devices are written to a binary file /etc/zfs/zpool.cache Now when zfs modules are being initialized that file is checked and loaded, then zfs tries to import all pools which are in that file. Devices which were put there are meant to speed up import - unless anything changed with disks you will not have to scann all disks in a system to import those pools. Then check /lib/svc/method/fs-local and at the end you''ll find ''zfs mount -a'' command. -- Best regards, Robert mailto:rmilkowski at task.gda.pl http://milek.blogspot.com
Andre Wenas
2007-Jul-26 13:51 UTC
[zfs-discuss] ZFS boot process - where from ZFS knows which pools/datasets should be mounted after OS reboot?
You need to specify your boot zfs pool in grub menu.lst: # ZFS boot title Solaris ZFS root (hd0,3,d) *bootfs rootpool/rootfs *kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS module$ /platform/i86pc/$ISADIR/boot_archive In this example, the bootfs is rootpool/rootfs. Grub will load the kernel & boot_archive from this pool. Rgds, Andre W. Robert Prus - Solution Architect, Systems Practice - Sun Poland wrote:> Hi, > > I have a question concerning booting Solaris (SPARC/X64) with some ZFS > storage pools/datasets created and mounted. > > Where from Solaris/ZFS knows which storage pools/datasets should be > mounted after reboot??? > > ZFS is not using at all /etc/vfstab configuration file (I exclude here > case where we set mountpoint=legacy). > > My understanding is that ZFS kernel modules are writing some information > about mounting state of storage pools/datasets to disks just before > unloading (of ZFS kernel modules). When Solaris boots, it is loading ZFS > kernel modules. These kernel modules are checking all disks devices in > /dev, /devices directories for possibility of performing silent ''zpool > import -a''. > > Anybody could confirm/deny above statements??? > > Greetings and thanks in advance, > > Robert > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >
Tim Foster
2007-Jul-26 14:05 UTC
[zfs-discuss] ZFS boot process - where from ZFS knows which pools/datasets should be mounted after OS reboot?
hi there, On Thu, 2007-07-26 at 21:51 +0800, Andre Wenas wrote:> You need to specify your boot zfs pool in grub menu.lst:Hang on, I''m not sure that was the point of the question.> Robert Prus - Solution Architect, Systems Practice - Sun Poland wrote: > > Where from Solaris/ZFS knows which storage pools/datasets should be > > mounted after reboot???The pool data is cached in a binary file /etc/zfs/zpool.cache. This determines which pools are visible to the system.> > ZFS is not using at all /etc/vfstab configuration file (I exclude here > > case where we set mountpoint=legacy).Right.> > My understanding is that ZFS kernel modules are writing some information > > about mounting state of storage pools/datasets to disks just before > > unloading (of ZFS kernel modules).If a given pool is visible to the system, then if the "mountpoint" property is set to something other than "legacy" or "none", then this is mounted at boot (unless the "canmount" property is set to off, if that''s available in the version of ZFS you''re looking at) This is documented in the ZFS man page.> When Solaris boots, it is loading ZFS > > kernel modules. These kernel modules are checking all disks devices in > > /dev, /devices directories for possibility of performing silent ''zpool > > import -a''.Not so - we don''t do a zpool import -a, rather we go on the zpool.cache file. If that file isn''t present, you''ll need to manually zpool import pools in order for the system to see them. cheers, tim -- Tim Foster, Sun Microsystems Inc, Solaris Engineering Ops http://blogs.sun.com/timf