Interview Prep/Linux/Disk, Capacity & Backups

How do you migrate data to a new disk with minimal downtime?

AdvancedProductionDisk, Capacity & Backups
Answer

With LVM, move extents online with no downtime:

sudo pvcreate /dev/nvme2n1
sudo vgextend vgdata /dev/nvme2n1
sudo pvmove /dev/nvme1n1 /dev/nvme2n1     # online, resumable
sudo vgreduce vgdata /dev/nvme1n1

Without LVM: initial rsync -aHAX while live, then a short downtime window: stop the app, a final rsync --delete (fast, only changes), switch the mount, start the app.

All Linux questions Roadmap: Linux

More on Disk, Capacity & Backups