docs.daveops.net

Snippets for yer computer needs

File Systems

Filesystems here are either networked or OS-agnostic

ZFS

Compression

caveat - compression is not retroactive, so you should set it on the pool immediately after creation

# See compression settings
zfs get compression
# See compression efficiency
zfs get compressratio
# Set compression (types: lzjb, lz4, gzip-[1-9])
zfs set compression=$TYPE $POOL

Delegate administrative tasks

https://blogs.oracle.com/marks/entry/zfs_delegated_administration

zfs allow

Snapshots

# List snapshots
zfs list -t snapshot
# Delete a snapshot
zfs destroy tank/home/thing@tuesday

Rollback

By default, ZFS rollback cannot revert to anything beyond the most recent snapshot. -r lets you go earlier, although this is a destructive operation and deletes the intermediate snapshots

zfs rollback tanks/home/dave@tuesday

See disks

zpool list

References

NFS

Install NFS

# Install nfs-utils (Red Hat) or nfs-common (Ubuntu)
modprobe nfs
mkdir /repo
mount -t nfs4 -o proto=tcp,port=2049 host:/repo /repo

Show exports

showmount -e $HOST

Samba

Remotely shut down Windows machine

net rpc shutdown -I ipAddressOfWindowsPC -U username%password

IPFS

# Initialize an IPFS system
ipfs init

bcachefs

https://bcachefs.org/

ncdu

Only count files on same mounted filesystem

ncdu -x $MOUNT_POINT