LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 08-31-2008, 06:43 PM   #1
Greenwich-kid
LQ Newbie
 
Registered: Aug 2008
Location: Greenwich (London)
Distribution: FreeBSD
Posts: 3

Rep: Reputation: 0
Forced fsck


Right sadly I'm totally new to this (Windows admin, tiny knowledge of Unix or Linux) but I'm ok with a command line

I'll explain the problem and then maybe get some suggestions (Hopefully)

I've got a mail server (It runs CGP) it's a great mail server, it's on FreeBSD version 5.5 and it's been rock solid worked a dream for three years. Anyway it was my partner in crime who set it up, but however he's not available.NOw we started getting a couple of problems a while back (Probably after a p[powe routage) and I've been advised to do a Forced FSCK, now my understanding of fsck is that it will check the file system, and to do a forced fsck I need to be in single user mode. However I can't see how I can do a forced fsck. Running man fsck gives me some info but nothing about forced.
I did see a -f switch which is Force checking of file systems, even when they are marked clean (for file systems that support this). Is this the same as forced?

Plus I think when you are in single user mode you have to mount your drive before you do anything is that right?

If so then is the order of events and commands.

Boot to single user mode, run mount then run a fsck -f -y

I've already run a fsck -y but that took only about 45 -55 seconds and given I've got about 15gb of data on the drive I'm surprised, would that be normal. Seems really quick to me, but there again my only reference here is file system checking in windows.

Thanks in advance.
 
Old 08-31-2008, 11:06 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
See the manpages for fsck(8). I believe you should be able to use just:
# fsck -f

Run that from single-user mode. You do not want any filesystems mounted rw while doing so. (IIRC, that's a quick way to potentially destroy filesystems.)

Quote:
Originally Posted by Greenwich-kid
NOw we started getting a couple of problems a while back..
Describe the problems if your forced fsck does not solve them.
 
Old 08-31-2008, 11:10 PM   #3
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,337

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
I don't think that forced is relevant to your problem.

You want to run fsck against an unmounted file system. You can do that from a liveCD. Running fsck from single user mode is also acceptable. If you are using single user mode then you don't need to mount anything.

fsck runs against a partition, not against a hard drive.

So boot a liveCD or single user mode and issue a command similar to:

fsck -t ext3 -y /dev/hda1

See:

man fsck

http://linux.die.net/man/8/fsck

----------------
Steve Stites
 
Old 08-31-2008, 11:29 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Why are you linking to the Linux fsck man page? FreeBSD does not use Linux file systems.

http://www.FreeBSD.org/cgi/man.cgi?q...SE&format=html
 
Old 09-02-2008, 04:09 AM   #5
Greenwich-kid
LQ Newbie
 
Registered: Aug 2008
Location: Greenwich (London)
Distribution: FreeBSD
Posts: 3

Original Poster
Rep: Reputation: 0
Many thanks for your help guys,

As I under stand it I need to run

fsck -y /dev/idad0s1f

I ran df wheer I got idad0s1f from. All very helpful many thanks....
 
Old 09-02-2008, 09:10 AM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Quote:
Originally Posted by Greenwich-kid View Post
Many thanks for your help guys,

As I under stand it I need to run

fsck -y /dev/idad0s1f

I ran df wheer I got idad0s1f from. All very helpful many thanks....
Errr, it should be fsck -fy /dev/<special device> (I can't remember how they're named on FreeBSD exactly, but what you have "looks" right).

What do you mean by "ran df where[sic] I got idad0sf1 from"??? That's incomprehensible. Do you mean you ran the df command? If so, you do realize all that does is report the free space, right? It's not a defragment command...
 
Old 09-03-2008, 05:23 AM   #7
Greenwich-kid
LQ Newbie
 
Registered: Aug 2008
Location: Greenwich (London)
Distribution: FreeBSD
Posts: 3

Original Poster
Rep: Reputation: 0
I ran the df command so I would know the device name [idad0s1f] I assume you call this a device or partition or something?

Hmmm as to the command I ran fsck -f -y /dev/idad0s1f

Could that explain why the test appeared to be very fast about 14Gb of data there and it took about 90 secs. The command ( as in when I typed it and pressed enter) didn't give me any errors and went through a distinct process (If you see what I mean) stage 1 through to 5. Not much reporting after though. 90 secs did appear to be very fast for that amount of data. Although I have nothing to base this on as this file system is very different from ntfs, which is more my area.

Many thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
failed upgrade to 8.04 from 7.10 missing system files from forced fsck bradb-acc Ubuntu 5 06-17-2008 01:21 AM
Cancelling forced fsck?? epoh Linux - Server 4 01-28-2008 09:44 AM
FSCK Check forced - Exit Status 4 sandoz Linux - Software 12 01-24-2008 06:55 PM
Forced Fsck on reboot haze Ubuntu 1 03-20-2007 11:39 AM
How can I reboot with a forced fsck upon rebooting? abefroman Linux - Software 4 01-09-2006 09:24 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 04:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration