Tag: mount

Linux Disk & Filesystem: lsblk, mount, fstab, fsck

Working reference for Linux disk and filesystem management. The four-layer model (block device > partition > filesystem > mount point), lsblk for orientation, df -h vs df -i (inode exhaustion looks like out-of-space), du and ncdu for finding disk hogs, partitioning with fdisk / parted / cfdisk (and when MBR vs GPT), mkfs for ext4 / xfs / btrfs / vfat, manual mount and umount with -l lazy and lsof / fuser to find what's blocking unmount, persistent /etc/fstab (UUID-not-device, six-field syntax, mount -a to test before reboot, nofail for non-critical), the menu of mount options (noatime, nosuid, noexec), fsck only on unmounted FS, swap setup with fallocate / mkswap / swapon. Pitfalls: out of inodes, fstab blocks boot, sdX name shift, fsck on mounted, missing chmod 600 on swap.