Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Oct 2002 10:43:49 +0100
From:      Matthew Seaman <m.seaman@infracaninophile.co.uk>
To:        "G. Clifford Williams" <gcw@rezidew.net>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: fsck on ext2 fs under FreeBSD
Message-ID:  <20021003094349.GA4564@happy-idiot-talk.infracaninophi>
In-Reply-To: <20021003061113.64EE843E42@mx1.FreeBSD.org>
References:  <20021003061113.64EE843E42@mx1.FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021003094349.GA4564>