dumpfs incorrectly displays ufsid

Trond Endrestøl Trond.Endrestol at fagskolen.gjovik.no
Tue May 26 11:09:59 UTC 2015


On Tue, 26 May 2015 12:31+0200, rank1seeker at gmail.com wrote:

> I've reported this at REL 8.2, long ago at May 2011
>     https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=156908
> 
> Now at 10.1-RELEASE-p10 #0 r282952   i386
> 
> This happens, ONLY when first chars are 0 (zeros) in second pair of 8
> chars, in which case dumpfs, ommits them.
> I.e; For:
>     /dev/ufsid/3b9aca0000000001
> 
> # dumpfs ada0s1h | head -2
> magic   19540119 (UFS2) time    Sun Sep  9 03:46:40 2001
> superblock location     65536   id      [ 3b9aca00 1 ]
> 
> Problem is in '[ 3b9aca00 1 ]'

If you apply this patch, then the case for UFS2 is treated similar to 
the case for UFS1:

Index: sbin/dumpfs/dumpfs.c
===================================================================
--- sbin/dumpfs/dumpfs.c	(revision 283516)
+++ sbin/dumpfs/dumpfs.c	(working copy)
@@ -165,7 +165,7 @@
 		fstime = afs.fs_time;
 		printf("magic\t%x (UFS2)\ttime\t%s",
 		    afs.fs_magic, ctime(&fstime));
-		printf("superblock location\t%jd\tid\t[ %x %x ]\n",
+		printf("superblock location\t%jd\tid\t[ %08x %08x ]\n",
 		    (intmax_t)afs.fs_sblockloc, afs.fs_id[0], afs.fs_id[1]);
 		printf("ncg\t%d\tsize\t%jd\tblocks\t%jd\n",
 		    afs.fs_ncg, (intmax_t)fssize, (intmax_t)afs.fs_dsize);

-- 
+-------------------------------+------------------------------------+
| Vennlig hilsen,               | Best regards,                      |
| Trond Endrestøl,              | Trond Endrestøl,                   |
| IT-ansvarlig,                 | System administrator,              |
| Fagskolen Innlandet,          | Gjøvik Technical College, Norway,  |
| tlf. mob.   952 62 567,       | Cellular...: +47 952 62 567,       |
| sentralbord 61 14 54 00.      | Switchboard: +47 61 14 54 00.      |
+-------------------------------+------------------------------------+


More information about the freebsd-hackers mailing list