vnconfig and a compact flash disk image

Richard P. Williamson richard.williamson at u4eatech.com
Fri Aug 20 07:32:33 PDT 2004


At 14:49 20/08/2004. Warren Block had this to say:
>On Fri, 20 Aug 2004, Richard P. Williamson wrote:
>
>>But how can I mount it?  The format is a 28Mb slice (a) and a 4Mb
>>slice (e).  I've tried
>>vnconfig vn0 sanDisk.32Mb.image
>>and
>>vnconfig vn0a sanDisk.32Mb.image
>>but fdisk tells me 'invalid superblock' when pointed at /dev/vn0[a].
>
>See the example of how to mount an ISO CD image in the examples section of the vnconfig man page; it should be the same, except the filesystem type will be msdos.
>
>How to deal with the two partitions, I'm not sure.  If you do the math just right, you should be able to dd each to a different file.

msdos?  Ok, that confuses me.  The flash card isn't msdos
compatible (or shouldn't be). According to fdisk, it is 165,
which is the way it was created:

venus# vnconfig vn0 san32.img
venus# fdisk /dev/vn0
fdisk: can't get disk parameters on /dev/vn0; supplying dummy ones
******* Working on device /dev/vn0 *******
parameters extracted from in-core disklabel are:
cylinders=1 heads=1 sectors/track=1 (1 blks/cyl)

parameters to be used for BIOS calculations are:
cylinders=1 heads=1 sectors/track=1 (1 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165,(FreeBSD/NetBSD/386BSD)
    start 32, size 62688 (30 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 489/ head 3/ sector 32
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
venus#

The output is the same regardless if it is an image created by
dd'ing /dev/ad8 or /dev/rad8 (which is how I'm getting the 
"san32.img" off the flash card in the first place).

The 'can't get disk parameters' worries me.  Does 
dd if=/dev/rad8 of=san32.img 
not do what I think?  

If I fsck -b 16 /dev/rvn0, I get something that is almost sane:

venus# fsck -b 16 /dev/rvn0a
Alternate super block location: 16
** /dev/rvn0a
** Last Mounted on /flashb             <-- that is correct!
** Phase 1 - Check Blocks and Sizes
1179403647 BAD I=10
UNEXPECTED SOFT UPDATE INCONSISTENCY

151060737 BAD I=10
etc, ad nauseum.

I'm hoping I won't need to disassemble the file, because it is possible
that we'll be moving to a different flash card, size or manufacturer
at some point in the future (like when you can't buy 32Mb flash cards,
any more, hrmph).  I'd really like to have a way to mount both
slices without having to 'do the math' more than once for each card 
type, rather than for each card image.  And if I do need to disassemble
the card image, how to put it back together again?  Tricksy.

Thanks for your answer,
rip






More information about the freebsd-questions mailing list