From owner-freebsd-fs@FreeBSD.ORG Sun Aug 15 00:06:59 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 7F09816A4CE for ; Sun, 15 Aug 2004 00:06:59 +0000 (GMT) Received: from maui.ebi.ac.uk (maui.ebi.ac.uk [193.62.196.100]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4006843D3F for ; Sun, 15 Aug 2004 00:06:58 +0000 (GMT) (envelope-from kreil@ebi.ac.uk) Received: from puffin.ebi.ac.uk (puffin.ebi.ac.uk [193.62.196.89]) by maui.ebi.ac.uk (8.11.7+Sun/8.11.7) with ESMTP id i7F06tF23495; Sun, 15 Aug 2004 01:06:55 +0100 (BST) Received: from puffin.ebi.ac.uk (kreil@localhost) by puffin.ebi.ac.uk (8.11.6/8.11.6) with ESMTP id i7F06s717877; Sun, 15 Aug 2004 01:06:55 +0100 Message-Id: <200408150006.i7F06s717877@puffin.ebi.ac.uk> X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 To: Brooks Davis In-Reply-To: Your message of "Fri, 13 Aug 2004 22:09:03 PDT." <20040814050903.GA20113@Odin.AC.HMC.Edu> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 15 Aug 2004 01:06:54 +0100 From: David Kreil X-EBI-Information: This email is scanned using www.mailscanner.info. X-EBI: Found to be clean X-EBI-SpamCheck: not spam, SpamAssassin (score=-8, required 5, HABEAS_SWE -8.00) cc: freebsd-fs@freebsd.org cc: David Kreil 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: Sun, 15 Aug 2004 00:06:59 -0000 Dear Brooks, Thank you very much for your fast and friendly response. > > > > > > > The easiest way to scrub a disk is: > > > > > > > > > > > > > > dd if=/dev/random of=/dev/ bs= > > > > > > > > > > > > > > > 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, > > > > and restore the swap disklabel to "swap" but is there another way? > > > > > > That's broken. Which OS are you using? > > > > Don't know whether I answered that before: 5.2.1-RELEASE-p9/GENERIC > > 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). Ok, I'll try and get CURRENT checked out and compiled and test it there, too. > > apparently on its way breaking down) and now get ~50MB/s write > > performance for dd if=/dev/zero, and ~13MB/s for /dev/random. So if > > I could generate good pseudo-random numbers fast enough, I should be > > able to wipe a 10GB partition 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. > > [...] > > > > 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. > > > > 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. That is great, thank you very much! > It may take a little while. I understand. Can you give me a rough idea at all of when you might find the time? With many thanks again and best regards, David. ------------------------------------------------------------------------ Dr David Philip Kreil ("`-''-/").___..--''"`-._ Research Fellow `6_ 6 ) `-. ( ).`-.__.`) University of Cambridge (_Y_.)' ._ ) `._ `. ``-..-' ++44 1223 764107, fax 333992 _..`--'_..-_/ /--'_.' ,' www.inference.phy.cam.ac.uk/dpk20 (il),-'' (li),' ((!.-' From owner-freebsd-fs@FreeBSD.ORG Mon Aug 16 16:30:26 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 5FB6016A4CE for ; Mon, 16 Aug 2004 16:30:26 +0000 (GMT) Received: from mail.freebsd.org.cn (dns3.freebsd.org.cn [61.129.66.75]) by mx1.FreeBSD.org (Postfix) with SMTP id B9DC243D58 for ; Mon, 16 Aug 2004 16:30:24 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: (qmail 44241 invoked by uid 0); 16 Aug 2004 16:27:39 -0000 Received: from unknown (HELO beastie.frontfree.net) (219.239.98.7) by mail.freebsd.org.cn with SMTP; 16 Aug 2004 16:27:39 -0000 Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 3C5F411710; Tue, 17 Aug 2004 00:30:20 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 01419-07; Tue, 17 Aug 2004 00:30:18 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id 19BEE11774; Tue, 17 Aug 2004 00:30:17 +0800 (CST) Date: Tue, 17 Aug 2004 00:30:17 +0800 From: Xin LI To: re@FreeBSD.org, freebsd-fs@FreeBSD.org Message-ID: <20040816163017.GA2890@frontfree.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="/WwmFnJnmDyWGHa4" Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-delphij FreeBSD 5.2-delphij #3: Fri Jul 30 20:01:43 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net Subject: [PATCH] Generalize BAD_MAGIC usage so it will apply to UFS1 too 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: Mon, 16 Aug 2004 16:30:26 -0000 --/WwmFnJnmDyWGHa4 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, Here is a patch which will generalize UFS2's BAD FLAG to UFS1 initialization as well. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch-ufs2 Content-Transfer-Encoding: quoted-printable Index: src/sbin/fsck_ffs/setup.c diff -u src/sbin/fsck_ffs/setup.c:1.47 src/sbin/fsck_ffs/setup.c:1.47.1000.1 --- src/sbin/fsck_ffs/setup.c:1.47 Sat Apr 10 03:58:28 2004 +++ src/sbin/fsck_ffs/setup.c Wed May 12 05:53:32 2004 @@ -306,7 +306,7 @@ super =3D bflag; if ((bread(fsreadfd, (char *)&sblock, super, (long)SBLOCKSIZE))) return (0); - if (sblock.fs_magic =3D=3D FS_BAD2_MAGIC) { + if (sblock.fs_magic =3D=3D FS_BAD_MAGIC) { fprintf(stderr, BAD_MAGIC_MSG); exit(11); } @@ -322,7 +322,7 @@ if ((bread(fsreadfd, (char *)&sblock, super, (long)SBLOCKSIZE))) return (0); - if (sblock.fs_magic =3D=3D FS_BAD2_MAGIC) { + if (sblock.fs_magic =3D=3D FS_BAD_MAGIC) { fprintf(stderr, BAD_MAGIC_MSG); exit(11); } Index: src/sbin/newfs/mkfs.c diff -u src/sbin/newfs/mkfs.c:1.85 src/sbin/newfs/mkfs.c:1.85.1000.1 --- src/sbin/newfs/mkfs.c:1.85 Sat Apr 10 03:58:33 2004 +++ src/sbin/newfs/mkfs.c Wed May 12 05:53:36 2004 @@ -236,8 +236,14 @@ } sblock.fs_fsbtodb =3D ilog2(sblock.fs_fsize / sectorsize); sblock.fs_size =3D fssize =3D dbtofsb(&sblock, fssize); + + /* + * Before the filesystem is finally initialized, mark it + * as incompletely initialized. + */ + sblock.fs_magic =3D FS_BAD_MAGIC; + if (Oflag =3D=3D 1) { - sblock.fs_magic =3D FS_UFS1_MAGIC; sblock.fs_sblockloc =3D SBLOCK_UFS1; sblock.fs_nindir =3D sblock.fs_bsize / sizeof(ufs1_daddr_t); sblock.fs_inopb =3D sblock.fs_bsize / sizeof(struct ufs1_dinode); @@ -257,7 +263,6 @@ sblock.fs_old_postblformat =3D 1; sblock.fs_old_nrpos =3D 1; } else { - sblock.fs_magic =3D FS_BAD2_MAGIC; sblock.fs_sblockloc =3D SBLOCK_UFS2; sblock.fs_nindir =3D sblock.fs_bsize / sizeof(ufs2_daddr_t); sblock.fs_inopb =3D sblock.fs_bsize / sizeof(struct ufs2_dinode); @@ -455,8 +460,8 @@ } if (Eflag =3D=3D 2) printf("** Leaving BAD MAGIC on Eflag 2\n"); - else if (Oflag !=3D 1) - sblock.fs_magic =3D FS_UFS2_MAGIC; + else + sblock.fs_magic =3D (Oflag !=3D 1) ? FS_UFS2_MAGIC : FS_UFS1_MAGIC; =20 /* * Now build the cylinders group blocks and Index: src/sys/ufs/ffs/fs.h diff -u src/sys/ufs/ffs/fs.h:1.43 src/sys/ufs/ffs/fs.h:1.42.1000.2 --- src/sys/ufs/ffs/fs.h:1.43 Tue Jun 1 00:53:46 2004 +++ src/sys/ufs/ffs/fs.h Tue Jun 1 22:52:01 2004 @@ -357,7 +357,7 @@ */ #define FS_UFS1_MAGIC 0x011954 /* UFS1 fast filesystem magic number */ #define FS_UFS2_MAGIC 0x19540119 /* UFS2 fast filesystem magic number */ -#define FS_BAD2_MAGIC 0x19960408 /* UFS2 incomplete newfs magic number */ +#define FS_BAD_MAGIC 0x19960408 /* UFS incomplete newfs magic number */ #define FS_OKAY 0x7c269d38 /* superblock checksum */ #define FS_42INODEFMT -1 /* 4.2BSD inode format */ #define FS_44INODEFMT 2 /* 4.4BSD inode format */ --J2SCkAp4GZ/dPZZf-- --/WwmFnJnmDyWGHa4 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBIOEZOfuToMruuMARAjQXAJwKkqVJEWKeBhI2gEKXJC1mmyhS9gCdFiB+ 0qFHkRWg8TgAwTYh7p9CYJY= =+Q3z -----END PGP SIGNATURE----- --/WwmFnJnmDyWGHa4-- From owner-freebsd-fs@FreeBSD.ORG Tue Aug 17 03:54:05 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 1FAF916A4CE; Tue, 17 Aug 2004 03:54:05 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id C1C4243D41; Tue, 17 Aug 2004 03:54:04 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from pooker.samsco.org (scottl@localhost [127.0.0.1]) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id i7H3sPOr057358; Mon, 16 Aug 2004 21:54:25 -0600 (MDT) (envelope-from scottl@freebsd.org) Received: from localhost (scottl@localhost)i7H3sOsq057355; Mon, 16 Aug 2004 21:54:25 -0600 (MDT) (envelope-from scottl@freebsd.org) X-Authentication-Warning: pooker.samsco.org: scottl owned process doing -bs Date: Mon, 16 Aug 2004 21:54:24 -0600 (MDT) From: Scott Long Sender: scottl@pooker.samsco.org To: Xin LI In-Reply-To: <20040816163017.GA2890@frontfree.net> Message-ID: <20040816215320.K32601@pooker.samsco.org> References: <20040816163017.GA2890@frontfree.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org cc: freebsd-fs@freebsd.org cc: re@freebsd.org Subject: Re: [PATCH] Generalize BAD_MAGIC usage so it will apply to UFS1 too 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: Tue, 17 Aug 2004 03:54:05 -0000 On Tue, 17 Aug 2004, Xin LI wrote: > Hi, > > Here is a patch which will generalize UFS2's BAD FLAG to UFS1 initialization > as well. > > Cheers, > -- I like the idea of this patch, but I really hate messing around in the filesystem right before a release. Have you sent this directly to Kirk McKusick and Tor Egge? Scott From owner-freebsd-fs@FreeBSD.ORG Wed Aug 18 16:13:45 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 B619716A4CE for ; Wed, 18 Aug 2004 16:13:45 +0000 (GMT) Received: from mail.freebsd.org.cn (dns3.freebsd.org.cn [61.129.66.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 0BBA143D41 for ; Wed, 18 Aug 2004 16:13:42 +0000 (GMT) (envelope-from delphij@frontfree.net) Received: (qmail 65450 invoked by uid 0); 18 Aug 2004 16:10:53 -0000 Received: from unknown (HELO beastie.frontfree.net) (219.239.98.7) by mail.freebsd.org.cn with SMTP; 18 Aug 2004 16:10:53 -0000 Received: from localhost (localhost.frontfree.net [127.0.0.1]) by beastie.frontfree.net (Postfix) with ESMTP id 104C1130F6E; Wed, 18 Aug 2004 23:17:44 +0800 (CST) Received: from beastie.frontfree.net ([127.0.0.1]) by localhost (beastie.frontfree.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 00345-04; Wed, 18 Aug 2004 23:17:34 +0800 (CST) Received: by beastie.frontfree.net (Postfix, from userid 1001) id B4D68130EFD; Wed, 18 Aug 2004 23:17:33 +0800 (CST) Date: Wed, 18 Aug 2004 23:17:33 +0800 From: Xin LI To: scottl@pooker.samsco.org Message-ID: <20040818151733.GA4080@frontfree.net> References: <20040818144557.0AE73130F3E@beastie.frontfree.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline In-Reply-To: <20040818144557.0AE73130F3E@beastie.frontfree.net> User-Agent: Mutt/1.4.2.1i X-GPG-key-ID/Fingerprint: 0xCAEEB8C0 / 43B8 B703 B8DD 0231 B333 DC28 39FB 93A0 CAEE B8C0 X-GPG-Public-Key: http://www.delphij.net/delphij.asc X-Operating-System: FreeBSD beastie.frontfree.net 5.2-delphij FreeBSD 5.2-delphij #0: Tue Aug 17 14:22:25 CST 2004 delphij@beastie.frontfree.net:/usr/obj/usr/src/sys/BEASTIE i386 X-URL: http://www.delphij.net X-By: delphij@beastie.frontfree.net X-Location: Beijing, China X-Virus-Scanned: by amavisd-new at frontfree.net cc: freebsd-fs@FreeBSD.org cc: re@FreeBSD.org Subject: Re: [PATCH] Generalize BAD_MAGIC usage so it will apply to UFS1 too 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: Wed, 18 Aug 2004 16:13:45 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Scott, Sorry for the late response. My mail server has experienced a hardware problem and I lost all mails on it. > I like the idea of this patch, but I really hate messing around in the > filesystem right before a release. Have you sent this directly to Kirk > McKusick and Tor Egge? I have sent the patch to Wes Peters (the author of BAD UFS flag) and Kirk about half year ago. Wes has told me that he has glanced at the code but got no chance to test it (in a private mail, or somewhere in current@, I can't remember it correctly). While this patch was throughly tested (as it lived in my local repository for a long time, and was deployed in many situations), I'd admit that it is good not to mess with filesystem at this point. This is just a ``heads-= up'' for the release engineering team, as I forgot to mention the patch earlier, sigh. Cheers, --=20 Xin LI http://www.delphij.net/ See complete headers for GPG key and other information. --XsQoSWH+UP9D9v3l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (FreeBSD) iD8DBQFBI3MNOfuToMruuMARAphgAJ9u6tiVt3+MwaQc4owVbzfTshwTHwCfeAYK DcNHFtrLjubijG5FNfeYh4E= =trx5 -----END PGP SIGNATURE----- --XsQoSWH+UP9D9v3l-- From owner-freebsd-fs@FreeBSD.ORG Fri Aug 20 11:27:13 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 F068516A4CE for ; Fri, 20 Aug 2004 11:27:13 +0000 (GMT) Received: from kazna.rv.ua (kazna.rv.ua [194.44.252.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id 18A5D43D53 for ; Fri, 20 Aug 2004 11:27:13 +0000 (GMT) (envelope-from eol@kazna.rv.ua) Received: from [10.75.1.1] ([10.73.1.27]) by kazna.rv.ua (kazna.rv.ua [194.44.252.27]) (MDaemon.PRO.v7.1.2.R) with ESMTP id md50000000964.msg for ; Fri, 20 Aug 2004 14:24:42 +0300 Received: from comput10.rv.treasury.gov.ua by [10.75.1.1] via smtpd (for [10.75.1.2]) with ESMTP; Fri, 20 Aug 2004 14:21:03 +0300 Date: Fri, 20 Aug 2004 14:26:34 +0300 From: Eugene Olkhovick X-Mailer: The Bat! (v2.04.7) Business Organization: TreRk X-Priority: 3 (Normal) Message-ID: <516113623.20040820142634@kazna.rv.ua> To: freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Processed: kazna.rv.ua, Fri, 20 Aug 2004 14:24:42 +0300 (not processed: spam filter disabled) X-MDRemoteIP: 10.73.1.27 X-Return-Path: eol@kazna.rv.ua X-MDaemon-Deliver-To: freebsd-fs@freebsd.org X-MDAV-Processed: kazna.rv.ua, Fri, 20 Aug 2004 14:24:44 +0300 Subject: How to restore X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Eugene Olkhovick List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Aug 2004 11:27:14 -0000 Hello freebsd-fs, I lost some of my important files on my HD. But in /lost+found I see my files with changed names. Can you tell me some way to restore my files from this directory instead of manual ? -- Best regards, Eugene mailto:eol@kazna.rv.ua