Interview Prep/Linux/Storage, disks and filesystems

You must migrate a filesystem from ext4 to XFS on a live system. What is your plan?

AdvancedScenarioStorage, disks and filesystems
Answer

Situation read → There is no in-place conversion; you copy data to a new filesystem.

What I'd do →

  1. Create a new LV or disk and format XFS.
  2. Pre-copy with rsync -aHAXS --numeric-ids /data/ /newdata/.
  3. Stop writers, final rsync with --delete.
  4. Swap mount points in fstab (by UUID) and mount.
  5. Restore SELinux contexts, start services, verify, keep the old volume read-only for rollback.

Why → -H keeps hardlinks, -A ACLs, -X xattrs (SELinux labels), -S sparse files: all things plain cp can lose.

Interview tip → Mention that XFS can't shrink, so size it right.

All Linux questions Roadmap: Linux

More on Storage, disks and filesystems