How to clone first 256GB of 1TB raid1 hdd with dd
by pappin from LinuxQuestions.org on (#5M22K)
Hi,
I need to clone a raid 1 drive that only uses the first 250GB so I don't want dd to spend ages copying empty space.
Can anyone give me the dd options to do this. The source and destination drives are all identical as fdisk below
I also read somewhere that piping "dd if=/dev/sda | dd of=/dev/sdb" is faster than dd if=/dev/sda of=/dev/sdb.
Anyone any views on this as well
Thanks
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-08W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9a9c995e
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 48828415 48826368 23.3G fd Linux raid autodetect
/dev/sda2 48830462 488396799 439566338 209.6G 5 Extended
/dev/sda5 48830464 68360191 19529728 9.3G fd Linux raid autodetect
/dev/sda6 68362240 72550399 4188160 2G 82 Linux swap / Solaris
/dev/sda7 72552448 76455935 3903488 1.9G fd Linux raid autodetect
/dev/sda8 76457984 488396799 411938816 196.4G fd Linux raid autodetect
I need to clone a raid 1 drive that only uses the first 250GB so I don't want dd to spend ages copying empty space.
Can anyone give me the dd options to do this. The source and destination drives are all identical as fdisk below
I also read somewhere that piping "dd if=/dev/sda | dd of=/dev/sdb" is faster than dd if=/dev/sda of=/dev/sdb.
Anyone any views on this as well
Thanks
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDC WD10EZEX-08W
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x9a9c995e
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 48828415 48826368 23.3G fd Linux raid autodetect
/dev/sda2 48830462 488396799 439566338 209.6G 5 Extended
/dev/sda5 48830464 68360191 19529728 9.3G fd Linux raid autodetect
/dev/sda6 68362240 72550399 4188160 2G 82 Linux swap / Solaris
/dev/sda7 72552448 76455935 3903488 1.9G fd Linux raid autodetect
/dev/sda8 76457984 488396799 411938816 196.4G fd Linux raid autodetect