Bad file descriptor

Walter Hurry walterhurry at
Fri Apr 18 22:13:28 UTC 2014

On Fri, 18 Apr 2014 19:56:04 +0200, Polytropon wrote:

> On Fri, 18 Apr 2014 15:27:53 +0000 (UTC), Walter Hurry wrote:
>> FreeBSD 9.2-RELEASE
>> I have a handful of files in a subdirectory of /usr/ports/multimedia/
>> gstreamer/work, which show up as 'Bad file descriptor'. It appears that
>> I am unable to delete them.
> This sounds familiar - like file system corruption.
>> /usr/ports is on my root partition/slice, which is ufs with
>> journalling.
>> On rebooting, it says the partition/slice is clean, so checking is
>> skipped.
> A check should be forced anyway. Use "fsck -f" to do so.
>> I gather that the way to fix this is to run fsck with the -f option. Is
>> this correct? If so, how do I get / unmounted? Or is there a way to
>> force a check on reboot before mounting?
> The easiest way is to boot from optical media (CD or DVD #1) or USB
> stick. It _may_ be possible to boot into single user mode (use "boot -s"
> after reboot) where / is mounted r/o. There is no way to unmount / while
> the system is running, even in single user mode this is problematic, so
> a second (live) system seems to be the safest way.

Thanks once again, Polytropon.

Booted from a USB stick. I was disconcerted for a minute or two when fsck 
said it couldn't recognise the filesystem, but after I inserted '-t ufs' 
into the fsck command*, all was well.

(Reminder to self: Keep a bootable USB stick handy.)

* fsck -fy -t ufs /dev/ada0s2 (or whatever / is)

More information about the freebsd-questions mailing list