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?

user404315
  • 1
  • 1
  • 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. – Tero Kilkanen Mar 08 '17 at 14:08

3 Answers3

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
Mikhail Khirgiy
  • 2,073
  • 11
  • 7
  • 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 Jan 05 '20 at 06: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

adoado0
  • 101
  • 8
  • tried this as well. No luck there. Same result – user404315 Mar 08 '17 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. – Mikhail Khirgiy Mar 08 '17 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 Mar 08 '17 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.

Apitronix
  • 101
  • 1