0

I have an nvme drive with a logical and physical sector size of 4096. The block size of this drive as reported by blockdev --getbsz command to be 4096 as well.

The destination drive is an SSD with a logical and physical sector size of 512. The block size of this drive is 4096.

I tried using dd with the next parameters to clone the drive:

dd if=/dev/sda of=/dev/sdb

but the only partition that i am getting is GPT partition.

I also tried cloning the GPT table with those commands:

sgdisk

and

sfdisk

but no luck there. i am getting a drive with a partition table that every partition is 8 times smaller than the partition in the original drive.

Do you have any suggestions?

1
  • You might have better luck creating the partitions manually so that the sizes match on both source and destination, and then dd the individual partitions separately. However, filesystem internal structures might still cause issues with this operation. Commented Mar 8, 2017 at 14:08

3 Answers 3

1

GPT and MBR use sectors numbers to assign partitions. You need create new GPT table on new disk with partitions which have the same sizes in bytes as partitions on old disk. Then you can copy from old disk to new disk each partition:

dd if=/dev/sda1 of=/dev/sdb1 ibs=4096 obs=512 bs=16M
1
  • 1
    I have to point out that bs, ibs, and obs have nothing to do with the sector size. Those are merely the rates dd reads and writes bytes. Source: dd manpage
    – 2-bits
    Commented Jan 5, 2020 at 6:25
0

I suppose you should specify 'ibs' and 'obs' parameters for 'dd' utility. For example

dd if=/dev/sda of=/dev/sdb ibs=512 obs=4096

3
  • tried this as well. No luck there. Same result
    – user404315
    Commented Mar 8, 2017 at 10:55
  • Reverse parameters: ibs=4096 obs=512 bs=16M. The parameter bs will give you more speed. Read man dd command help before copy-paste. Commented Mar 8, 2017 at 12:10
  • did it with reverse parameters as well. didn't help. my final command was ibs=4096 obs=512 bs=10M. i also tried with 1 in ibs and obs. also didnt work. for some reason i am getting only one partition of type gpt
    – user404315
    Commented Mar 8, 2017 at 13:18
-1

I can't add a comment to messages that mention the dd command, but as the man page say don't use the bs parameter with obs and / or ibs. bs will override them.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .