I have a server with a medium-sized database on a disk which is filling-up. There is no LVM or RAID or anything like that in play at this point. I already have the new disk installed in the server.
Is it possible to migrate the data to the new physical disk with minimal or no downtime? We have performed a copy-speed-test from the old drive to the new one and it's going to be a few hours to accomplish. Not strictly speaking a deal-breaker, but I'd like to do better if possible.
I have a few ideas, and I'd like to know what the feasibility of each might be.
Migrate to LVM. If it's possible to migrate a bare partition to an LVM one (is it!?), then it's a simple
pvmove
to move to the new disk without any downtime at all. I'm kicking myself for not having used LVM at the time. :/Use dm-raid to mirror from the existing disk to the new disk, wait for sync, then break the raid and toss the old disk. This requires only enough downtime to re-mount the filesystem from the physical device to the device-mapper device. The "problem" here, then is that I would have a RAID layer I wasn't using after all is said and done. I also don't achieve the flexibility of LVM using this setup.
Another option is setting up a new server (or even just a new service on the same server) and use the replication capabilities of the database (PostgreSQL in this case), but that seems like much more work than necessary.
0 Answers