From owner-freebsd-questions@FreeBSD.ORG Thu Dec 8 11:24:23 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5AC41065679; Thu, 8 Dec 2011 11:24:23 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id 387558FC14; Thu, 8 Dec 2011 11:24:23 +0000 (UTC) Received: from [88.217.23.127] (helo=localhost.my.domain) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1RYc5N-0003MT-8g; Thu, 08 Dec 2011 12:24:21 +0100 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.my.domain (8.14.4/8.14.3) with ESMTP id pB8BOJJZ002402; Thu, 8 Dec 2011 12:24:19 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.14.4/8.14.3/Submit) id pB8BOITM002401; Thu, 8 Dec 2011 12:24:19 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Thu, 8 Dec 2011 12:24:18 +0100 From: Matthias Apitz To: Hans Petter Selasky Message-ID: <20111208112418.GA2370@tinyCurrent> References: <20111208063711.GA6482@tinyCurrent> <201112081010.36695.hselasky@c2i.net> <20111208091943.GA7014@tinyCurrent> <201112081147.46641.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201112081147.46641.hselasky@c2i.net> X-Operating-System: FreeBSD 9.0-CURRENT r214444 (i386) User-Agent: Mutt/1.5.21 (2010-09-15) X-Con-Id: 51246 X-Originating-IP: 88.217.23.127 Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: restore(8) to UFS on USB key: terrible slow X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2011 11:24:23 -0000 El día Thursday, December 08, 2011 a las 11:47:46AM +0100, Hans Petter Selasky escribió: > > I know (as I said) that dd(1) per default writes in blocks of 512 bytes; > > but this is not the problem; the problem is the poor performance of > > restore(8); the dd(1) was just to see if the USB key performs fast > > enough in general; please read my post again :-) > > Hi, > > The "restore" utility also has a -b option for blocksize. Did you try that? Hi, I know, but I think this does not make any diff, because at the moment restore(8) is only creating (empty) dirs and not storing files to the disk; if one watches the restore(8) with truss(1) it looks like this: # truss -p 2123 write(1,"Make node ./home/guru/myThings/F"...,80) = 80 (0x50) lseek(4,0x0,SEEK_CUR) = 4517312 (0x44edc0) lseek(4,0x44ec98,SEEK_SET) = 4517016 (0x44ec98) read(4,"7t\^W\0\f\0\^D\^A.\0\0\0(t\^W\0"...,1024) = 1024 (0x400) lseek(4,0x0,SEEK_CUR) = 4518040 (0x44f098) mkdir("./home/guru/myThings/FreeBSD/9-CURRENT/src/secure/libexec/sftp-server/.svn",0777) = 0 (0x0) write(1,"Make node ./home/guru/myThings/F"...,85) = 85 (0x55) lseek(4,0x0,SEEK_CUR) = 4518040 (0x44f098) lseek(4,0x44ece0,SEEK_SET) = 4517088 (0x44ece0) read(4,"8t\^W\0\f\0\^D\^A.\0\0\0007t\^W"...,1024) = 1024 (0x400) lseek(4,0x0,SEEK_CUR) = 4518112 (0x44f0e0) i.e. it goes through the DUMP and makes the directories; and any mkdir(2) takes seconds!!! one can even see this with: # truss -d mkdir /mnt/foo ... 0.012703011 sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0) 9.774846524 mkdir("/mnt/foo",0777) = 0 (0x0) 9.775744404 sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|SIGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) it takes so long to do mkdir(2) until now there are no files below /mnt, only dirs; matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/ UNIX since V7 on PDP-11 | UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2 | FreeBSD since 2.2.5