From owner-freebsd-arch@FreeBSD.ORG Sat Jul 8 17:40:07 2006 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DBE1416A4E1 for ; Sat, 8 Jul 2006 17:40:07 +0000 (UTC) (envelope-from freebsd-arch@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB4C043D46 for ; Sat, 8 Jul 2006 17:40:04 +0000 (GMT) (envelope-from freebsd-arch@m.gmane.org) Received: from root by ciao.gmane.org with local (Exim 4.43) id 1FzGmg-0005iF-TK for freebsd-arch@freebsd.org; Sat, 08 Jul 2006 19:40:02 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Jul 2006 19:40:02 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 08 Jul 2006 19:40:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-arch@freebsd.org From: Ivan Voras Date: Sat, 08 Jul 2006 19:37:08 +0200 Lines: 29 Message-ID: References: <20060708152801.GA3671@crodrigues.org> <44AFD7DF.8090002@errno.com> <20060708161719.GB3871@crodrigues.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050921) X-Accept-Language: en-us, en In-Reply-To: <20060708161719.GB3871@crodrigues.org> Sender: news Cc: freebsd-current@freebsd.org Subject: Re: [RFC] mount can figure out fstype automatically X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Jul 2006 17:40:08 -0000 Craig Rodrigues wrote: > - I didn't want to build up a table of known superblocks > inside mount(8) because every time a new filesystem is > added to FreeBSD, mount(8) would need to be updated There's a similar (in the basic idea, not in details) request on freebsd-geom list - how to detect what GEOM class is set up in an arbitrary provider. That is similar to this thread because both are discussing information that is available on-disk and usable by core system utilities (mount and installer) - so maybe a new library is in order, which will enable users to detect what is on a particular device/parition/provider/etc from on the device. In case of GEOM classes, metadata is written on the last sector, and first few fields ("signature fields") are in common format for all classes, so it's easy to get what class "owns" the device without going into the details of its metadata. Something like: struct devcontentinfo* get_provider_info(char *device_name); where returned value will be an array of found "contents", with a "type" member (enum) describing what it is (GEOM class / file system / swap), a "name" member which holds the ASCII name of the found thing ("UFS", "GEOM_MIRROR"), and an additional "extended_name" which would contain details ("UFSv2", "GEOM_MIRRORv4"). For these examples instead of "extended_name" maybe a version field will be enough ("v4" for GEOM_MIRROR stands for fourth metadata layout version).