sridhar surampudi
2010-Oct-09 20:18 UTC
[zfs-discuss] best way to check zfs/zpool version programatically
Hi, what is the right way to check versions of zfs and zpool ?? I am writing piece of code which call zfs command line further. Before actually initiating and going ahead I wan to check the kind of version zfs and zpool present on the system. As an example "zpool split" is not present on prior to 134 build (not sure exactly) so if an application using my code should fail if "zpool split" is called. Is there any zfs version or zpool version command present in recent updates? or is there any other way ( reading some file ) I can get these details? Thanks & Regards, sridhar. -- This message posted from opensolaris.org
Edho P Arief
2010-Oct-09 20:29 UTC
[zfs-discuss] best way to check zfs/zpool version programatically
On Sun, Oct 10, 2010 at 3:18 AM, sridhar surampudi <toyours_sridhar at yahoo.co.in> wrote:> Hi, > > what is the right way to check versions of zfs and zpool ?? > > I am writing piece of code which call zfs command line further. Before actually initiating and going ahead I wan to check the kind of version zfs and zpool present on the system. > > As an example "zpool split" is not present on prior to 134 build (not sure exactly) so if an application using my code should fail if "zpool split" is called. > > Is there any zfs version or zpool version command present in recent updates? or is there any other way ( reading some file ) I can get these details? > >zfs upgrade zpool upgrade ? -- O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
Richard Elling
2010-Oct-10 05:03 UTC
[zfs-discuss] best way to check zfs/zpool version programatically
On Oct 9, 2010, at 1:18 PM, sridhar surampudi wrote:> Hi, > > what is the right way to check versions of zfs and zpool ??zpool get version POOLNAME zfs get version DATASET> I am writing piece of code which call zfs command line further. Before actually initiating and going ahead I wan to check the kind of version zfs and zpool present on the system. > > As an example "zpool split" is not present on prior to 134 build (not sure exactly) so if an application using my code should fail if "zpool split" is called. > > Is there any zfs version or zpool version command present in recent updates? or is there any other way ( reading some file ) I can get these details?For easy parsing, zfs get -H -o value version DATASET Alas, there is not a zpool equivalent :-( zpool get version POOLNAME | tail -1 | awk ''{print $3}'' -- richard