I've been examining the new memstick install image for 9.0 and noticed that its partition and filesystem layout has changed from the 8.2 image.
With 8.2, the memstick image contained a dedicated bsdlabel, with a single 'a' partition defined. The 'a' partition had the usual offset of 16 blocks to leave space for the boot code.
Here's how file(1) identifies it:
and here's what bsdlabel(8) makes of it:
I have successfully utilised that same layout when creating my own bootable FreeBSD sticks.
With the 9.0 memstick image file(1) and bsdlabel(8) see it as follows:
So it appears that either:
a) There is a dedicated bsdlabel with a single 'a' partition, but it starts from block 0.
or
b) The image is just of a pure UFS filesystem with no partitioning.
This is borne out by my being able to mount the image as either /dev/md0a or as /dev/md0 and being able to see the same files. Either way, the filesystem seems to begin at block 0 of the image file, and thus would also begin at block 0 of any device it is dd'd to.
My question is, if the filesystem starts at block 0, where is the bootcode kept? How might I go about creating my own bootable images with the same layout?
With 8.2, the memstick image contained a dedicated bsdlabel, with a single 'a' partition defined. The 'a' partition had the usual offset of 16 blocks to leave space for the boot code.
Here's how file(1) identifies it:
Code:
FreeBSD-8.2-RELEASE-amd64-memstick.img: x86 boot sector;
partition 4: ID=0xa5, active, starthead 0, startsector 0,
50000 sectors, code offset 0x3c, BSD disklabel
Code:
# FreeBSD-8.2-RELEASE-amd64-memstick.img:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 2124544 16 unused 0 0
c: 2124560 0 unused 0 0 # "raw" part, don't edit
With the 9.0 memstick image file(1) and bsdlabel(8) see it as follows:
Code:
FreeBSD-9.0-RELEASE-amd64-memstick.img:
Unix Fast File system [v1] (little-endian),
last mounted on , last written at Tue Jan 3 08:57:34 2012,
clean flag 1, number of blocks 669632, number of data blocks 667639,
number of cylinder groups 13, block size 8192, fragment size 1024,
minimum percentage of free blocks 8, rotational delay 0ms,
disk rotational speed 60rps, TIME optimization
Code:
# FreeBSD-9.0-RELEASE-amd64-memstick.img:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 1339264 0 4.2BSD 0 0 0
c: 1339264 0 unused 0 0 # "raw" part, don't edit
So it appears that either:
a) There is a dedicated bsdlabel with a single 'a' partition, but it starts from block 0.
or
b) The image is just of a pure UFS filesystem with no partitioning.
This is borne out by my being able to mount the image as either /dev/md0a or as /dev/md0 and being able to see the same files. Either way, the filesystem seems to begin at block 0 of the image file, and thus would also begin at block 0 of any device it is dd'd to.
My question is, if the filesystem starts at block 0, where is the bootcode kept? How might I go about creating my own bootable images with the same layout?