Subject: Re: kern/37000: Solaris ufs filesystems not supported
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Antti Kantee <pooka@cs.hut.fi>
List: netbsd-bugs
Date: 09/24/2007 18:20:03
The following reply was made to PR kern/37000; it has been noted by GNATS.

From: Antti Kantee <pooka@cs.hut.fi>
To: gnats-bugs@NetBSD.org
Cc: martin@duskware.de
Subject: Re: kern/37000: Solaris ufs filesystems not supported
Date: Mon, 24 Sep 2007 21:15:24 +0300

 On Mon Sep 17 2007 at 20:20:03 +0000, martin@duskware.de wrote:
 > Creating a small ufs filesystem with default parameters on Solaris 10
 > or OpenSolaris creates a ufs variant that is not well supported by NetBSD.
 > The ufs code in libsa is not able to read the / directory (so can't boot 
 > kernels from this filesystem), and trying to access the filesystem from
 > a running system results in a panic
 > 
 > # mount -r /dev/sd1a /mnt
 > # ls /mnt
 > panic: buf mem pool index 55
 
 This is because the Solaris superblock format is kind enough to have a
 few fields in different places.  You can mount and use your file system
 image with this change:
 
 Index: fs.h
 ===================================================================
 RCS file: /cvsroot/src/sys/ufs/ffs/fs.h,v
 retrieving revision 1.47
 diff -p -u -r1.47 fs.h
 --- fs.h	24 Sep 2007 16:20:50 -0000	1.47
 +++ fs.h	24 Sep 2007 18:13:45 -0000
 @@ -348,9 +348,9 @@ struct fs {
  	int32_t	 fs_maxsymlinklen;	/* max length of an internal symlink */
  	int32_t	 fs_old_inodefmt;	/* format of on-disk inodes */
  	u_int64_t fs_maxfilesize;	/* maximum representable file size */
 +	int32_t	 fs_state;		/* validate fs_clean field (UNUSED) */
  	int64_t	 fs_qbmask;		/* ~fs_bmask for use with 64-bit size */
  	int64_t	 fs_qfmask;		/* ~fs_fmask for use with 64-bit size */
 -	int32_t	 fs_state;		/* validate fs_clean field (UNUSED) */
  	int32_t	 fs_old_postblformat;	/* format of positional layout tables */
  	int32_t	 fs_old_nrpos;		/* number of rotational positions */
  	int32_t  fs_spare5[2];		/* old fs_postbloff */
 
 For as how to detect and fix this, I don't know.
 
 -- 
 Antti Kantee <pooka@iki.fi>                     Of course he runs NetBSD
 http://www.iki.fi/pooka/                          http://www.NetBSD.org/
     "la qualité la plus indispensable du cuisinier est l'exactitude"