Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Apr 2014 00:31:06 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Walter Hurry <walterhurry@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Bad file descriptor
Message-ID:  <20140419003106.41d39858.freebsd@edvax.de>
In-Reply-To: <lis81l$gro$1@ger.gmane.org>
References:  <lirg9p$khs$1@ger.gmane.org> <20140418195604.d01480f9.freebsd@ edvax.de> <lis81l$gro$1@ger.gmane.org>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140419003106.41d39858.freebsd>