My first bug fix is almost complete, it involves a simple off by one if-statement predicate. The bug description can be found at http://bugs.opensolaris.org/view_bug.do?bug_id=6788327
My goal is to share some of the lessons learned, and do an "after bug review".
The hardware and software used:
-OpenSolaris 2008.11 x86
-Dell Vostro 1510 Laptop
-Swissbit 128MB memory stick
uname -a results:
"SunOS osolaris 5.11 snv_101b i86pc i386 i86pc Solaris"
Good references and notes:
"System Administration Guide: Devices and File Systems" at http://docs.sun.com/app/docs/doc/819-2723?l=en
Notice that these are Solaris Express docs, and seem to be the most up to date docs I could find.
Key definitions:
-Disk Label: "The first sector of a disk that contains disk geometry and partition information. A special area of every disk is set aside for storing information about the disk's controller, geometry, and slices. This information is called the disk's label. Another term that is used to described the disk label is the VTOC (Volume Table of Contents) on a disk with a VTOC label. To label a disk means to write slice information onto the disk. You usually label a disk after you change its slices. "( pg. 191 )
When reading docs, be aware of when you are dealing with the master boot record ( MBR ) format ( think dos compatible, thus wide OS support ) vs the VTOC ( think Sun ) label format. In my experience tools work differently with the two formats, for example prtvtoc only works with the VTOC format, fdisk does not show slice information ( slices exists in VTOC only ).
Be aware of "labels", which are human readable names given to a disk/partition ( you will see this in tools such as GParted ). You will have to discern the meaning of "label" from the context in which you are working in.
-Disk Slices: "Files stored on a disk are contained in file systems. Each file system on a disk is assigned to a slice, which is a group of sectors set aside for use by that file system. Each disk slice appears to the Solaris OS (and to the system administrator) as though it were a separate disk drive. For information about file systems, see Chapter 17, “Managing File Systems (Overview).” Note – Slices are sometimes referred to as partitions. Certain interfaces, such as the format utility, refer to slices as partitions." ( pg. 196 )
In my experience the terms slice and partition are used loosely adding to the confusion.
Notes on using x86 OpenSolaris 2008.11 to format a memory stick for use on x86 OpenSolaris, Linux, and Windows:
Note: if you need cross os support, then you must use the MBR
disk label format. Creating a fat32 partition and using PCFS will do this for you.
steps:
a) use fdisk to create a fat32 partition
b) use mkfs to create PCFS file system
The exact step-by-step instructions start on page 151 of "Devices and file systems" at http://docs.sun.com/app/docs/doc/819-2723?l=en. There is a one liner on page 150 which assumes that a fat partition was already made.
There are also directions at http://www.sun.com/io_technologies/usb/USB-Faq.html#Storage , which did not work for me.
Try prtvtoc command on the fat formatted memory stick and notice that it fails.
Notes on using x86 OpenSolaris 2008.11 to format a memory stick for use on x86 OpenSolaris ( using VTOC disk label format ):
steps:
a) use fdisk to create a Solaris partition.
b) create a text file with slice information and feed it to "rmformat -s".
The exact step-by-step instructions start on page 154 of "Devices and file systems" at http://docs.sun.com/app/docs/doc/819-2723?l=en
blogs.sun.com/PotstickerGuru/entry/giving_usb_the_boot_install contains an example as well.
Try prtvtoc command on the formatted memory stick and notice that the output is now correct.
Try fdisk on the formatted memory stick, and notice that fdisk has no idea about disk slices.
Key Takeaways:
When dealing with partition/formatting documentation and tools, in Solaris, you should be keenly aware of:
-the disk label type in question ( VTOC, MBR, GUID Partition Table ).
-which
disk labels a command supports, and how. For example prtvtoc only
works with VTOC. Fdisk works with VTOC, and MBR, but is unaware of
slices introduced by VTOC. This gets confusing very
quickly.
-your platform, Sparc, x86, etc.. often commands are different for the two platforms.
-different media requires different commands for formatting. For example, you never user rmformat to format a memory stick.
-there is a lot documentation concerning hard
drives, and diskettes, which is helpful but not necessarily applicable
to memory sticks.