Error in UFS file system (fsck) on BSD 1

Erstellt von René Keller am 29. Juni 2008

Yesterday I’ve recognized some write errors on a freebsd server. So I did a fsck on each slices and saw a lot of errors in the filesystem. Unfortunately, fsck is in “NO WRITE” mode on a mounted file system, so I was not able to fix the errors.

Because I have only remote access to the server (don’t want to drive to the data center on saturday evening ;) ) it was not possible to reboot the system and reboot in “single user mode” (boot -s).

As I know from linux, I looked first at a command telling the OS to check the drive (or partition or slice) at the next boot - unsuccessfully.

The FreeBSD (and I think *BSD) solution is to enable fsck -y on every boot in the /etc/rc.conf.


If the system crashes, fsck notes that the drive is not umounted properly and does its test, answering every question with “YES”.

But the system is properly unmounted. Accordingly, fsck does not do a drive check on the startup. To get a system in this state, I did the following:

  1. Stop all important services on the system (like mysql, apache, mail services, et cetera)
  2. reboot -qn

-q stands for “The system is halted or restarted quickly and ungracefully, [...]” and -n for “The file system cache is not flushed. [...]”

This variant is not very elegant, but it works. If you are willing to do it the same way, do it for your own risk. I will not issue any guarantee. ;)


Klicke den Link an, um zur ursprünglichen Seite zurück zu kehren.


You must be logged in to leave a response.