Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Ok so I have a Asus Laptop that came with 2x 128 GB ssd and its setup as a raid 0 totaling 256 GB. The first 4 partitions are the important ones.

I assembled the raid with mdadm and cloned the entire thing with dd to a file as a backup. My plan is to break the raid after the clone is done, and dd back the first 4 partitions onto the first 128 GB disk, and resize the 4th OS partition to take up the remaining space.

My exact question is how do I handle the gpt partition table with gdisk? Do I need to worry about that at all?

Model: Linux device-mapper (striped) (dm) Disk /dev/mapper/isw_ccjcaiibej_ASUS_OS: 256GB Sector size (logical/physical): 512B/512B Partition Table: gpt

Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  106MB   105MB   fat32        EFI system partition          boot
 2      106MB   1050MB  944MB   ntfs         Basic data partition          hidden, diag
 3      1050MB  1184MB  134MB                Microsoft reserved partition  msftres
 4      1184MB  104GB   102GB   ntfs         Basic data partition (OS)
 5      104GB   235GB   131GB   ntfs         Basic data partition (Data1)
 6      235GB   256GB   21.5GB  ntfs         Basic data partition (Data2) hidden,diag
share|improve this question
I could suggest Clonezilla, perhaps it has features you need , , and –  Aaditya Bagga Sep 14 '13 at 7:20

1 Answer 1

up vote 0 down vote accepted

After you copy back, gdisk will notice the disk is shorter and missing gpt metadata at the end. To repair this, you can use either sequence: v r d w or v x e w.

share|improve this answer
So dd it back, restore the gpt from backup and then run gdisk on the drive and one of those sequences? –  Bob R Sep 14 '13 at 8:46
Just dd back and run gdisk. The gpt is part of the data you're copying. –  Gabriel Sep 14 '13 at 8:47
I just needed to do the same and "v r d w" basically works, but you also need to remove partitions. I had partitions 7 and 8 spanning beyond the end of new disk. Gdisk refused to write secondary partition table with following error : "Warning! Secondary partition table overlaps the last partition by 1953498225 blocks! You will need to delete this partition or resize it in another utility. Aborting write operation! ..." The solution is to remove surplus partitions by gdisk in advance and then repair : d 8 d 7 v r d w y (last y means yes). (I have not tried v x e w) –  ludvik02 Aug 30 at 10:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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