Solved Disk cloning with dd does not copy label information

I thought the dd does make a direct exact copy. To my surprise after clone from one usb to a new one (same model and size) the label informations are not available on the new drive
Code:
dd if=/dev/da0 of=/dev/da1 bs=1M

Is this normal?
 
Ehm, aren't you having a duplicate label now that both da0 and da1 are exactly the same?
 
ok. I have to add that I removed the original and reinserted the clone. :) Also booting from clone is failing because labels are missing
 
Those labels are simply written to specific places on the disk, as a dd(1) makes a bit-for-bit copy there's no reason why those labels aren't on the target device.
 
Those labels are simply written to specific places on the disk, as a dd(1) makes a bit-for-bit copy there's no reason why those labels aren't on the target device.
What if the devices aren't exactly the same size? perhaps the label position starts at the same bit position, but it's not "where the software expects it".
Like gpt backups: they are at the "end of the device", so if the end of device is not exactly the same, looking for it fails.
 
What if the devices aren't exactly the same size? perhaps the label position starts at the same bit position, but it's not "where the software expects it".
If it's smaller that could potentially happen, not if the target is bigger. Although you're going to need to run gpart recover in that case to fix the partition table at the end of the device. But both devices are exactly the same, so this really shouldn't be an issue.

Like gpt backups: they are at the "end of the device", so if the end of device is not exactly the same, looking for it fails.
Yes, but it's the backup table that's missing in that case, the primary table at the start of the device would still be valid.
 
Ok, I just learned that buying the same usb device does not mean they have the same size ;-(

Original:
Code:
da0: <JetFlash Transcend 32GB 1100> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 153185GWMN02MINP
da0: 40.000MB/s transfers
da0: 30120MB (61685760 512 byte sectors)
da0: quirks=0x12<NO_6_BYTE,NO_RC16>

Backup
Code:
da2: <JetFlash Transcend 32GB 1100> Removable Direct Access SPC-4 SCSI device
da2: Serial Number 65410DHNY65AHQ2H
da2: 40.000MB/s transfers
da2: 29163MB (59725824 512 byte sectors)

Backup is smaller and @NomadBSD told me that the labels are the last part. So they are probably missing
 
Yes, but it's the backup table that's missing in that case, the primary table at the start of the device would still be valid.
Understood, it was just an example, the first that came to mind. Given that there are at least 3 ways to put labels on a device/partition, I figured at least one would have the primary location for the at the end of the device. I was just one cup of coffee shy of remembering that. :)

hbauer that explains alot. Thanks for providing that followup.
That's why I've always tried to do ZFS on partitions, not on whole devices, especially if you have any sort of RAIDZ going on.
 
Back
Top