LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Forced fsck (https://www.linuxquestions.org/questions/%2Absd-17/forced-fsck-666737/)

Greenwich-kid 08-31-2008 06:43 PM

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.

anomie 08-31-2008 11:06 PM

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.

jailbait 08-31-2008 11:10 PM

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

chort 08-31-2008 11:29 PM

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

Greenwich-kid 09-02-2008 04:09 AM

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....

chort 09-02-2008 09:10 AM

Quote:

Originally Posted by Greenwich-kid (Post 3266999)
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...

Greenwich-kid 09-03-2008 05:23 AM

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


All times are GMT -5. The time now is 11:41 PM.