0

I'm trying to burn a dvd on a mac with an external (firewire-connected) dvd drive. I'm checking the size of the iso thus:

DVD-4:dvd_files macbook$ ls -l /tmp/hybrid.iso 
-rw-r--r--  1 macbook  wheel  8700884992 Aug 22 10:57 /tmp/hybrid.iso
DVD-4:dvd_files macbook$ ls -lh /tmp/hybrid.iso 
-rw-r--r--  1 macbook  wheel   8.1G Aug 22 10:57 /tmp/hybrid.iso

The "human-readable" size is 8.1 Gig but when i try to burn, onto an 8.4G dual-layer dvd, it says "Media does not have enough free space"

The definition of a "Gigabyte" according to Wikipedia is 1 billion bytes, so the iso size should actually be 8.7 Gig according to this definition, in which case the disk definitely isn't big enough, and it's just that the -h option to ls is misleading.

Is the discrepancy just due to the ls command using a different definition of "G" (eg 1024 Meg aka 1.07 Gig? This comes out as 8.103 which fits what ls is displaying)

Journeyman Geek
  • 127,463
  • 52
  • 260
  • 430
Max Williams
  • 2,917
  • 6
  • 29
  • 38
  • possible duplicate of [What is the difference between a kibibyte, a kilobit, and a kilobyte?](http://superuser.com/questions/287498/what-is-the-difference-between-a-kibibyte-a-kilobit-and-a-kilobyte) – and31415 Aug 22 '14 at 11:16
  • @and31415 i don't think so, as my question relates to the `ls` command. – Max Williams Aug 22 '14 at 11:22
  • Stupid question: Are you trying to *save* the ISO image file to the disk, or *write* the ISO image? If you're saving the file it likely takes more space than if you write the image. – Daniel R Hicks Aug 22 '14 at 11:36
  • @DanielRHicks I really doubt that matters enough to be the problem here. See my answer. – user Aug 22 '14 at 11:36
  • @DanielRHicks i'm trying to write it, with `hdiutil burn` – Max Williams Aug 22 '14 at 12:25

1 Answers1

6

You're hitting the age-old difference between decimal prefix GB (1000^3 bytes) and binary prefix GiB (2^30 bytes). For small numbers, the difference between the two don't matter much (for example, there is "only" a 24 bytes difference between 1 KB and 1 KiB), but for large numbers, the difference can be quite significant; there's an almost 74 million bytes difference between 1 GB and 1 GiB, for example (about 7.4%, compared to a 2.4% difference in case of KB/KiB).

We know that your ISO image file is 8700884992 bytes.

A regular size (12 cm diameter), single-side, dual-layer, recordable DVD holds 7.96 GiB, or approximately 8546984919 bytes.

Since the available 8.55 GB (7.96 GiB) is less than the needed 8.70 GB (8.10 GiB) (specifically, you're short about 154 million bytes), your system complains that the disk that you are trying to record that image to does not have the necessary amount of space.

user
  • 29,449
  • 11
  • 99
  • 144
  • Great thanks, i thought that was the case. So the "problem" is that `ls` uses GiB (which it refers to as "G") with the -h option and the disk space is measured in GB. Cheers. – Max Williams Aug 22 '14 at 12:26
  • @MaxWilliams Well, disk space is measured in bytes, mostly. :) The problem is the confusion between binary and decimal prefixes, not the using one or the other. If it was all just consistent, it'd be much less of an issue. – user Aug 22 '14 at 12:29