Aug 12, 2011
tom

Clone disk with dd, and change blocksize?

Question

I need to clone my 300GB disk to 500GB disk with dd, but the old disk (300GB) has too *big block size.

Will this change the block size of output partition too? I understod that obs only meant to be used during copying, and would not change the partition block size?

dd if=/dev/hda of=/dev/hdb obs=4096

Note that this hda contains only one NTFS partition with Windows 7 installed which I try to clone to the new disk.

*I chose too big block size when I thought I can put only vmware images on the drive. But that did not happen since main OS disk failed sometime ago and now my OS is on disk that has a huge block size.

Answer

Create NTFS partition on /dev/hdb(with -c option) and copy file from /dev/hda. block size is set when you create the filesystem, dd can’t change block size.

   -c, --cluster-size BYTES
          Specify the size of clusters in bytes. Valid cluster size values are powers of two, with at least 256, and at most 65536 bytes per cluster. If  omit‐
          ted, mkntfs uses 4096 bytes as the default cluster size.

Related posts:

  1. After using dd new disk cannot be booted and partition tables lost
  2. Rescue disk is unable to see the lvm physical volumes
  3. Resize LVM after cloning disk
  4. combine partitions to one disk image
  5. LINUX + red hat + How to define swap on disk partition: /dev/cciss/c0d0p6

Leave a comment