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.
More on Disk, Capacity & Backups
How do you lay out filesystems on a production server?IntermediateHow do you do capacity planning for disk?IntermediateWhat disk usage alert thresholds do you use?BeginnerA disk is 100% full in production. What do you do first?BeginnerHow do you clean up disk space safely on Docker hosts?IntermediateWhat is the 3-2-1 backup rule?Beginner