What is the exact capacity of 1000GB HDD?

9,234

Solution 1

Under the principle of "better safe than sorry", you're better off buying a bigger disk than you need; after all, you can always repave it and use it for something else once you're done doing dangerous things.

That said, if you really can't go that way, I'd recommend buying another disk of the same model as the one you're replacing, because exactly how many bytes a given "1TB" disk can hold is very likely to be manufacturer- and model-specific. Failing that, you'll need to either be able to run fdisk on your prospective backup disk, or find the result of someone else's having done so, in order to know for sure exactly how many bytes it can hold.

Solution 2

Not all hard drives with the same state capacity are identical size wise, although my experience tells me that most are for newer drives. (To mitigate problems with geometry I always used to locate the swap file at the end of the drive and recreate it - either a bit bigger or smaller so if it got corrupted during a DD it did not matter. I havn't needed to do this for a while, and the last 2 [ different age, different model 1 TB WD hard drives had identical geometry ] )

Instead of doing the backup using dd, why not write a large file (for example dd if=/dev/zero of=tmpfile.del bs=4096 count=X) and then delete it just prior to doing a tar -czf /new/drive/backup.tgz - which will then compress the drive and fit ? (creating the zero byte file and deleting it will make sure the space is actually compressible, regardless of what was there before, also using tar can actually be faster then dd because it writes less data - which is usually a slower process then compression, but YMMV)

Share:
9,234

Related videos on Youtube

Robo
Author by

Robo

Updated on September 18, 2022

Comments

  • Robo
    Robo almost 2 years

    1 GiB = 1024 * 1024 * 1024 bytes

    1 GB = 1000 * 1000 * 1000 bytes

    That is easy! I don't want to talk about this!

    I have laptop which should have (according to seller) 1000 GB. That is 1000 000 000 000 bytes. It has even slightly bigger capacity according to fdisk - exactly 1000204886016 bytes.

    That is aproximately 0.2 GB more than it should have!?

    I didn't mind till now.

    I am before some reinstallations and moving partitions without formatting and I would like back up whole drive including bootloader and everything before doing possibly dangerous things. I want to copy it up sector by sector using a command like following:

    dd if=/dev/sda of=/dev/sdb
    

    Now I want to buy a harddisk. I don't want to spend more money by buying bigger disk than I need. So it is enough to buy another 1000GB HDD?

    Will it have the same size? If so why does the 1000GB disks have exactly this capacity. In oposite case is there a way to find out if disk is big enough before buying?

    • Breakthrough
      Breakthrough over 11 years
      The best place to check is the manufacturer's datasheet for the respective hard drive. It should state the capacity of the drive quite clearly.
    • Daniel R Hicks
      Daniel R Hicks almost 11 years
      The capacity is whatever it is. Generally it will be at least the advertised size, but it's unpredictable how much larger. It depends on how the manufacturer configured the drive in terms of platters, cylinders, sectors, spares, drive microcode, head parking areas, etc.
  • cpast
    cpast over 11 years
    Even if it's the same model, it might be individual HDD-specific (It shouldn't be, but I don't know how hard drives are produced, so exact size might just be to within some tolerance.
  • Robo
    Robo over 11 years
    That is great trick with writing zeros to large file and then deleting it! I like it very much.
  • Robo
    Robo over 11 years
    The trick with swap file is also good. But is safe only with MBR partition table. The GPT (Guid partition table) uses last sectors of disk to store the partition table.
  • davidgo
    davidgo over 11 years
    Interesting point. I didn't know that (I'm still coming to grips with GPT)