From owner-freebsd-questions@FreeBSD.ORG Fri Apr 18 22:13:28 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2863DBBB for ; Fri, 18 Apr 2014 22:13:28 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D71A21640 for ; Fri, 18 Apr 2014 22:13:27 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WbH2B-00014c-8w for freebsd-questions@freebsd.org; Sat, 19 Apr 2014 00:13:23 +0200 Received: from cpc3-walt15-2-0-cust148.13-2.cable.virginm.net ([86.21.186.149]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2014 00:13:23 +0200 Received: from walterhurry by cpc3-walt15-2-0-cust148.13-2.cable.virginm.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Apr 2014 00:13:23 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org From: Walter Hurry Subject: Re: Bad file descriptor Date: Fri, 18 Apr 2014 22:13:10 +0000 (UTC) Lines: 43 Message-ID: References: <20140418195604.d01480f9.freebsd@ edvax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpc3-walt15-2-0-cust148.13-2.cable.virginm.net User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 22:13:28 -0000 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)