From: Matt Reppert <arashi@arashi.yi.org>
To: Adam Voigt <adam@cryptocomm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: File Limit in Kernel?
Date: Tue, 12 Nov 2002 10:12:01 -0600 [thread overview]
Message-ID: <20021112101201.0c86bf3a.arashi@arashi.yi.org> (raw)
In-Reply-To: <1037115535.1439.5.camel@beowulf.cryptocomm.com>
On 12 Nov 2002 10:38:55 -0500
Adam Voigt <adam@cryptocomm.com> wrote:
> I have a directory with 39,000 files in it, and I'm trying to use the cp
> command to copy them into another directory, and neither the cp or the
> mv command will work, they both same "argument list too long" when I
> use: cp -f * /usr/local/www/images
>
> Is this a kernel limitation?
Yes, but you can get around it in userspace. See
http://www.linuxjournal.com/article.php?sid=6060
(Short answer is this from include/linux/binfmts.h.:
/*
* MAX_ARG_PAGES defines the number of pages allocated for arguments
* and envelope for the new program. 32 should suffice, this gives
* a maximum env+arg of 128kB w/4KB pages!
*/
#define MAX_ARG_PAGES 32
I'm assuming your arch has 4kb pages, so the 'problem' is that you're
passing more than 128kb of cmdline arguments.)
> If yes, how can I get around it?
The article has a bunch of ways. You don't really need to change
the kernel though ... if you don't mind generating 39000 new processes
one after the other, I'd do something like 'for FILE in * ; do mv $FILE
/usr/local/www/images ; done'. Probably slower than calling mv once due
to process overhead done 39000 times, but it *works*, and it's simple.
(If you use a csh instead of something bash-like, change that to fit.)
Matt
next prev parent reply other threads:[~2002-11-12 16:05 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-12 15:38 Adam Voigt
2002-11-12 15:57 ` Andreas Gruenbacher
2002-11-13 9:51 ` Jan Hudec
2002-11-13 10:49 ` Andreas Schwab
2002-11-12 16:01 ` Kent Borg
2002-11-12 16:26 ` Mark Mielke
2002-11-12 16:06 ` Chris Friesen
2002-11-12 16:08 ` Richard B. Johnson
2002-11-12 16:12 ` Matt Reppert [this message]
2002-11-12 16:16 ` Bernd Eckenfels
2002-11-12 23:23 ` Bill Davidsen
[not found] <1037115535.1439.5.camel@beowulf.cryptocomm.com.suse.lists.linux.kernel>
2002-11-12 15:53 ` Andi Kleen
2002-11-12 21:54 ` Pavel Machek
2002-11-19 15:14 ` Shalon Wood
2002-11-19 19:44 ` Pavel Machek
2002-11-12 21:55 ` Jamie Lokier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021112101201.0c86bf3a.arashi@arashi.yi.org \
--to=arashi@arashi.yi.org \
--cc=adam@cryptocomm.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome