An open community 
of Macintosh users,
for Macintosh users.

FineTunedMac Dashboard widget now available! Download Here

Page 3 of 3 < 1 2 3
Topic Options
#14310 - 02/21/11 08:32 AM Re: Opinon on time machine [Re: artie505]
kevs Offline


Registered: 12/07/09
too late to partition, already done that, way too late.

But also curious:
how does TM work?

you have to copy everything on a TM drive and it sees what was changed on a completely different drive and changes the file that matches on the TM drive?

and what about new files you make on the non TM drive?

Top
#14318 - 02/21/11 04:31 PM Re: Opinon on time machine [Re: roger]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: roger
the references in TM to a "file" (the actual data, say an mp3) are more like aliases, and so deleting them when space is needed is pretty worthless, so of course TM would need to delete the actual file to gain any space. I might have lots of aliases to a particular file within TM, but only one that contains the actual data.

next question: how does one create a "hard link"? I take it that is more than an alias.

The terms alias and symbolic link refer to more or less the same thing: a file that provides a layer of indirection by pointing to another file somewhere else. You create an alias file in Finder by using its File->Make Alias menu command, or by command-option-dragging an icon into a different folder. You create a symbolic (also sometimes called soft) link at the Unix command line using the ln tool with the -s option.

Although they serve similar purposes, they have different file layouts. The content of their inodes is different, and they use different metadata flag bits to advise the OS of their special nature.

One thing they share is that they can both be broken. Since they only point to a file somewhere else, if that file goes away they're left dangling, no longer pointing at anything.

A symbolic link contains a pathname as its content. If you're following a pathname, say /a/b/c/d, you would expect to find only directories along the way. That is, /a, /a/b, and /a/b/c would all be directories, in which you'd look up the next component of the pathname. But you could discover that /a/b is a symbolic link instead, containing perhaps the pathname /x/y/z. In that case, expand /x/y/z in the usual way, to reach the directory that "c" should be looked up in. That is, the actual path to look up is /x/y/z/c/d. Of course, /x/y could itself be a symbolic link, incurring additional levels of indirection.

Since a symbolic link contains only a pathname, it breaks if its target moves. (A rename is a special case of a move.) Moving a different file (inode) to the same place in the hierarchy re-connects the link.

To make links less fragile, an alias file contains much more data. In addition to the pathname that a symbolic link contains, an alias file contains also the inode number of every directory along the path, along with information about how to find the disk volume in case it gets renamed or unmounted. When Finder is following an alias, it will even go so far as to log into a remote server to mount a remote volume, or open a disk image file if the target is inside. Any passwords needed along the way can be automatically retrieved from the keychain.

If Finder finds a symbolic link, it'll follow it the same way Unix does. In fact, in Finder you can't tell the difference between an alias and a symbolic link (except that the latter is more fragile). Unix doesn't reciprocate, treating an alias file as some unknown file type.


The purpose of all that discussion was to dispense with the subject of aliases/soft links, getting them out of the way. Time Machine makes no use of either.

Time Machine relies instead on hard links. A hard link is what a directory creates when it resolves a pathname to an inode. We usually don't call it a hard link until there are at least two different pathnames leading to the same inode, but that's not fundamentally different from the normal case where an inode has only one pathname leading to it.

You can't refer to an inode without using at least one of its pathnames. (Once a program opens a file, the I/O subsystem refers to it solely by inode number. Changing a file's name or moving it elsewhere does not disturb programs that already have the file open.) As I've said before, an inode is aware of how many pathnames lead to it. Removing a file means removing one pathname to it, thereby decrementing the link count in the inode. The inode itself is deleted when the link count goes to zero, because at that point there's no longer any way to reach the inode. (On some filesystems, opening a file also increments the link count, so the inode still doesn't go away until the last program using it closes the file.)

At the Unix command line, you create a hard link (that is, add a new pathname to the same inode) using the ln command without the -s flag, or by using the link command.

You can see the link count on (the inode of) a file as part of the information produced by the ls command with the -l option. Adding the -i flag to that shows also the inode number.

Here's an example:

# create an empty folder and add two files to it
ronk@Zebra:Desktop(0)$ mkdir tmp
ronk@Zebra:Desktop(0)$ cd tmp
ronk@Zebra:tmp(0)$ date > f
ronk@Zebra:tmp(0)$ date > g

# peek at the contents of these two files
ronk@Zebra:tmp(0)$ cat f
Mon Feb 21 16:19:04 PST 2011
ronk@Zebra:tmp(0)$ cat g
Mon Feb 21 16:19:08 PST 2011

# look at the link counts
ronk@Zebra:tmp(0)$ ls -l
total 16
-rw-r--r-- 1 ronk _ronk 29 Feb 21 16:19 f
-rw-r--r-- 1 ronk _ronk 29 Feb 21 16:19 g

# see how much disk space we're using
# (note that 4K is the minimum file allocation, even for these 29-byte files)

ronk@Zebra:tmp(0)$ du -h
8.0K .

# create a (new) hard link. The new path h leads where the old path f did
ronk@Zebra:tmp(0)$ ln f h

# look again at the counts, this time throwing in inode numbers as well
ronk@Zebra:tmp(0)$ ls -li
total 24
56733482 -rw-r--r-- 2 ronk _ronk 29 Feb 21 16:19 f
56733483 -rw-r--r-- 1 ronk _ronk 29 Feb 21 16:19 g
56733482 -rw-r--r-- 2 ronk _ronk 29 Feb 21 16:19 h

# are we using any more disk space now?
ronk@Zebra:tmp(0)$ du -h
8.0K .

# delete the "original" of the hard link, and verify that the inode remains
ronk@Zebra:tmp(0)$ rm f
ronk@Zebra:tmp(0)$ ls -li
total 16
56733483 -rw-r--r-- 1 ronk _ronk 29 Feb 21 16:19 g
56733482 -rw-r--r-- 1 ronk _ronk 29 Feb 21 16:19 h
ronk@Zebra:tmp(0)$ cat h
Mon Feb 21 16:19:04 PST 2011



Top
#14319 - 02/21/11 04:43 PM Re: Opinon on time machine [Re: kevs]
ganbustein Offline


Registered: 08/04/09
Originally Posted By: kevs
you have to copy everything on a TM drive and it sees what was changed on a completely different drive and changes the file that matches on the TM drive?

Each time TM takes a snapshot, it copies over everything that's new (and isn't excluded).

The operative word here is new. New since when?

The answer is, new since the last good snapshot. In the beginning, when it hasn't yet made any snapshots, everything is new.

Normally, it'll try to make a new snapshot every hour, but what if it can't? For example, you might have disconnected the backup drive. If it can't take a snapshot, it doesn't, but the next time it can it looks on the backup volume to see when the last good snapshot was, and backs up everything new since then.

Top
#14320 - 02/21/11 05:00 PM Re: Opinon on time machine [Re: ganbustein]
kevs Offline


Registered: 12/07/09
Ok, Gan, so it sees the primary drive and then see it has a clone on the TM drive, and when I change something on the primary drive, it snapshots and updates to the TM drive?

Pity you have to copy everything to begin with to the TM drive. That is just cannot work out of the gate with a blank drive.

Also, what about new files I create from the primary drive??

Top
#14321 - 02/21/11 05:16 PM Re: Opinon on time machine [Re: kevs]
Virtual1 Offline


Registered: 08/04/09
Loc: Iowa
There's a much easier solution to this than buying another 3T hdd. I use it with my backup. I have a folder called DATA_XFER in my home. ALL my backup scripts are keyed to 100% ignore folders by that name on the source and target.

So you could just make a folder in your home that has information that does not need to be backed up, and privatize that to time machine. And you could do what you needed to separately back that up if needed. Burning to discs, copying to 2nd hard drive etc. Time Machine's ability to exclude folders is perfect for this.
_________________________
I work for the Department of Redundancy Department

Top
#14323 - 02/21/11 06:05 PM Re: Opinon on time machine [Re: ganbustein]
roger Offline


Registered: 08/04/09
Loc: Vermont
thank you so much for all of that. I know enough now to know that I know not much!!

seriously, I truly appreciate you taking the time to spell that all out for me.
_________________________
MacBook 2.4 Ghz · 4 Gb ram · 10.7.5
stuff I'm interested in
iPhone 4s 7.0.2

Top
#14324 - 02/21/11 06:23 PM Re: Opinon on time machine [Re: kevs]
Hal Itosis Offline


Registered: 09/03/09
Loc: 10.6.8 (build 10K549)
Originally Posted By: kevs
Pity you have to copy everything to begin with to the TM drive. That is just cannot work out of the gate with a blank drive.

Wut? no... it can (in fact, it must).

Originally Posted By: kevs
Also, what about new files I create from the primary drive??

Create from? Wut?
Just try it... TM is pretty simple to operate. Then you can go look and *see* what happens.

Top
#14472 - 03/01/11 12:08 PM Re: Opinon on time machine [Re: joemikeb]
MG2009 Online


Registered: 08/05/09
For an "instant" backup - if one does not wish to wait for the next scheduled hourly b/u - one could select BACK UP NOW from the Time Machine drop down menu.

P.S. Perhaps not a perfect solution as it is a conscious manual operation rather than an automatic scheduled function. (Simple, but effective.)

Top
Page 3 of 3 < 1 2 3

Moderator:  alternaut, dkmarsh, joemikeb