Subject: Re: File system image
To: David Laight <david@l8s.co.uk>
From: Brian Rose <saider@gate.net>
List: tech-embed
Date: 02/07/2003 14:17:29
Wojciech Puchar wrote:

>I tried using virtual devices, but you cannot disklabel a virtual
>  
>

why? could you please say what was a problem?



David Laight wrote:

>>I tried using virtual devices, but you cannot disklabel a virtual 
>>device.
>>    
>>
>
>man vnd
>
>	David
>  
>
I was doing some googling on the subject, and I came across some 
articles that mentioned that the virtual device driver does not have the 
proper ioctl routines that disklabel uses. I don't know the details. 
After I read several of these I decided to try to find a workaround. I 
tried the following with no errors...

1) dd if=/dev/zero of=fs_16M.img bs=512 count=32768
2) vnconfig -c -v /dev/rvnd0 fs_16M.img
3) fdisk -i /dev/vnd0
4) disklabel -i -I /dev/vnd0
    created the following disklabel...

# /dev/vnd0d:
type: vnd
disk: vnd
label: default label
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 16
total sectors: 32768
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:     32768         0     4.2BSD      0     0     0   # (Cyl.    0 - 15)

5) create the filesystem with 'newfs /dev/vnd0a'
6) mount the filesystem 'mount -t ffs /dev/vnd0a /mnt/floppy'
7) copy the filesystem (same as on the working image)
8) unmount the filesystem 'umount /mnt/floppy'
9) unconfigure the virtual device - 'vnconfig -u /dev/vnd0'
10) copy the filesystem image into the kernel 'mdsetimage 
/home/ftp/netbsd.test /home/brose/embedded/fs_16M.img'
11) FTP the test image to my test machine, reboot and at the boot 
prompt, select netbsd.test as the kernel to boot.

The bootloader seems to load the kernel (I see the numbers) and then 
reboots immediately.

Any ideas?

Thanks,

Brian