From owner-freebsd-hackers@FreeBSD.ORG Fri Dec 5 11:46:40 2014 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D80CBC14 for ; Fri, 5 Dec 2014 11:46:40 +0000 (UTC) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [IPv6:2a00:1450:400c:c05::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 694BDE55 for ; Fri, 5 Dec 2014 11:46:40 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id bs8so1133546wib.5 for ; Fri, 05 Dec 2014 03:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=P79dBKdNAB84mfP7Me2A9F5IdnsCHBRTee7fK8hRf5Q=; b=fFIOYjmXP7fbg6iHq3tdHHUnD6RjZDhU71wfZTV/uK3qi0B8zi6t5IVTkQSxtbRQHp oKITq7ZQyKur4dRoK9Eqof8l2V7VStesRmfIlu6/xcyPjXft7Wv4zyRscRJRqHKopE9L m9Tjy5rVRZITG5K3CN3Jr5wPwf/Buzga4YNAG5BUrZohDu+hohLzoiY8jDTB5OO+lHQY 3llikXa4SJe4hjEJ1oCT2FE/1Qe8jRXvI3zAiDLQZcsJkS3mdtxH99kCqmFT1JHds9wK kj0l2AzaKhusN6vks2BKNk56sOXlcGJ5/JTvNLgtpW+DRF1mndJv1uKoMWp6xzWBeeh/ 7Dww== X-Received: by 10.180.12.75 with SMTP id w11mr3621176wib.9.1417779998718; Fri, 05 Dec 2014 03:46:38 -0800 (PST) Received: from brick.home (adbi100.neoplus.adsl.tpnet.pl. [79.184.8.100]) by mx.google.com with ESMTPSA id n3sm1965785wiw.5.2014.12.05.03.46.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Dec 2014 03:46:37 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Fri, 5 Dec 2014 12:46:35 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: hackers@FreeBSD.org Subject: fstyp(8) Message-ID: <20141205114635.GA12557@brick.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 11:46:40 -0000 I'm slowly working on making autofs suitable for mounting removable media, and one of the things required is filesystem detection. It's kind of possible to use file(1), but it's, well, "suboptimal" for this task. So, I went and wrote fstyp(8). This utility, named after SVR4 command with same weird name, detects filesystems. It's mostly based on glabel code. The output is machine parseable, it can print out filesystem labels, and runs capsicated. You can join the review at https://reviews.freebsd.org/D1255.