LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 02-01-2012, 05:27 AM   #1
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Rep: Reputation: 2
Question Optimal File Allocation


Currently in the tutorials and have a basic question that a more experienced Unix user would be better equipped to answer.

Question: does the depth of the file in a directory influence the speed at which a file is read or the success of the file's execution?

Eg: If a file (x) is placed in /home/esr/WWW/ldp as opposed to /home would it play any role in how smootly/successfully x is accessed because there are more i-nodes to look up or is the difference negligable?

I know the question seems trivial but I wish to be more prudent in my file allocation if it is a significant factor. Z/Z
 
Old 02-01-2012, 08:25 AM   #2
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
I think as long as you keep the file in the same device (hard drive) your OS just see it as the name of the file.
what I mean is that when you move a file from your download directory to the music directory the OS is just renaming the file from

/home/user/downloads/file.mp3 to /home/user/music/file.mp3

So the OS sees the path as part of the name of the file and it will take the same time to read it.

If you are reading a file from a second hard drive, from a USB or a CD then it will take longer.
 
1 members found this post helpful.
Old 02-01-2012, 09:03 AM   #3
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Original Poster
Rep: Reputation: 2
Wink

Hi TroN,
I took your advice and dled the Slackware distro and I'll take it for a spin a little later. I am told it is the Linux distro that most resembles an official ( not sure if that is the right terminology ) Unix OS. Pretty sure you advised me to try it out before I get mired in a single distro so I am taking that advice.

The tutorial links I was given on this forum are very good. I find the basics of computer operation to be fascinating... sort of like reading an old book I have long forgotten except the math-type sections (My personal quote in my high school yearbook was "!@#$ing polynomials"). Take it sleazy Z/Z
 
Old 02-01-2012, 09:34 AM   #4
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,060

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Quote:
Originally Posted by LinuxNoobX View Post
Eg: If a file (x) is placed in /home/esr/WWW/ldp as opposed to /home would it play any role in how smootly/successfully x is accessed because there are more i-nodes to look up or is the difference negligable?
My suspicion (...not done any testing...), is that, for the question that you mean, the difference is negligible, but that it needn't be.

I think that you are thinking of the case in which both /home/esr/WWW/ldp and /home are on the same partition.

In the case that they are not, all bets could be off. The extreme case, eg /home/esr (and the way down from there) would be on an SSD (or, say, on a big Raid array), and the SSD would be a lot faster than the clanking mechanical drive stuff, and whatever difference in the accessing of the metadata would be overwhelmed by the time taken to read the data, assuming that there is any reasonable amount of it. Also, once the data is on different partitions, the file system could be different, the journalling options could be different (...and that can be one of the reasons for having the data on different partitions...) and you might even have atime set.

Quote:
I am told it is the Linux distro that most resembles an official...
Well, I know what you mean, but you'll probably cause less controversy with a word like 'pure', in as much as Slack probably makes as few home grown tweaks to some kind of unmolested Linux. The other side of that particular coin is that Slack probably comes the least distance to meet the User in making things easier by messing about with a 'pure' Linux base, too.

There isn't, in the sense that you probably mean, an official Linux; there is, more or less, an official Kernel, but everything that an ordinary user interfaces with isn't the Kernel, but Userland tools and GUI, so that doesn't really constrain what the user interfaces with in any real way.
 
1 members found this post helpful.
Old 02-01-2012, 10:31 AM   #5
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
All I have to say is that if you decided to go with SlackWare be prepare to spend time under the hood. Become friend with your terminal and learn how to use a text editor.

Good luck.
 
1 members found this post helpful.
Old 02-01-2012, 10:52 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Vague memories from UNIX days of something I never fully understood ...

It used to be that when a new entry (file or directory) was created in a directory, the system would take a write lock on the directory until the new entry was created. If another process started to create a new entry in the same directory and found it write locked, the system would write lock the parent directory as a queueing method (?). When the first directory write lock was removed the system would grant the second process a write lock on it and release the lock on the parent directory.

This could result in the root directory becoming locked which would result in new entry failing (or queueing in-kernel rather than in the file system?).

The recommendation was to design directory usage so that directories which were used for frequent new entry creations (and deletion?) should be many directories below /
 
1 members found this post helpful.
Old 02-01-2012, 12:03 PM   #7
LinuxNoobX
Member
 
Registered: Jan 2012
Location: Evermore
Distribution: Linux Mint 12
Posts: 165

Original Poster
Rep: Reputation: 2
Wink

Thanks everybody. While some of the terminology is new to me I can follow the general line of thought. See you around TroN... I gots a glowy frisbee with your name on it Z/Z
 
  


Reply

Tags
file association


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
optimal file system for cfi flash? subhashini.s Linux - Embedded & Single-board computer 3 12-01-2008 09:31 AM
File Space Allocation + Writing (C++) tntcoder Programming 0 08-07-2007 01:12 PM
most optimal way to read a text file that is gzip'ed in C? hedpe Programming 2 06-27-2006 10:46 AM
optimal file output? zero79 Programming 1 08-30-2005 08:50 PM
Space Allocation for File Systems majicrobot Linux - Hardware 1 09-20-2004 05:06 PM


All times are GMT -5. The time now is 12:15 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration