solaris 11 cheat sheet zfs admin and disks

Create a ZFS pool with a single disk:
# zpool create testpool c3t2d0

Create a ZFS pool with 3 disks in RAID0 configuration:
# zpool create testpool c3t2d0 c3t3d0 c3t4d0

Create a ZFS pool with 3 disks in RAID1 configuration:
# zpool create testpool mirror c3t2d0 c3t3d0 c3t4d0

Create a ZFS pool with 3 disks in a RAIDZ configuration (single parity):
# zpool create testpool raidz c2t2d0 c3t3d0 c3t4d0

Create a ZFS pool with 1 disk and 1 disk as seperate ZIL (ZFS Intent Log):
# zpool create testpool c3t2d0 log c3t3d0

Create a ZFS pool with 1 disk and 1 disk as L2ARC (Level 2 storage cache):
# zpool create testpool c3t2d0 cache c3t3d0

Share a filesystem via NFS:
# zfs create zpool/fs1
# zfs set share=name=fs1,path=/rpool/fs1,prot=nfs rpool/fs1 # zfs set sharenfs=on rpool/fs1

Share a filesystem via CIFS:
# pkg install service/filesystem/smb
# svcadm enable -r smb/server
# echo "other password required pam_smb_passwd.so.1 nowarn" \ >> /etc/pam.conf
# smbadm enable-user joerg
# zfs set share=name=sh1,path=/rpool/fs1,prot=smb rpool/fs1
# zfs set sharesmb=on rpool/fs1

Use shadow migration:
# pkg install shadow-migration
# svcadm enable shadowd
# zfs set readonly=on path/to/data
# zfs create -o shadow=file:///path/to/data \
target/new/path/to/data

Show all disks on a system:
# cfgadm -s "select=type(disk)"

Configure a disk to be used via iSCSI
# svcadm enable svc:/network/iscsi/initiator
# iscsiadm modify initiator-node -A myclient
# iscsiadm add discovery-address 10.211.55.200 # iscsiadm discovery -t enable
# devfsadm -c iscsi

Replace a faulty disk c1t1d0 from ZFS pool testpool:
# zpool offline testpool c1t1d0
# cfgadm -c unconfigure c1::dsk/c1t1d0
# cfgadm -c configure c1::dsk/c1t1d0
# zpool replace testpool c1t1d0
# zpool online testpool c1t1d0

Mirror existing boot disk c3t0d0s0 with disk c3t2d0s0
# fdisk -B c3t2d0s0
# prvtoc /dev/rdsk/c3t0d0s0 | fmthard -s - /dev/rdsk/c3t2d0s0 On x86 systems:
# installgrub /boot/grub/stage1 /boot/grub/stage2 \ /dev/rdsk/c3t2d0s0
On SPARC systems:
# installboot -F zfs \
/usr/platform/`uname -i`/lib/fs/zfs/bootblk/dev/rdsk/c3t2d0s0

This entry was posted in solaris. Bookmark the permalink.

Comments are closed.