On 2018-06-16 02:04, L A Walsh wrote:
Greg Freemyer wrote:
On Wed, Apr 11, 2018 at 1:30 PM, Felix Miata
wrote: Lew Wolfgang composed on 2018-04-11 07:51 (UTC-0700):
One of my acolytes reported that she used dd to copy one disk partition to another partition on the same disk, as in: dd if=/dev/sda1 of=/dev/sda2 She said it failed, but was a little fuzzy about exactly what happened (I wasn't there), just that the destination partition appeared to be "empty" after the operation. I don't know how she made that determination. I've been doing UNIX stuff for a long time but I never would have thought to use dd in this fashion. Maybe instinct? But assuming that the two partitions are exactly the same size, what could possibly go wrong? dd if=/dev/sda1 of=/dev/sda2 stands a significant chance of failure on an MBR disk. Before it became standard practice to leave a gap of 1.0MiB or 2.0MiB in front of the first partition, sda1 would be a different size in sectors from an ostensibly identically sized sda2, sda3 or sda4. The latter three would typically be larger than sda1 by 62 sectors. The latter three would also be larger than a "same" size logical. IIUC, with a standard gap from recent partitioning tools the difference between the first and up to three "identical" primaries would be gone, but not the difference between primaries and logicals. So, sda2 or sda3 to sda5 or sda13 should fail in any event.
Disclaimer -- when I copy partition, it's either to another disk or one end is a file.
I've never had such a copy NOT work and I've used a few extreme cases, like copy old image that was a RAID0 from 4 disks ~240GB each to a 2TB hard disk where it used the 1st 1TB (approx) of disk space.
Notice that the above paragraph you referenced is about particular clone practice. There are many others in which it works. Imaging a primary partition to a logical partition can fail because they don't have the same gaps. And imaging an MBR disk p1 to p2 (same or different disk) can fail because the gaps at the start have changed. Also sector size has changed. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)