Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Jul 2006 19:37:08 +0200
From:      Ivan Voras <ivoras@fer.hr>
To:        freebsd-current@freebsd.org
Cc:        freebsd-arch@freebsd.org
Subject:   Re: [RFC] mount can figure out fstype automatically
Message-ID:  <e8oqh4$c7d$1@sea.gmane.org>
In-Reply-To: <20060708161719.GB3871@crodrigues.org>
References:  <20060708152801.GA3671@crodrigues.org> <44AFD7DF.8090002@errno.com> <20060708161719.GB3871@crodrigues.org>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?e8oqh4$c7d$1>