Storage 7
- Replace a failed disk when mdadm RAID1 shows [U_] (degraded)
Read [U_] and (F) in /proc/mdstat, replace the dead disk with fail, remove and add, then watch the resync run. Based on the mdadm man page and kernel.org wiki.
mdadm 4.3 man page · Linux RAID wiki (kernel.org) · 2026-10 - Verify fstab with findmnt before you reboot
Use findmnt --verify to catch missing UUIDs and mount points in fstab before a reboot. It misses mistyped options and a missing nofail, so check those by hand.
Ubuntu 24.04.5 LTS · util-linux 2.39.3 (findmnt) - Fix resize2fs "Bad magic number in super-block" on XFS
resize2fs "Bad magic number in super-block" means the target is not ext4, usually XFS. Check the type with df -hT, then run xfs_growfs on the mount point.
Ubuntu 24.04 (Docker) · e2fsprogs 1.47.0 · xfsprogs 6.6.0 · 2026-10 - "umount: target is busy" — find the process holding the mount
"umount: target is busy" means a process has its working directory or an open file on that mount. Find it with fuser -vm or lsof +f, stop it, avoid umount -l.
Ubuntu 24.04 · util-linux 2.39.3 · lsof 4.95.0 · psmisc 23.7 · 2026-10 - Check an ext4 image with a damaged superblock using e2fsck
Practice on an image file: read e2fsck -fn output and exit codes, then find a backup superblock and use -b to check and repair when the primary one is damaged.
Ubuntu 24.04.5 LTS · e2fsprogs 1.47.0 · ext4 image file (300M) - Extend an LVM logical volume into the free space of its VG
Read VFree from vgs, then grow the logical volume and its ext4 file system with one lvextend -r -l +100%FREE line. Covers XFS and the case where VFree is 0.
Ubuntu 24.04 · lvm2 2.03.16 · e2fsprogs 1.47.0 · ext4 on loop devices - Find what is using the space when a disk is full
Find the full file system with df, narrow down big files with du and find, then handle space that does not come back after a delete and inode exhaustion.
Ubuntu 24.04.5 LTS · coreutils 9.4 · lsof 4.95.0 · ext4 loop file system