Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Apr 2014 22:13:10 +0000 (UTC)
From:      Walter Hurry <walterhurry@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Bad file descriptor
Message-ID:  <lis81l$gro$1@ger.gmane.org>
References:  <lirg9p$khs$1@ger.gmane.org> <20140418195604.d01480f9.freebsd@ edvax.de>

next in thread | previous in thread | raw e-mail | index | archive | help
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)





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?lis81l$gro$1>