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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-18-2009, 02:59 PM
|
#1
|
LQ Newbie
Registered: Sep 2009
Posts: 3
Rep:
|
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
|
|
|
09-18-2009, 03:58 PM
|
#2
|
Member
Registered: Jun 2009
Location: Emden, Germany
Distribution: Slackware 12.2, Slax 6.1
Posts: 254
Rep:
|
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.
|
|
|
09-18-2009, 04:02 PM
|
#3
|
LQ Newbie
Registered: Sep 2009
Posts: 3
Original Poster
Rep:
|
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 :/
|
|
|
09-18-2009, 04:38 PM
|
#4
|
LQ Newbie
Registered: Nov 2008
Posts: 8
Rep:
|
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.
|
|
|
09-18-2009, 05:59 PM
|
#5
|
LQ Newbie
Registered: Sep 2009
Posts: 3
Original Poster
Rep:
|
Thanks for your help, I will check into things!
|
|
|
09-18-2009, 07:51 PM
|
#6
|
Member
Registered: Sep 2009
Distribution: Fedora
Posts: 835
Rep:
|
Quote:
Originally Posted by unixbrother
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.
|
|
|
09-19-2009, 01:21 AM
|
#7
|
ELF Statifier author
Registered: Oct 2007
Posts: 676
Rep:
|
Quote:
Originally Posted by unixbrother
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
|
|
|
09-19-2009, 06:39 AM
|
#8
|
LQ 5k Club
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
|
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.
|
|
|
All times are GMT -5. The time now is 08:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|