From owner-freebsd-questions Thu Oct 3 2:43:59 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EB0F37B401 for ; Thu, 3 Oct 2002 02:43:58 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4ABE43E6A for ; Thu, 3 Oct 2002 02:43:56 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id g939hsOL004895; Thu, 3 Oct 2002 10:43:54 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id g939hnuL004894; Thu, 3 Oct 2002 10:43:49 +0100 (BST) Date: Thu, 3 Oct 2002 10:43:49 +0100 From: Matthew Seaman To: "G. Clifford Williams" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: fsck on ext2 fs under FreeBSD Message-ID: <20021003094349.GA4564@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , "G. Clifford Williams" , freebsd-questions@FreeBSD.ORG References: <20021003061113.64EE843E42@mx1.FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021003061113.64EE843E42@mx1.FreeBSD.org> User-Agent: Mutt/1.5.1i X-Spam-Status: No, hits=-13.9 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_03_05, USER_AGENT,USER_AGENT_MUTT version=2.41 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Oct 03, 2002 at 01:18:49AM -0500, G. Clifford Williams wrote: > does anyone know of a nice clean way to fsck ext2 volumes in FreeBSD? > I have a volume that I can't backup (yet) or copy to another drive > and I need to be able to 'clean' things up if the machine > crashes...I'd like to not have to do this manually but will if there > is no other way. Thanks in advance Well, for a start, you need the appropriate tools: happy-idiot-talk:/usr/ports:% make search key=ext2 Port: e2fsprogs-1.27 Path: /usr/ports/sysutils/e2fsprogs Info: A set of utilities and library to manipulate an ext2 filesystem Maint: ports@FreeBSD.org Index: sysutils B-deps: gmake-3.79.1_3 R-deps: Port: fsck_ext2fs-2.8 Path: /usr/ports/sysutils/fsck_ext2fs Info: Ext2fs filesystem consistency check and interactive repair Maint: roman@xpert.com Index: sysutils B-deps: R-deps: You'll have to experiment to find out which of the fsck programs from those packages suits you best. If you want to automatically fsck(8) ext2 partitions on boot-up in the same manner as the system checks UFS partitions, then you're probably going to have to write some custom startup scripts. You might be able to run something out of rc.early (see rc(8)), but remember at the point that script gets run, only the root filesystem is available and you're pretty much limited to the statically linked binaries in /sbin Otherwise, you probably need to mark any ext2 partitions in fstab as 'noauto' so the system doesn't try to mount them with the rest of the partitions, and then write yourself a mount-ext2.sh script to go in /usr/local/etc/rc.d which will run fsck_ext2fs and mount the ext2 partitions on startup, and similarly unmount them on closedown. Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message