Linux filesystem hacks

December 18, 2019 — December 21, 2019

computers are awful
posix

Assumed audience:

Low-key devs and sysops and people with more data than they can afford to keep in the cloud.

Various things I need to know to minimise fuss in reading, writing and moving data.

1 TRIM for SSDs

There is this whole long story about SSDs and their care and feeding. One needs to enable TRIM for optimal SSD usage; as that link explains there might be security downsides. This friendlier guide soothingly omits any security downsides but is easier to follow.

2 ExFAT

ExFAT is what big USB drives are formatted as.

I needed to install it on my Ubuntu for interoperability with external drives

sudo apt install exfat-fuse exfat-utils

3 NTFS

NTFS is what modern windows machines are formatted as, and some USB drives too.

Short version: NTFS can be whipped into providing a POSIX-compatible FS, with OK performance and is a good interchange system on a dual-boot Windows/Linux machine. (Although I don’t know how to make it encrypt in a way Windows can understand. I can do full POSIX compliance, i.e. be a real Linux drive. Possibly Veracrypt?) ExFAT is also OK but does not have as many features, lacking e.g. user ownership and flexible case sensitivity. FAT32 is a metadata nightmare and causes all sorts of nasty issues. NTFS can be made to not cause these issues, but you need to set it up right.

4 LVM

Logical Volume Management has been current for a decade, which means that it is one decade newer than what I’m used to. It’s confusing and has a lot of moving parts and its own terminology.

Key terms: physical volume which is the base storage layer (which need not be remotely physical, in that it can be anything that emulates a block device AFAICT.) volume group which is some aggregation of physical devices I think (but for me the aggregate only ever has one disk in it, so it is some kind of pointless indirection layer over the not-necessarily-physical-volume) and logical volume which is a user-usable virtual partition on top of a volume group on top of a physical volume. AFAICS there is nothing stopping you from nesting LVMs inside LVMs, but it is presumably silly. The exception might be that putting LVM inside encrypted volumes is the modern accepted way to do whole disk encryption for Ubuntu. More on that shortly.

5 Encrypted

See linux FS encryption.