From owner-freebsd-fs@FreeBSD.ORG Sat Aug 14 05:09:06 2004 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 452FB16A4CE for ; Sat, 14 Aug 2004 05:09:06 +0000 (GMT) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 251C343D1D for ; Sat, 14 Aug 2004 05:09:06 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.10) with ESMTP id i7E593OF020897; Fri, 13 Aug 2004 22:09:03 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i7E5935B020894; Fri, 13 Aug 2004 22:09:03 -0700 Date: Fri, 13 Aug 2004 22:09:03 -0700 From: Brooks Davis To: David Kreil Message-ID: <20040814050903.GA20113@Odin.AC.HMC.Edu> References: <20040720220033.GA12560@Odin.AC.HMC.Edu> <200408140445.i7E4j8001670@puffin.ebi.ac.uk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <200408140445.i7E4j8001670@puffin.ebi.ac.uk> User-Agent: Mutt/1.5.4i cc: freebsd-fs@freebsd.org Subject: Re: "sanitizing" disks: wiping swap, non-allocated space, and file-tails X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Aug 2004 05:09:06 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 14, 2004 at 05:45:08AM +0100, David Kreil wrote: >=20 > Dear Brooks, >=20 > > > > > > The easiest way to scrub a disk is: > > > > > > > > > > > > dd if=3D/dev/random of=3D/dev/ bs=3D > > > > > > > > > > > > I noticed that it will refuse to let me do that on swap, even if it is > > > of f. Of course, I can edit the disklabel to read "unused", run dd, a= nd > > > restore the swap disklabel to "swap" but is there another way? > >=20 > > That's broken. Which OS are you using? >=20 > Don't know whether I answered that before: 5.2.1-RELEASE-p9/GENERIC >=20 > To which list, if not fs, should I send a bug-report in your opinion? It would help if you could test this under CURRENT. The -geom list is probably a good place to report this as it's probably a geom issue (though it's possiably it's actually a swap issue). > > > Also, I've just done some tests, and > > > > > > dd if=3D/dev/random of=3D/dev/ bs=3D1048576 > > > > > > only writes at 6.5MB/s on my system (/dev/zero gives 7.9MB/s). Is tha= t=3D20 > > > typical? My drives theoretically should do 30-40MB/s on read, and > > > 20-30MB/s on write. > > > > > > If these results are "normal", however, that means, for a 10GB swap f= ile > > > and, say 6 wipes, I'd be waiting 3h on shutdown, while a BND-safe tho= rough > > > 20 wipes would take half a day. Not really practical :-/ > > > So unless you tell me that I should be able to achieve much faster wr= ite > > > speeds, I think I'll have to ditch the idea of regularly wiping swap = (or > > > anything else for that matter). >=20 > Actually, I just had one of the drives in my RAID replaced (which was=20 > apparently on its way breaking down) and now get ~50MB/s write performanc= e for=20 > dd if=3D/dev/zero, and ~13MB/s for /dev/random. So if I could generate go= od=20 > pseudo-random numbers fast enough, I should be able to wipe a 10GB partit= ion=20 > 20x in an hour - that's good enough! The arc4random call will be good enough for most purposes, especially is you reseed it before each run and discard the first 256 bytes. > > If you > > really want performance, you should use arc4random in a custom userland > > program. That's faster, but expect wiping a 40GB disk to take hours > > even in that case. I've got such an application, but I haven't had time > > to clean it up and submit it for release. I'll probably do it some day, > > but I can't recommend waiting for that. It's only about 800 lines of > > code including the man page and a fancy composable operations system to > > allow just about any DoD or non-DoD pattern or writes and verifies to be > > written on the command line. >=20 > I'd be grateful if you could make your utility available. All I need > is random patterns (white noise). Would that be possible at all, > please? My program can do that. I'll see what I need to do to get it released. It may take a little while. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --3V7upXqbjpZ4EhLz Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFBHZ5uXY6L6fI4GtQRAnIGAJ0YBQu264PrQYFqx4thP9R8/T9b5ACgmXE/ yaxVir61Omx0by3NSrBe0RM= =mIQw -----END PGP SIGNATURE----- --3V7upXqbjpZ4EhLz--