how to fix a mount point if it fails in desktopbsd

Sometimes i get the "mount: operation not permitted" error message if i want to mount a partition on the desktopbsd laptop (codenamed jaguar).

If i look at dmesg i’ll see that it’s failing due to the partition not being clean, something like:

"WARNING: R/W mount denied. Filesystem is not clean - run fsck"

Most common cause is a fault in previous umount’ing (last night it drown out of battery).

Did the obvious thing, and fsck ( # fsck ) showed what was wrong.

EDIT: after running fsck, you’ll have to run it again  on the specific partition, until fsck marks the partition as clean.

So, i’ve also edited /etc/fstab and changed the 6th field for that mount point to 2 (was 0). So, on the next boot, it will check for consistency and if its clean it will skip the full verification. Which in my case wasn’t and took a couple of minutes to clean it.

from man fstab

The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which file system checks are done at reboot time.[…]

If the sixth field is not present or is zero, a value of zero is returned and fsck(8) will assume that the file system does not need to be checked.

as always, there’s a nice article on this in the free bsd diary

On a complementing note, it was nice to note that there are bz2 of previous messages from the system (the messages file), a and a dmesg.yesterday. I have to make my gentoo do something similar if i ever want to find out what is causing the kernel panics.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s