From owner-freebsd-questions@FreeBSD.ORG Fri Apr 18 22:39:32 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 2E67DB8 for ; Fri, 18 Apr 2014 22:39:32 +0000 (UTC) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A5B1810 for ; Fri, 18 Apr 2014 22:39:31 +0000 (UTC) Received: from r56.edvax.de (port-92-195-108-40.dynamic.qsc.de [92.195.108.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx02.qsc.de (Postfix) with ESMTPS id 949AD276CA; Sat, 19 Apr 2014 00:32:14 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id s3IMV6Sc003260; Sat, 19 Apr 2014 00:31:06 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 19 Apr 2014 00:31:06 +0200 From: Polytropon To: Walter Hurry Subject: Re: Bad file descriptor Message-Id: <20140419003106.41d39858.freebsd@edvax.de> In-Reply-To: References: <20140418195604.d01480f9.freebsd@ edvax.de> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Apr 2014 22:39:32 -0000 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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...