Wishing to replace the system drive with near identical sized new and fresh SSD, or even a larger one, leaves me with a puzzle. dd is great and I can't use that bit-by-bit copy technique f.e. because my source drive died or is unreliable. I have a backup of all the data available.

The issue is how to backup and restore and/or migrate/clone the GPT partitioned drive structure using a script without its files and directories:

  1. partitioning
  2. file systems (and their properties)
  3. swap

A search here for "migrate new drive -lvm" returns 30 results, none of them give me a hint.

Is there some kind of handy scriptable parted --backup and --restore command to accomplish this task in a minimal Arch Linux installation, that is UEFI booted?


You can find many ways to copy the partition table here: How to copy the partition layout of a whole disk using standard tools

After that you still need to format each partition with its specific filesystem type. You can surely automate that part from the partition list, however I doubt I would be worthwhile as there are some options you might need/want at filesystem creation that you can not derive from current ones (or you are just taking the opportunity of a new disk to format things with new options)


To copy and restore a partition table you can use fdisk. Make sure you're using a modern version of fdisk though. That should be the case on an up to date Arch Linux fdisk.

fdisk /dev/disk/by-id/bus-model



Then to load it back

fdisk /dev/disk/by-id/bus-model


  • Arch 4.18.5: fdisk: cannot open /dev/disk/by-id/bus-model: No such file or directory – Pro Backup Sep 8 '18 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.