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... -pete.
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
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=`dumpfs 2> /dev/null $1 | head | grep superblock\ location` eval `echo $line | sed -nEe 's/superblock location.*id.*\[ (.*) (.*)\ ]/printf %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. -- 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 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 188 bytes Desc: This is a digitally signed message part. Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20091130/0f84e2cf/attachment.pgp
Perhaps dumpfs? Pete French <petefrench@ticketswitch.com> 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... > >-pete. > >_______________________________________________ >freebsd-stable@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-stable >To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"