Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Nov 2009 11:01:03 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        freebsd-stable@freebsd.org
Cc:        Pete French <petefrench@ticketswitch.com>
Subject:   Re: how to get the UFSID of a mounted filesystem ?
Message-ID:  <200911301101.05002.doconnor@gsoft.com.au>
In-Reply-To: <E1NEtq7-000Miv-AC@dilbert.ticketswitch.com>
References:  <E1NEtq7-000Miv-AC@dilbert.ticketswitch.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1995073.iMKMxeipkr
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Mon, 30 Nov 2009, Pete French wrote:
> I observer that when I mount a UFS filesystem using the device
> name then the entry vanishes from /dev/ufsid, and glabel list no
> longer shows the device. Which begs the question, how do I find
> out the ufsid of a mountde filesystem (e.g. '/' so that I can change
> it's fstab entry for the next reboot?)
>
> Am slightly embarassed to have to ask for help! Am sure this was
> easy and in dmesg last time I did this...

You can run dumpfs, eg
line=3D`dumpfs 2> /dev/null $1 | head | grep superblock\ location`
eval `echo $line | sed -nEe 's/superblock location.*id.*\[ (.*) (.*)\ ]/pri=
ntf %0x $((0x\1 << 32 | 0x\2))/p'`

I use this in a script to determine the ID so I can modify fstab after the
install has finished.

=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

--nextPart1995073.iMKMxeipkr
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (FreeBSD)

iD8DBQBLExJI5ZPcIHs/zowRAueSAJ4phAyi3jU5wlJxOoeZEcA4HdqLPQCfeOx0
lvrCCSPz+Zyt/oBmGSYJLLg=
=r7pl
-----END PGP SIGNATURE-----

--nextPart1995073.iMKMxeipkr--



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