LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-18-2009, 02:59 PM   #1
unixbrother
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Rep: Reputation: 0
Creating hard links


I work at a web hosting company and we need to be able to create a large number of hard links on our ubuntu linux servers. After trying to create over 32,000 hard links, we get this error, "Too many links".

My question is kindly is there a way to create more than 32,000 hard links, such as change the limit or any other ways?

Thank you so much for your help!

John
 
Old 09-18-2009, 03:58 PM   #2
RaptorX
Member
 
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254

Rep: Reputation: 37
are you trying to use only one command for it?
when do you get the error?

maybe you can try to make a little script that creates 10,000 hls and then repeat the process as many times as needed?

is better if you provided a little bit more background on this issue, like what have you tried and when are you getting the error.
 
Old 09-18-2009, 04:02 PM   #3
unixbrother
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
I can just run "ln blah2 blah1" in a loop and create the links.. the problem isn't creating the links but that I can only create 32,000 of them. I need to create many more than 32,000 :/
 
Old 09-18-2009, 04:38 PM   #4
lamapper
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 2
Limitiation of the filesystem you are using?

I can only suggest of a couple places to look, not sure of a solution.

It appears that you are running up against a physical limitation for your filesystem. i.e The number of files for one directory; or the number of links for a specific file system;

tune2fs - adjust tunable filesystem parameters on ext2/ext3 filesystems
dumpe2fs - dump ext2/ext3 filesystem information

I had man pages for both on my system, so you have some reading ahead of you.

http://linux.die.net/man/8/tune2fs - man page for above if you do not have it on your system.

http://www.cyberciti.biz/faq/linux-s...rblock-inode/; points to tune2fs.

I know the number of inodes vary based on the file system you are using.

I also know that if you want to switch from one file system to another, you will have to backup your data and restore everything after you convert. I hope this helps you know where to look for more information. Sorry I did not have a specific solution.
 
Old 09-18-2009, 05:59 PM   #5
unixbrother
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for your help, I will check into things!
 
Old 09-18-2009, 07:51 PM   #6
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by unixbrother View Post
I can just run "ln blah2 blah1" in a loop and create the links.. the problem isn't creating the links but that I can only create 32,000 of them. I need to create many more than 32,000 :/
Have you considered rethinking the reason for so many hard links? There are many ways to accomplish what you are trying to do, and in many ways tens of thousands of hard links is the least workable approach.
 
Old 09-19-2009, 01:21 AM   #7
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by unixbrother View Post
I work at a web hosting company and we need to be able to create a large number of hard links on our ubuntu linux servers. After trying to create over 32,000 hard links, we get this error, "Too many links".

My question is kindly is there a way to create more than 32,000 hard links, such as change the limit or any other ways?

Thank you so much for your help!

John
Looks like the problem not hard links per se, but a number of files in the same directory.

After you created max number of hardlinks you can, are you able to create another file in this directory ?

And I agree with lutusp - 32000 files in the same directory is just too many, you can try to think about different approcah
 
Old 09-19-2009, 06:39 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Each hard link requires an inode. Are you running out of inodes on the file system or in a "group" on the file system? (I don't know what a group is but it may be relevant) Presuming you are using an ext* file system, dumpe2fs (maybe with the -h option) might provide useful information.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] rsync --link-dest not creating hard links on external usb drive quasi3 Linux - General 4 08-26-2009 11:11 AM
Symbolic links Vs Hard links sulekha Linux - General 2 10-02-2008 08:03 AM
technical question about hard links v soft links 7stud Linux - Newbie 2 02-23-2007 07:57 PM
links (hard links and soft links..) sachitha Programming 1 08-10-2005 01:10 PM
Sym links and hard links akudewan Linux - Newbie 4 02-09-2005 06:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration