fmthard should give an option to format a default slice like fdisk does
State
1-Dispatched (Default State)
Category:Subcategory
utility:diskformat
Keywords
opensolaris
Reported Against
snv_101
Duplicate Of
Introduced In
Commit to Fix
Fixed In
Release Fixed
Related Bugs
Submit Date
13-April-2009
Last Update Date
12-June-2009
Description
Category
utility
Sub-Category
raidcfg
Description
Note: Category should be utility:fdisk (Opensolaris submit bug/rfe once you select category:utlity defaults subcategory to raidcfg and does not provide other options)
-----------
Currently in OpenSolaris
fdisk gives a -B option
-B
Default to one Solaris partition that uses the whole
disk. On an x86 machine, if the disk is larger than 2 TB
(terabytes), the default size of the Solaris partition
will be limited to 2 TB.
fmthard - Command line utility to do Solaris format should also give similar option so that it is easier to use for users (and scripts) without trying to figure out the geometry of the disk manually as people have to do now in scripts:
What is helpful is to initialize a disk as follows on x64:
fdisk -n -B /dev/rdsk/${INSTALLDISK}p0
fmthard -B /dev/rdsk/${INSTALLDISK}p0
What we have to do now:
fdisk -n -B /dev/rdsk/${INSTALLDISK}p0
SecCnt=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '/sectors\/cylinder/ { print $2 }'`
LastSect=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '$1 == "2" { print $5 }'`
LastSect=`expr $LastSect - $SecCnt`
fmthard -d 0:2:00:${SecCnt}:${LastSect} /dev/rdsk/${INSTALLDISK}p0
Frequency
Always
Regression
No
Steps to Reproduce
http://blogs.sun.com/jkshah/resource/create_solaris_appliance.sh
Expected Result
Expected to use something like:
fdisk -n -B /dev/rdsk/${INSTALLDISK}p0
fmthard -B /dev/rdsk/${INSTALLDISK}p0
Actual Result
Have to use:
fdisk -n -B /dev/rdsk/${INSTALLDISK}p0
SecCnt=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '/sectors\/cylinder/ { print $2 }'`
LastSect=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '$1 == "2" { print $5 }'`
LastSect=`expr $LastSect - $SecCnt`
fmthard -d 0:2:00:${SecCnt}:${LastSect} /dev/rdsk/${INSTALLDISK}p0
Error Message(s)
Test Case
Workaround
fdisk -n -B /dev/rdsk/${INSTALLDISK}p0
SecCnt=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '/sectors\/cylinder/ { print $2 }'`
LastSect=`prtvtoc /dev/rdsk/${INSTALLDISK}p0 | awk '$1 == "2" { print $5 }'`
LastSect=`expr $LastSect - $SecCnt`
fmthard -d 0:2:00:${SecCnt}:${LastSect} /dev/rdsk/${INSTALLDISK}p0
Additional configuration information
Reference:
With more and more people using OpenSolaris as a base of an appliance it becomes lot easier with this RFE to prepare a disk to install custom images for appliances:
http://blogs.sun.com/jkshah/entry/minimal_opensolaris_image_for_virtualbox#comments