newfs for UFS2 problems

From: Alex Popa <razor_at_ldc.ro>
Date: Sat, 26 Apr 2003 18:37:04 +0300
After an installation of 5.0-RELEASE, I have cvsupped to -current and
remade the /var filesystem with newfs.

After that, I tried to mount the filesystem on the 4.8 system I also
have installed.  It mounted fine (read-only), which should not have
happened.  Of course, I got a panic the moment I tried "ls" in /mnt.
Also, dumpfs from -stable got a segmentation fault when trying to view
that filesystem.

It seems the problem is partly caused by newfs on -current, which does
not remove the old UFS1 magic when creating an UFS2 superblock at a
different location.  This leftover magic is seen by the -stable kernel
and therefore used.

I don't have enough experience in programming for FreeBSD, but I think
sbread() from libufs could be used to recognize an old (UFS1) filesystem
and then wipe the old magic before creating an UFS2 filesystem.

If anyone is willing to help (give me some pointers or suggesions to
what else I should pay attention to), I can try and create a patch.

Alex


PS: The problem does not appear with the -current dumpfs because libufs
in -current seems to check for the UFS2 magic first.

PPS: If anyone needs them, I still have the vmcore and debug kernel from
a crash of -stable, plus several different backtraces, but since the
filesystem is severely corrupted (and incorrectly marked as "clean"), I
don't think they are relevant.

------------+-------------------------------------------------------
Alex Popa,  |  "Computer science is no more about computers than
razor_at_ldc.ro|     astronomy is about telescopes" -- E. W. Dijkstra
------------+------------------------------------------------------
Received on Sat Apr 26 2003 - 06:37:08 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:05 UTC