Date: Thu, 8 Dec 2011 12:24:18 +0100 From: Matthias Apitz <guru@unixarea.de> To: Hans Petter Selasky <hselasky@c2i.net> Cc: freebsd-questions@freebsd.org, freebsd-usb@freebsd.org Subject: Re: restore(8) to UFS on USB key: terrible slow Message-ID: <20111208112418.GA2370@tinyCurrent> In-Reply-To: <201112081147.46641.hselasky@c2i.net> References: <20111208063711.GA6482@tinyCurrent> <201112081010.36695.hselasky@c2i.net> <20111208091943.GA7014@tinyCurrent> <201112081147.46641.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <guru@unixarea.de> - 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111208112418.GA2370>