Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
On the behaviour of hardlinks..: I timed how long it takes to create a series of hardlinks to a single file. The time *per hardlink creation* clearly grows linearly with the link count, regardless of whether each new hardlink is linked to the previous one or directly to the original file. The same goes for deleting them. I had expected it to take constant time, being that each hardlink just points directly to the file's inode, and the inode knows the link count but doesn't point back to all its hardlinks. So creating a new hardlink need not (cannot!) visit all the other hardlinks. Yes no?
Reason I ask is that my simple little backup cron job is gradually taking longer to run each night. It essentially just does rsync -a --delete --link-dest=... to an external hard drive. I was going to do rotating backups. But at the rate at which the EHD is filling up, I'll have bought a bigger one long before this one ever runs out of space. Delighted with the possibility of having a snapshot for every single day, I don't delete any backups at all.
Works fine, except for taking about an hour longer per week. So that's not going to be feasible. I may have to resign to a less exhaustive backup structure, though suggestions are welcome if there's a way to keep them all without taking forever per backup. Mostly I'm just curious as to why hardlinking time seems to be linear in the link count. Any ideas?
Isn't it the case that you're trying to make hard links across two different filesystems? Your internal drive and a USB doohickey? That's impossible so would result in the files being copied each time, which would explain the increase in time you're seeing. Or am I missing something critical here?
It takes linear time when I try timing hardlinks on just one filesystem. Also, rsync --link-dest=... creates hardlinks on the destination filesystem itself. That's working as expected; it's not copying the files each time, as the amount of used disk space on the backup disk grows only very slowly.