GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Filesys::ZFS(3) User Contributed Perl Documentation Filesys::ZFS(3)

Filesys::ZFS

use Filesys::ZFS;

Filesys::ZFS is a simple interface to zfs and zpool commands for managing ZFS file systems

Create a new Filesys::ZFS object and return it.

OPTIONS

Various options can be passed to the new() method

zpool
Path to the zpool command, defaults to /sbin/zpool
zfs
Path to the zfs command, defaults to /sbin/zfs
no_root_check
Don't warn if the calling program isn't root.

Initialize. Read the various file system details. This method must be run prior to just about anything else working. If file system details change init() should be run again.

Returns an object list

TYPE

pools
Returns file system / Pools data (if any)
snapshots
Returns snapshots (if any)
volumes
Retruns volumes (if any)
bookmarks
Returns bookmarks (if any)

Return the pool / snapshot / volume / bookmark name provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Pool: " . $pool->name . "\n";
 }

Return the pool / snapshot / volume / bookmark state provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Current state: " . $pool->state . "\n";
 }

Return the pool / snapshot / volume / bookmark errors provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Current errors: " . $pool->errors . "\n";
 }

Return the pool / volume mount point (if available) provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Mount point: " . $pool->mount . "\n";
 }

Return the pool / volume scan message (if available) provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Last scan: " . $pool->scan . "\n";
 }

Return the pool / volume free space (in KB) provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Free Space: " . $pool->free . "\n";
 }

Return the pool / volume used space (in KB) provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Used Space: " . $pool->used . "\n";
 }

Return the pool / volume referenced space (in KB) provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Referencing: " . $pool->referenced . "\n";
 }

Return the pool / volume current status message provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Current status: " . $pool->status . "\n";
 }

Return the pool / volume current action message provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Requested action: " . $pool->action . "\n";
 }

Return the pool / volume read errors (if any) provided by the list() method

Return the pool / volume write errors (if any) provided by the list() method

Return the pool / volume checksum errors (if any) provided by the list() method

Return the pool / volume error note (if any) provided by the list() method

Return the pool / volume / snapshot / bookmark raw configuration message provided by the list() method

 for my $pool ($ZFS->list('pools')){
        print "Configuration: " . $pool->config . "\n";
 }

The providers() method is intended to be called from a list() object initially, it returns a list of pool / volume providers, such as virtual devices or block devices.

The resulting list returned is a list of provider objects, which can be used to call the standard name(), read(), write(), cksum() , state() and note() methods defined above.

Additionally providers() can be called with a providers() object, allowing you to successully recruse through the providers stack. An example of this is as follows:

 prov($list_obj)

 sub prov {
        my ($p) = @_;
        for my $prov ($p->providers){
                if($prov->is_vdev){
                        print "\tVirtual Device: " . $prov->name . "\n";
                        prov($prov);
                } else {
                        print "\tBlock Device: " . $prov->name . "\n";
                }
        }
 }

Return true if the NAME device is a virtual device (vdev) of some kind or a regular block device or file

If NAME is omitted then the object name is used. This is useful when calling is_dev() from a providers() return:

Return true if all zpools are in a healthy state. This can be called without initializing with init()

Return a list (in order) of all property keys for POOL, which can be a pool / file system / volume, etc.

Return a two element list of the property value, and default for the property key PROPERTY_KEY in POOL pool / file system / volume.

Return the last error string captured if any.

This library is licensed under the Perl Artistic license and may be used, modified, and copied under it's terms.

This library was authorized by Colin Faber <cfaber@fpsn.net>. Please contact the author with any questions.

Please report all bugs to https://rt.cpan.org/Dist/Display.html?Status=Active&Queue=Filesys-ZFS
2014-09-06 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.