From owner-freebsd-fs@FreeBSD.ORG Tue Jul 10 13:00:18 2007 Return-Path: X-Original-To: freebsd-fs@freebsd.org Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0B1AE16A421 for ; Tue, 10 Jul 2007 13:00:18 +0000 (UTC) (envelope-from bv@bilver.wjv.com) Received: from wjv.com (fl-65-40-24-38.sta.embarqhsd.net [65.40.24.38]) by mx1.freebsd.org (Postfix) with ESMTP id 39DFD13C459 for ; Tue, 10 Jul 2007 13:00:16 +0000 (UTC) (envelope-from bv@bilver.wjv.com) Received: from bilver.wjv.com (localhost.wjv.com [127.0.0.1]) by wjv.com (8.14.1/8.13.1) with ESMTP id l6ACf61M002506; Tue, 10 Jul 2007 08:41:06 -0400 (EDT) (envelope-from bv@bilver.wjv.com) Received: (from bv@localhost) by bilver.wjv.com (8.14.1/8.13.1/Submit) id l6ACf1Eq002503; Tue, 10 Jul 2007 08:41:01 -0400 (EDT) (envelope-from bv) Date: Tue, 10 Jul 2007 08:40:50 -0400 From: Bill Vermillion To: Gore Jarold Message-ID: <20070710124050.GA2184@wjv.com> References: <423307.86822.qm@web63003.mail.re1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <423307.86822.qm@web63003.mail.re1.yahoo.com> User-Agent: Mutt/1.4.2.2i Organization: W.J.Vermillion / Orlando - Winter Park ReplyTo: bv@wjv.com X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED,SPF_HELO_PASS, SPF_PASS autolearn=unavailable version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on bilver.wjv.com Cc: freebsd-fs@freebsd.org Subject: Re: help needed - tuning a filesystem for rm and cp ? (MORE) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bv@wjv.com List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2007 13:00:18 -0000 "Ang utong ko ay sasabog sa sarap!" exclaimed Gore Jarold while reading this message on Mon, Jul 09, 2007 at 21:34 and then responded with: > > Some more information on my question... > The directories on the single mount point that I am > referring to are varied in depth and density - but > some of them have as many as a few million inodes in > them and can go 5-10 levels deep. > But that is not a rule - it is a large multi-user > system (think old school shell server) with hundreds > of users that can populate their home directories with > anything they want. The only thing I can say for sure > is that I am using 2.5 TB of space (out of 8 TB) and > am using 23.8 million inodes. > So it's not that dense with inodes at all, but there > is no telling how even a distribution that is - a > cp/rm target might not be represented well by the > average (ie. they might be very sparse or very dense) > So again, all is well, but I have these long 'cp' and > 'rm' processes that I would like to speed up, if > possible. > All else being equal, how do you optimize a system for > copying from one place to another on the same mount > point ? How do you optimize a system for fast file > deletion ? Are the two mutually exclusive ? I've not done this recently as I've not had to, but when you need to move files from one place to another >on the same filesystem< you don't have to copy them. Use cpio with the -pdlm arguments. This will make hard links from the original file locations to the new file location. Then you can just 'rm' the original directory entries and the new directory will be running just as the old one. -p is passthrough, -d makes directories as needed, -l make links but you must use the -p option, and -v is verbose. I always run this way as I like to see just exactly what is going on. The big upside of this is that you only build directories and it does NOT move the files themselves. Thus both the build new directory and remove the old directories are going to be much faster than copying files. It can be quite fast. Just checking the man pages for FreeBSD's cpio, I see the flags have greatly expanded, as I used to just use the -pdlm flags on System V.3 systems I was running. You may have to go thorugh manual carefuly to make sure of the flags. Bill -- Bill Vermillion - bv @ wjv . com