Subject: Re: newfs/vnd problems -- cg 0: bad magic number
To: None <port-sgimips@netbsd.org>
From: sgimips NetBSD list <sgimips@mrynet.com>
List: port-sgimips
Date: 03/19/2002 09:12:59
All,

Previously, I had reported problems using the vnd device for generating
a filesystem image on disk.  I had determined that it was only an issue
when operating on a filesystem image file over NFS.

As of the 1.5ZB kernel, this problem has gone away.

Thanks to all who, directly or indirectly, resolved this issue :)

-scott

On Wed, 6 Feb 2002 23:13:34 -0600, I had written:
> Since I last build a miniroot for sgimips, last December,
> I am now having the following problem:
> 
> mod80 (355)# newfs /dev/rvnd0a
> /dev/rvnd0a:    163840 sectors in 5120 cylinders of 1 tracks, 32 sectors
>         80.0MB in 6 cyl groups (917 c/g, 14.33MB/g, 3328 i/g)
> super-block backups (for fsck -b #) at:
>      32,  29376,  58720,  88064, 117408, 146752,
> cg 0: bad magic number
> 
> I can't determine if this is a vnd problem or a newfs issue.
> I can mount a disk image previously (December) build and it fsck's fine.
> 
> Anyone recognise a problem I'm overlooking?
> 
> A synopsis of how I'm building the image follows.
> 
> -scott
> 
> Kernel version:
> NetBSD mod80 1.5ZA NetBSD 1.5ZA (MRYINDY2) #1: Mon Jan 28 18:57:42 CST 2002     root@mod80:/sgimips/src/sys/arch/sgimips/compile/MRYINDY2 sgimips
> 
> disktab contains:
> vnd|test vnd image:\
>         :dt=vnd:se#512:ns#32:nt#1:sc#32:nc#5120:\
>         :pa#163840:oa#0:ta=4.2BSD:ba#0:fa#0:\
>         :pb#163840:ob#0:tb=4.2BSD:bb#0:fb#0:\
>         :pc#163840:oc#0:tc=4.2BSD:bc#0:fc#0:
> 
> mod80 (343)# dd if=/dev/zero count=163840 of=testroot2.fs
> mod80 (344)# vnconfig -t vnd vnd0 testroot2.fs
> mod80 (345)# disklabel -w vnd0 vnd
> mod80 (346)# disklabel vnd0
> # /dev/rvnd0c:
> type: vnd
> disk: vnd
> label: 
> flags:
> bytes/sector: 512
> sectors/track: 32
> tracks/cylinder: 1
> sectors/cylinder: 32
> cylinders: 5120
> total sectors: 163840
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0           # microseconds
> track-to-track seek: 0  # microseconds
> drivedata: 0 
> 
> 3 partitions:
> #        size    offset     fstype  [fsize bsize cpg/sgs]
>  a:    163840         0     4.2BSD      0     0     0   # (Cyl.    0 - 5119)
>  b:    163840         0     4.2BSD      0     0     0   # (Cyl.    0 - 5119)
>  c:    163840         0     4.2BSD      0     0     0   # (Cyl.    0 - 5119)
> mod80 (347)# newfs /dev/rvnd0a
> /dev/rvnd0a:    163840 sectors in 5120 cylinders of 1 tracks, 32 sectors
>         80.0MB in 6 cyl groups (917 c/g, 14.33MB/g, 3328 i/g)
> super-block backups (for fsck -b #) at:
>      32,  29376,  58720,  88064, 117408, 146752,
> cg 0: bad magic number
> mod80 (348)# fsck_ffs /dev/rvnd0a
> ** /dev/rvnd0a
> BAD SUPER BLOCK: MAGIC NUMBER WRONG
> 
> LOOK FOR ALTERNATE SUPERBLOCKS? [yn] n
> 
>