<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Rickard Dahlstrand wrote:
<blockquote cite="mid455030D9.7080805@tilde.se" type="cite">
  <pre wrap="">Jacob Winther wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">One other thought, my flash it 500Mb, and the contents of it is only
10Mb, is there any way of making a smaller image that still looks like
a full image once installed. I guess my thoughts was that if the mbr,
disklabel and filesystem only write stuff to the beginning of the
disk, can you just write the first 10Mb of the disk and still have it
ready to be fully utilised, basically it would drop the time to write
the image down drastically.
    </pre>
  </blockquote>
  <pre wrap=""><!---->The thought has crossed my mind. However I know to little about these
things to take any shortcuts, I have no idea how vnconfig will like a
truncated image. An alternative is as you state above to use gzip as
this is quite effective in compressing the zeros in the end.

I'm coping the list if there is anyone else has thoughts on this subject.
  </pre>
</blockquote>
I have done some more research and here is my conclusion. Fell free to
comment.<br>
<br>
When we use the build-diskimage-script we are telling disklabel, fdisk
and all the other tools that the disk we are writing to are for example
128 MB, it will then allocate and create a partition with that size. <br>
<br>
When we later write that image to a flash we are writing the
partition-info as well. This means that if we write a 128 MB image to a
256 MB flash this will give us a 128 MB disk with 128 MB unused. In
other words you can only use the 128 MB of the flash and the rest would
be unallocated.<br>
<br>
Below are some output from a 128 MB file written to a 256 MB flash. As
you can see obsd reports this as a 256 MB disk at boot and a 128 MB
partition in disklabel and fdisk.<br>
<br>
So if we where to make a default smaller partition in the script we
would have to resize it later in the process if the user wanted to use
more of the flash. (There are some info on a process like that here:
<a class="moz-txt-link-freetext" href="http://wiki.pfsense.com/wikka.php?wakka=FlashHowTo">http://wiki.pfsense.com/wikka.php?wakka=FlashHowTo</a> )<br>
<br>
Other than that I don't think there is a problem. I don't know how
sec/cyl differences will affect the disk, but from what I can see from
other sources this should be no problem.<br>
<br>
Rickard.<br>
<br>
<tt><br>
</tt><tt>------SNIP-------</tt><tt><br>
</tt><tt>wd0 at pciide0 channel 0 drive 1: &lt;SILICONSYSTEMS INC
256MB&gt;<br>
wd0: 1-sector PIO, LBA, 248MB, 508928 sectors<br>
------SNIP-------<br>
[root@probe22 root]# disklabel&nbsp; -r wd0<br>
# Inside MBR partition 3: type A6 start 32 size 250848<br>
# /dev/rwd0c:<br>
type: SCSI<br>
disk: vnd device<br>
label: fictitious<br>
flags:<br>
bytes/sector: 512<br>
sectors/track: 32<br>
tracks/cylinder: 8<br>
sectors/cylinder: 256<br>
cylinders: 980<br>
total sectors: 250880<br>
rpm: 3600<br>
interleave: 1<br>
trackskew: 0<br>
cylinderskew: 0<br>
headswitch: 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # microseconds<br>
track-to-track seek: 0&nbsp; # microseconds<br>
drivedata: 0 <br>
<br>
16 partitions:<br>
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; offset&nbsp; fstype [fsize bsize&nbsp; cpg]<br>
&nbsp; a:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 250848&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 32&nbsp; 4.2BSD&nbsp;&nbsp; 2048 16384&nbsp; 952 # Cyl&nbsp;&nbsp;&nbsp;&nbsp;
0*-&nbsp;&nbsp; 979 <br>
&nbsp; c:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 250880&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp; unused&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cyl&nbsp;&nbsp;&nbsp;&nbsp; 0
-&nbsp;&nbsp; 979 <br>
</tt><tt>[root@probe22 root]# fdisk wd0&nbsp;&nbsp;&nbsp; <br>
Disk: wd0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; geometry: 490/16/32 [250880 Sectors]<br>
Offset: 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Signature: 0xAA55<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Starting&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LBA Info:<br>
&nbsp;#: id&nbsp;&nbsp;&nbsp; C&nbsp;&nbsp; H&nbsp; S -&nbsp;&nbsp;&nbsp; C&nbsp;&nbsp; H&nbsp; S [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; start:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; size&nbsp;&nbsp; ]<br>
------------------------------------------------------------------------<br>
&nbsp;0: 00&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0&nbsp; 0 -&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0&nbsp; 0 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 ]
unused&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;1: 00&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0&nbsp; 0 -&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp; 0&nbsp; 0 [&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0:&nbsp;&nbsp;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nbsp;&nbsp;&nbsp;&nbsp; 35436&nbsp;&nbsp;&nbsp; 195480&nbsp;&nbsp;&nbsp; 15%&nbsp;&nbsp;&nbsp; /flash<br>
[root@probe22 root]# df -h<br>
Filesystem&nbsp;&nbsp;&nbsp;&nbsp; Size&nbsp;&nbsp;&nbsp; Used&nbsp;&nbsp; Avail Capacity&nbsp; Mounted on<br>
/dev/rd0a&nbsp;&nbsp;&nbsp;&nbsp; 14.4M&nbsp;&nbsp; 13.8M&nbsp;&nbsp;&nbsp; 525K&nbsp;&nbsp;&nbsp; 96%&nbsp;&nbsp;&nbsp; /<br>
mfs:26470&nbsp;&nbsp;&nbsp;&nbsp; 11.6M&nbsp;&nbsp;&nbsp; 9.4M&nbsp;&nbsp;&nbsp; 1.7M&nbsp;&nbsp;&nbsp; 85%&nbsp;&nbsp;&nbsp; /usr/local<br>
/dev/wd0a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 119M&nbsp;&nbsp; 17.3M&nbsp;&nbsp; 95.4M&nbsp;&nbsp;&nbsp; 15%&nbsp;&nbsp;&nbsp; /flash<br>
</tt><tt>------SNIP-------</tt><tt><br>
</tt>
</body>
</html>