Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2008 10:10:59 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        freebsd-fs@freebsd.org
Cc:        Ivan Voras <ivoras@freebsd.org>
Subject:   Re: Unique ID for UFS?
Message-ID:  <200811261011.06490.doconnor@gsoft.com.au>
In-Reply-To: <gg3e2g$5ct$1@ger.gmane.org>
References:  <200811201215.42008.doconnor@gsoft.com.au> <gg3e2g$5ct$1@ger.gmane.org>

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



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