Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Seems most of the people say they use hard link is to do incremental backup 1, but as we already have more advance backup methods such as Duplicity or rdiff-backup, so can I say it is almost useless in today environment now (from the user point of view)?

1 http://www.mikerubel.org/computers/rsync_snapshots/#Incremental

share|improve this question
    
sadly especially rdiff-backup seems to be stagnant [or mature enough].. but interesting question nevertheless. –  pQd Jul 5 '12 at 9:37
    
rdiff-backup is a "more advance[d] backup method"? Hahaha. –  womble Jul 5 '12 at 11:13
    
@womble, yes, compare to people who are using rsync + hard link –  Ryan Jul 5 '12 at 16:04
    
You would sound more convincing if it didn't take several hours to recover from a failed rdiff-backup run, and you could specify a retention policy more complicated than "the last N backups". –  womble Jul 6 '12 at 5:05

2 Answers 2

up vote 2 down vote accepted

A link is a directory entry that points to blocks on disk. In other words every file on your system has at least one hard link. When you rm a file the actual system call is unlink(), it removes the directory entry. The blocks on disk haven't changed but the link is gone, thus the file is gone from the directory listing.

You personally may not ever use hard links, but they are all over your system. For example:

$ ls -li /bin | grep 53119771
53119771 -rwxr-xr-x 3 root root  26292 2010-08-18 10:15 bunzip2
53119771 -rwxr-xr-x 3 root root  26292 2010-08-18 10:15 bzcat
53119771 -rwxr-xr-x 3 root root  26292 2010-08-18 10:15 bzip2

You can see that bunzip2, bzcat and bzip all use the same inode. In essence, it is one file with three names. You could have three copies of the file, but why? It would only use up disk space unnecessarily.

share|improve this answer
    
Interesting. This seems to be OS-specific, I'm using Ubuntu and looking at all files in /bin and /usr/bin, the only 2 that share an inode are /usr/bin/sudo and /usr/bin/sudoedit. –  ThatGraemeGuy Jul 5 '12 at 9:58
    
You can use symbolic link instead, no need to use hard link –  Ryan Jul 5 '12 at 16:02

on some servers I use dirvish, which is a fully featured backup tool with rotating, etc. It uses hardlinks like you mentioned to create incremental backups.

The nice thing about these Backups is, that you can restore them from scratch with cp in the case of an full failure. And it is set up in minutes.

For example I use this to backup my backup server (only the system) for datacenter wide bare metal recovery

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.