While there appear to be many webpages explaining how to resize/shrink a volume, I haven't seen one that resizes/shrink the filesystem to exactly the right size, and then resizes/reduces the logical volume to match. The accepted approach appears to be to resize the filesystem to definitely smaller than the logical volume will be, then reducing the … Continue reading Removing exactly one physical volume from an ext4 filesystem
Category: storage
Workaround transient I/O errors
So apparently some older linux kernels have issues during times of high I/O and cause drives to be stuck reporting I/O errors until a reboot. Apparently this is a more common issue on virtual machines. If this doesn't happen to the drive containing your OS, you're lucky because you can recover from this without rebooting. … Continue reading Workaround transient I/O errors
umount mountpoint and all sub-mountpoints
A bash function to show the most reliable way I've found: unmount() { sudo umount -l $(cut -f5 -d ' ' /proc/self/mountinfo | egrep "^$1(/|$)" | sort -r | uniq | xargs) } What's wrong with /proc/mounts? If you have a "device" that's been deleted, it makes the output harder to parse. Why not just … Continue reading umount mountpoint and all sub-mountpoints
Efficient encrypted backups
Got a place to backup stuff to, but don't trust the backup location with your data? No worries, the script below encrypts your files and directories, making them easy to sync to your backup location. It uses encfs's reverse mode to encrypt your file system. (encfs is normally used to mount a decrypted version of … Continue reading Efficient encrypted backups