User Tools

Site Tools


computing:zfsreminders

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:zfsreminders [2022/08/05 23:19] oemb1905computing:zfsreminders [2024/04/21 23:12] (current) oemb1905
Line 1: Line 1:
 +-------------------------------------------
 +  * **zfsreminders** 
 +  * **Jonathan Haack**
 +  * **Haack's Networking**
 +  * **webmaster@haacksnetworking.org**
 +
 +-------------------------------------------
 +
 +//zfsreminders//      
 +
 +-------------------------------------------
 +
 Create a pool on a single drive and specify a mountpoint for it. Note: use id, not uuid. Create a pool on a single drive and specify a mountpoint for it. Note: use id, not uuid.
  
Line 34: Line 46:
   zfs load-key pool/dataset   zfs load-key pool/dataset
   zfs mount pool/dataset   zfs mount pool/dataset
 +  
 +If you need to delete a dataset, do the following:
 +
 +  zfs destroy -r pool/dataset
      
 To create snapshots, here is a reasonable template: To create snapshots, here is a reasonable template:
Line 44: Line 60:
   zfs list -H -o name -t snapshot | xargs -n1 zfs destroy   zfs list -H -o name -t snapshot | xargs -n1 zfs destroy
      
-To add a zfs cache hard drive to your pool, do the following:+To add a zfs cache or slog hard drive to your pool, do the following:
  
   zpool add pool cache /dev/disk/by-id/3434...   zpool add pool cache /dev/disk/by-id/3434...
 +  zpool add pool log /dev/disk/by-id/3434...
  
 To view current snapshots, do the following: To view current snapshots, do the following:
Line 57: Line 74:
   zfs list -ro space   zfs list -ro space
      
-To replace a drive, power down the host. Physically remove the failed drive and replace with a new drive.+To replace a failed drive, power down the hostremove drive, reboot, get ''by-id'' of the new driveand run ''zpool status -v'' for hard drive number of old drive, then do:
  
-  sudo zpool replace pool 2277585469358930581 /dev/disk/by-id/ata-WDC_WD...+  sudo zpool replace pool <hard-drive-number> /dev/disk/by-id/</dev/disk/by-id/newdrive> 
 +  sudo zpool replace pool 3347762980558930904 /dev/disk/by-id/ata-WDC_WD...
  
 +To check the health, statistics, and basic specs of your pool:
 +
 +  zpool status -v
 +  zpool iostat -v
 +  zpool list -v
 +  
 +Also, to see whether cache volume is necessary, run and look at cache hit/miss ratio:
 +
 +  arc_summary
 +
 +Change location of the keys for your encrypted datasets:
 +
 +  sudo zfs set keylocation=file:///keys/my.key mypool/mydataset
 +  
 +Send and receive entire pool to new pool
 +
 +  zfs snapshot -r pool1@latestsnap
 +  zfs send -R pool1@latestsnap | zfs receive -F pool2
 +  
 +Arc information
 +  
 +  arcstat
 +  arc_summary -d | less
 +  nano /etc/modprobe.d/zfs.conf
 +  <# 8GB example - 8*(2^30) = below>
 +  <#options zfs zfs_arc_max=8589934592>
 +  <# Set Max ARC size => 2GB == 2147483648 Bytes>
 +  <options zfs zfs_arc_max=2147483648>
 +  <# Set Min ARC size => 1GB == 1073741824>
 +  <options zfs zfs_arc_min=1073741824>
 +  cat /sys/module/zfs/parameters/zfs_arc_min
 +  cat /sys/module/zfs/parameters/zfs_arc_max
  
 +More examples ... 
  
- --- //[[jonathan@haacksnetworking.org|oemb1905]] 2022/08/05 14:35//+ --- //[[webmaster@haacksnetworking.org|oemb1905]] 2024/04/21 23:12//
computing/zfsreminders.1659741597.txt.gz · Last modified: 2022/08/05 23:19 by oemb1905