storage: ext4 · nvme · rsync · zstd

Storage, Backups & Log Analysis

Disk capacity, inode exhaustion, deleted-but-open files, safe rsync transfers, NVMe I/O profiling, permissions, and Nginx log parsing.

Disk Space, Inodes & Block Devices

Check capacity excluding virtual mounts, inode usage, and UUIDs.

disk df
Real filesystems only (exclude tmpfs/squashfs)
df -hT -x tmpfs -x devtmpfs -x squashfs
Inode usage per mounted filesystem
df -ih -x tmpfs -x devtmpfs
Block devices, filesystems, mountpoints, and UUIDs
lsblk -f -o NAME,SIZE,FSTYPE,MOUNTPOINT,UUID

Find Heavy Directories & Files

Stay on a single filesystem boundary while hunting space hogs.

disk cleanup
Top-level directory sizes inside /var
du -xhd1 /var | sort -hr
Find files larger than 100 MB on root FS
find / -xdev -type f -size +100M -exec ls -lh {} + | sort -k5 -hr
Interactive disk analyzer (single filesystem)
ncdu -x /

Deleted Open Files (df vs du mismatch)

Locate unlinked files still held open by running daemons.

lsof disk
Show unlinked files still holding disk blocks
lsof +L1 | sort -k7 -nr | head -n 20
Safely zero out a growing log file without breaking FD
truncate -s 0 /var/log/large.log

Rsync & Zstd Backups

Dry-run mirrors, bandwidth-capped SSH syncs, and fast archives.

backup rsync
Dry-run mirror with progress and deletions preview
rsync -avhP --delete --dry-run /var/www/ /mnt/backup/www/
Remote SSH sync capped at ~50 MB/s
rsync -avz --bwlimit=50000 -e "ssh -p 22" /var/www/ user@backup-node:/srv/backups/www/
Create dated zstd tarball of Nginx & site configs
tar --zstd -cf /root/backup-$(date +%F).tar.zst /etc/nginx /var/www/files-site

Disk I/O & SMART Health

Measure queue depth, await latency, and NVMe/SATA health.

io health
Extended I/O stats every 1s (5 samples)
iostat -xz 1 5
Per-process real-time disk activity
iotop -oPa
NVMe health & wear status
smartctl -H -A /dev/nvme0n1

Permissions, Ownership & Checksums

Normalize webroot modes cleanly and verify file integrity.

permissions integrity
Set 755 on directories and 644 on files
find /var/www/files-site -type d -exec chmod 755 {} + -o -type f -exec chmod 644 {} +
Assign web server ownership
chown -R www-data:www-data /var/www/files-site
Generate and verify SHA-256 manifest
sha256sum /var/www/files-site/* > checksums.sha256 && sha256sum -c checksums.sha256

Access & Error Log Parsing

Quick awk/grep one-liners for traffic spikes and HTTP 5xx triage.

logs parsing
Top 20 client IPs in Nginx access log
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -n 20
Count HTTP 4xx/5xx responses by URI
awk '$9 >= 400 {print $9, $7}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -n 20
Search rotated gzipped syslogs without extracting
zgrep -h -i "error" /var/log/syslog* | tail -n 30

Mounts, Fstab & Swap

Verify fstab entries before rebooting and inspect active swap.

mounts health
Validate /etc/fstab syntax and UUID targets
findmnt --verify
Dry-run mount all fstab entries
mount -a --fake --verbose
Inspect swap devices and priority
swapon --show && findmnt -t ext4,xfs

No matching command groups found on this page.