0

I must setup a system where i can do a "dd if=/dev/sda of=/dev/sdb" to a backup and the reverse. This means i need disks to have exactly the same number of byte or i will run in trouble.

It's not only a backup disk it also might be an easy new experimental install where the new os will decide itself automatically how to partition the whole disk and therefore use all the disksize. So a larger backup disk will not work at all. It must be idential. I also don't want to use any tool more complex then "dd"

But i don't want to buy two large SSD when the backup only needs HDD performance.

I could not find any precise information in the Data sheets of the disk manufacturers.

Lothar
  • 801
  • 1
  • 6
  • 15
  • No, about the only way to get two drives of the exact same size is to buy two of the same model drive. – Rob Pearson Jun 02 '18 at 01:10
  • Hmmm, i just checked with a 250GB and a 500GB Crucial SSSD and if i double the first i get a difference in 1323 blocks of 8 KBytes size. But the Crucial and two different 500GB from WD and Seagate had the same byte count. – Lothar Jun 02 '18 at 01:50
  • 1
    That is too small a sample size to draw any conclusions. You cannot assume anything. – Tero Kilkanen Jun 02 '18 at 07:40

1 Answers1

1

The advertised size is not the exact number of bytes across all vendors and models.

where the new os will decide itself automatically how to partition the whole disk and therefore use all the disksize.

Presumably, you control this environment and can standardize how large your disk volumes are. Once you have the layout that fits on the drives you buy that is the size to assume.

So a larger backup disk will not work at all. It must be idential.

dd can write to a regular file that isn't a device. Store this file on a large backup volume. Possibly a few TB of spindles in an array, remote mounted with NFS. Now you can have multiple backups on protection storage that can survive a disk failure.

Your method is cloning a disk. If the target disk won't be put into production itself, might as well use regular files for the backup archives. Lots of utilities to deal with regular files, less concern about the exact size.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34
  • But having explicit control of the layout is error prone. Especially on macOS where the disktool isn't even showing the size of hidden partition like EFI anymore. My solution is for a hackintosh where i run into problems with updates all the time. Yesterday the 10.13.5 update killed my system so i want to have this 1:1 experimental setup. Thats a level on top of the backups that i do regularly anyway. I have manual SATA power switch so i can exactly decide which disk to boot from and have 100% isolation of each other in case some Apple madness like autoconverting filesystems on all partitions – Lothar Jun 02 '18 at 16:10
  • Time Machine backups include a full restore option. If you want to play with dd instead, go ahead. Although, booting MacOS on non Apple hardware is against their terms of use and so not recommended in a professional environment anyway. – John Mahowald Jun 03 '18 at 19:33