Time Machine question

Discussion in 'Mac Basics and Help' started by ctross, Sep 7, 2014.

  1. ctross macrumors newbie

    Jun 10, 2010
    Not that I need to understand how it works, but like many of us the fact that we don't understand will bug us for eternity.

    Why are all my time machine backups similar in size instead of the newest folders being only the size of the newly changed data?

    ...And why is the size of the root backup folder over 3x the size of the drive its on; obviously its adding up the subfolders, but why does the computer recognize a folder larger than the HDD?



  2. csixty4 macrumors regular

    Apr 8, 2010
    Somerville, MA
    I don't know how familiar you are with filesystem internals, so let's start with the basics. A spinning hard disk has multiple platters and heads, the drive's "geometry". But that's too low-level and messy and different drives have different geometries so there's some low-level translation that makes it all look like a contiguous chain of "blocks".

    The filesystem needs to track metadata about the blocks. At the very least, it needs to know which ones are allocated to hold data. It uses "inodes", index nodes, for this. Things like file creation dates and ownership can be stored in inodes, along with a pointer to the data.

    What isn't stored in inodes? Filenames. There's a separate system for storing directories and the names of files in them, mapping names to inodes. So when you move a file from one one directory to another on the same disk, the data isn't moved. The old pointer to the first inode is destroyed and a new one is created in the new place.

    Because directory & file names just point to inodes, you can make a "hard link" which is another directory entry (filename) pointing to the same inode as another filename. You might be familiar with a "soft" or "symbolic" link, which points to another file by name. The OS treats those like they don't take up any space. But there's practically no difference between a filename and a hard link to the same file. And that's on purpose. If you delete the original file, the hard linked file just keeps on existing because it's the same file, just a different pointer to the same thing.

    Time Machine uses a ton of hard links under the hood. Each backup snapshot directory could be copied over to another disk like it contained all the data it needed. As far as higher-level tools like the Get Info dialog are concerned, it actually thinks the data has been duplicated and those are different files. It doesn't know any better. It shouldn't know better. That's the kind of low-level shenanigans the filesystem is there to worry about. It looks like you're storing more data than your disk can hold because of those links.
  3. csixty4 macrumors regular

    Apr 8, 2010
    Somerville, MA
    Those hard links also mean Time Machine can purge an old backup by just deleting its directory. inodes usually have a count of how many links point to then, so the filesystem knows which ones can be freed up after the old backups are deleted.

Share This Page