Openunix.eu


Solaris

ZFS zpool commands

# zpool list Show existing pools
# zpool create space mirror /dev/dsk/c4t4d0 /dev/dsk/c4t5d0 Create a raid1 mirror using two disks
# zpool detach space c4t5d0 Remove one drive from this mirror:
# zpool attach space c4t4d0 c4t5d0 Add back that drive to this mirror:
# zpool offline space c4t0d0 Make one drive go offline for enlargement
# zpool online space c4t0d0 Make enlarged drive go back to raid
# zpool status space Check pool status

ZFS basic commands

# zfs list Show existing ZFS filesystems
# zfs create space/slice0 Make new filesystem (inside the space pool) and mount it in /space/slice0
# zfs rename space/slice0 space/slice1 Rename the filesystem (inside the space pool)
# zfs destroy space/slice1 Remove the filesystem (inside the space pool)
# zfs create -o mountpoint=/cool space/slice1 Make new fs (inside the space pool) and mount it in /cool directory
# zfs set quota=500m space/slice1 Limit the /cool slice to 500MB
# zfs set userquota@frantisek=300M space/slice1 Show user quota for frantisek
# zfs get userquota@frantisek space/slice1 Show user quota for frantisek on that FS
# zfs set groupquota@staff=1G space/slice1 Set group quota on the slice
# zfs get groupquota@staff space/slice1 Show group quota on the slice
# zfs userspace space/slice1 Get info about all userquotas
# zfs set reservation=150m space/slice1/subslice0 Reserve some space on a slice
# zfs get reservation space/slice1/subslice0 Get info about the reservation

ZFS snapshots

# zfs snapshot space/slice1@tuesday Create a snapshot of a filesystem and call that snapshot tuesday
# zfs snapshot -r space/slice1@fiveaclock Create a snapshot of a filesystem with all recursive filesystems
# zfs list -t snapshots List available snapshots
# ls /space/space/slice1/.zfs/snapshot/fiveaclock/ Walk through the snapshot
# zfs rollback space/slice1@fiveaclock Revert back to the snapshot
# zfs rollback -r space/slice1@monday Revert back to the earlier snapshot over existing newer snapshots
# zfs snapshot -r space/slice1@fiveaclock
# zfs clone space/slice1@fiveaclock space/fiveaclockclone
Create a clone (a new fs with a status of one moment of the fs)
#zfs destroy space/fiveaclockclone Destroy a clone - CLONE IS NOT A FULLFEATURED COPY OF THE FS
# zfs snapshot -r space/slice1@sixaclock
# zfs send space/slice1@sixaclock |zfs rcv space/slice3
ZFS SEND creates a full featured copy of the fs (first snap and then clone)
 

Powered by OpenBSD. Puffy on duty!