From owner-freebsd-questions@FreeBSD.ORG Fri Apr 18 23:07:02 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD71C61B for ; Fri, 18 Apr 2014 23:07:02 +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 978B01A5B for ; Fri, 18 Apr 2014 23:07:02 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WbHs4-0002ZB-5e for freebsd-questions@freebsd.org; Sat, 19 Apr 2014 01:07:00 +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 01:07:00 +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 01:07:00 +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 23:06:48 +0000 (UTC) Lines: 39 Message-ID: References: < 20140419003106.41d39858.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 23:07:02 -0000 On Sat, 19 Apr 2014 00:31:06 +0200, Polytropon wrote: > On Fri, 18 Apr 2014 22:13:10 +0000 (UTC), Walter Hurry wrote: >> 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. > > This is intended. The fsck program determines the file system type which > should be apllied by examining /etc/fstab, which obviously does not > match your hard disk partitions when you boot from a USB stick. In > /etc/fstab, the connection of device, mount directory, and file system > (as well as mount and dump options) is made. > > > >> (Reminder to self: Keep a bootable USB stick handy.) >> >> * fsck -fy -t ufs /dev/ada0s2 (or whatever / is) > > Correct. Just remember to be _sure_ you know what you're doing when > using the -y option. In a ultra-worst case, this can damage your chances > in a data recovery setting. See "man fsck" for details. > > Also note that in your case, / is probably ada0s2a (MBR partitioning > type concluded), because 'a' usually denotes a bootable partition, and > ada0s2 would be the same as ada0s2c where 'c' means "the whole > partition" > (or even "the whole disk" in case slices are omitted). > So you will surely run this command: > > # fsck -yf -t ufs /dev/ada2s1a > > Partition letters 'd' to 'h' may denote further partitions inside the > slice. It won't hurt to also check them. Noted. Yes, it's MBR partitioning as I dual boot with Linux. Thanks again.