From owner-freebsd-fs@FreeBSD.ORG Tue Nov 25 23:41:09 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91A761065673 for ; Tue, 25 Nov 2008 23:41:09 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id DB2A78FC21 for ; Tue, 25 Nov 2008 23:41:08 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.dons.net.au (ppp121-45-153-176.lns11.adl6.internode.on.net [121.45.153.176]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id mAPNf5o6030028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Nov 2008 10:11:06 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-fs@freebsd.org Date: Wed, 26 Nov 2008 10:10:59 +1030 User-Agent: KMail/1.9.10 References: <200811201215.42008.doconnor@gsoft.com.au> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1316375.vuUZkuKo8q"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200811261011.06490.doconnor@gsoft.com.au> X-Spam-Score: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: Ivan Voras Subject: Re: Unique ID for UFS? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Nov 2008 23:41:09 -0000 --nextPart1316375.vuUZkuKo8q Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 20 November 2008 20:58:25 Ivan Voras wrote: > Daniel O'Connor wrote: > > Hi, > > I am wondering if there is a unique ID generated for each UFS already? = If > > not would it be possible to add one somehow? > > > > There is glabel, but I think having a UUID embedded in the FS would be > > very handy for automation andwould prevent accidents that glabel can > > cause. > > > > So, there could be a gfsid module that reads IDs from the FS (NTFS, > > ext2/3, UFS) and creates device nodes to allow access. > > Looking at the output of dumpfs, there is an 64-bit numeric "id" field > that changes from file system to file system so this might it: > > magic 19540119 (UFS2) time Sat Nov 15 04:16:42 2008 > superblock location 65536 id [ 46ea67b4 178d71a1 ] > > (but judging from how the value changes on my file systems it might be > related to the timestamp). Yeah, on my system I have.. / 45c14592 caf91460 /var 45c1459d 2461df81 /usr 45c14596 fc5b2e49 Ah I think I found it in newfs.. /usr/src/sbin/newfs/mkfs.c lines 407 & 408.. sblock.fs_id[0] =3D (long)utime; sblock.fs_id[1] =3D newfs_random(); > If this is a usable ID, it should be trivial to make glabel create IDs > nodes (i.e. /dev/ufs/46ea67b4178d71a1). Yes indeed. I guess there's no excuse for me not to write such a thing now ;) PS you didn't cc me :) =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart1316375.vuUZkuKo8q Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBJLI0S5ZPcIHs/zowRAsffAJ4r0AqaU/tunB//5ypqQWBYafio5wCgogpa madgys8T5esSKGq+EzZyBZQ= =4i4V -----END PGP SIGNATURE----- --nextPart1316375.vuUZkuKo8q--