Subject: Mounting an (FFS) image put on CD-ROM
To: None <netbsd-help@NetBSD.org>
From: Masao Uebayashi <uebayasi@gmail.com>
List: netbsd-help
Date: 02/15/2007 01:07:18
Hi.

I'm trying to mount an (FFS) image put on CD-ROM via vnd(4).  And it
doesn't work for me.  Doing disklabel against vnd says:

	$ priv disklabel vnd0
	# /dev/rvnd0d:
	type: vnd
	disk: vnd
	label: default label
	flags:
	bytes/sector: 512
	sectors/track: 32
	tracks/cylinder: 64
	sectors/cylinder: 2048
	cylinders: 256
	total sectors: 524288
	rpm: 3600
	interleave: 1
	trackskew: 0
	cylinderskew: 0
	headswitch: 0           # microseconds
	track-to-track seek: 0  # microseconds
	drivedata: 0

	16 partitions:
	#        size    offset     fstype [fsize bsize cpg/sgs]
	 a:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 b:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 c:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 d:    524288         0     unused      0     0        # (Cyl.      0 -    255)
	 e:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 f:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 g:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 h:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 i:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 j:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 k:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 l:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 m:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 n:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 o:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 p:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	disklabel: boot block size 0
	disklabel: super block size 0
	disklabel: partitions a and b overlap 
	disklabel: partitions a and c overlap
	disklabel: partitions a and e overlap
	disklabel: partitions a and f overlap
	disklabel: partitions a and g overlap
	disklabel: partitions a and h overlap
	disklabel: partitions a and i overlap
	disklabel: partitions a and j overlap
	disklabel: partitions a and k overlap
	disklabel: partitions a and l overlap
	disklabel: partitions a and m overlap
	disklabel: partitions a and n overlap
	disklabel: partitions a and o overlap
	disklabel: partitions a and p overlap
	disklabel: partitions b and c overlap
	(... snip similar lines ...)

Accessing on-disk label shows correct label.  Doing disklabel against
the image mounted cd9660 filesystem is OK too.

	$ priv disklabel -r vnd0
	# /dev/rvnd0d:
	type: vnd
	disk: vnd
	label: fictitious
	flags:
	bytes/sector: 512
	sectors/track: 32
	tracks/cylinder: 64
	sectors/cylinder: 2048
	cylinders: 256
	total sectors: 524288
	rpm: 3600
	interleave: 1
	trackskew: 0
	cylinderskew: 0
	headswitch: 0           # microseconds
	track-to-track seek: 0  # microseconds
	drivedata: 04 partitions:
	#        size    offset     fstype [fsize bsize cpg/sgs]
	 a:    524288         0     4.2BSD      0     0     0  # (Cyl.      0 -    255)
	 d:    524288         0     unused      0     0        # (Cyl.      0 -    255)

If I copy the image onto a r/w filesystem, it just works.

Masao