Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Nov 2009 18:23:45 -0600
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Pete French <petefrench@ticketswitch.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: how to get the UFSID of a mounted filesystem ?
Message-ID:  <20091130002344.GL89004@dan.emsphone.com>
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
In the last episode (Nov 30), Pete French said:
> 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...

Easiest way is to run dumpfs on the device you currently have mounted.  The
fsid will be on the 2nd line of the output:

(root@studio) /root># dumpfs /dev/da2s1a | head -2
magic   19540119 (UFS2) time    Sun Nov 29 18:19:39 2009
superblock location     65536   id      [ 49b21fba 667e8575 ]

Next easiest is to run "mount -v" as root, which will give you the fsid, but
byte-swapped so you have to mess with it to get a value that matches what
glabel expects:

/dev/ufsid/49b21fba667e8575 on /tmp/z (ufs, local, soft-updates, fsid ba1fb24975857e66)

-- 
	Dan Nelson
	dnelson@allantgroup.com



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