0

OS: Ubuntu 10.04

I have saved my partition layout from sda and want to restore it to my new disk sdb. I have used the following command to save the layout, but how can i restore it to my new disk using parted?

parted -ms /dev/sda print > sda.parted
2

I don't think you can do that although you could probably read the file and do it manually, it's an easy format to understand

BYT;
/dev/sda:120GB:scsi:512:512:msdos:ATA KINGSTON SV300S3:;
1:1049kB:500MB:499MB:ext4::boot;
2:500MB:120GB:120GB:::lvm;

If you still have sda in the system then there are other tools yopu can use

For non GPT disks sfdisk works

sfdisk -d /dev/sda | sfdisk /dev/sdb

For GPT disks

sgdisk -R /dev/sdb /dev/sda
sgdisk -G /dev/sdb

The latter clones the partition table and then creates new GUIDs for the disk and it's partitions which is necessary if both disks will be used in the same system.

  • Thank you. Reading the parted "backup" was almost too easy. Also a big thank you for the alternatives which I will note for future use :) – SteffenNielsen Jul 30 '15 at 9:29

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.