Linux - SoftwareThis 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.
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.
Use df -M to see if you're running out of space in the filesystem and df -i to see if you're running out of inodes. top will show you which processes consume cpu and memory.
Thanks for the help!
I don't have the option of df -M, but I used df -h to see how much I had left. What does the -M option do?
when i did df -i this is what I received for the device the directory is on.
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda3 3.2M 399K 2.8M 13% /
That means I should be good to go for a long time correct? I shouldn't worry about having too many files in one directory (300,000+ files)?
It would seem that you only have one partition on your machine.
If this is the case, are the majority of these files in on directory?
This would cause an overhead with the client machine trying to get the information of all of these files to provide a directory list and would most likely be the cause of the "hang"
As a test, create a directory called example: mkdir example
List the latest 1000 files and copy them to example (note this creates duplicates of these files):
Code:
ls -lt|head -1000|while read v_file
do
cp -p $v_file example/.
done
Then on your samba client look at the example directory and see how long it takes to compile the list.
Assuming this takes a short while to come back, I would suggest you have a period of organisation ahead of you.
Yes I'm sure the hang was caused by windows weak ability to handle a large directory list. (yay for them!)
The hang up it caused has made me afraid to even go into the directory through the shell and do a simple "ls" for fear or bringing the server down. Should I have anything to be afraid of?
LS (in lower case) is the Unix/Linux command to list files in a directory (equivilant to dir), so you would need to do my suggestion on the Samba file server itself (not from the client machine)
ls | head -1000
redirects the output of LS to the command HEAD. The charecter in between is called a pipe, and would be shown on your keyboard as a line with a gap in the middle.
The head command takes the first 1000 entries from the previous command.
These can then be passed to the next command:
while read v_file
This starts a while do done loop and reads input into the v_file variable for each loop
cp -p $v_file example/.
copies the file stored in the v_file parameter to the directory example calling the file the same name and keeping the ownership security permissions and timedate stamp information from the original file.
Disillusionist
You're script is the best! Do you have a good book to recommend for /bin/sh scripts? I am pretty good with perl so I figure the oreilly books sould be pretty good right?
Probably one of the best alround books is "Unix Power Tools"
This covers:
* the various types of scripting languages available (including bourne, c, korn and perl)
* powerful utilities like sed and awk
* text editors (vi and emacs)
and much more.
It even has the best part of a chapter dedicated to working with Samba.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.