两个用途,即格式化硬盘和重新对硬盘分区.
1)格式化硬盘
最好进入单用户模式
#format
系统会显示所有的硬盘并让我们选择要操作硬盘
Searchingfordisks...done
AVAILABLEDISKSELECTIONS:
0.c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1.c0t1d0
/pci@1f,4000/scsi@3/sd@1,0
2.c0t2d0
/pci@1f,4000/scsi@3/sd@2,0
3.c0t3d0
/pci@1f,4000/scsi@3/sd@3,0
Specifydisk(enteritsnumber):2
selectingc0t2d0
[diskformatted]
Warning:CurrentDiskhasmountedpartitions.
FORMATMENU:
disk-selectadisk
type-select(define)adisktype
partition-select(define)apartitiontable
current-describethecurrentdisk
format-formatandanalyzethedisk
repair-repairadefectivesector
label-writelabeltothedisk
analyze-surfaceanalysis
defect-defectlistmanagement
backup-searchforbackuplabels
verify-readanddisplaylabels
save-savenewdisk/partitiondefinitions
inquiry-showvendor,productandrevision
volname-set8-charactervolumename
!
quit
format%26gt;partition
PARTITIONMENU:
0-change`0'partition
1-change`1'partition
2-change`2'partition
3-change`3'partition
4-change`4'partition
5-change`5'partition
6-change`6'partition
7-change`7'partition
select-selectapredefinedtable
modify-modifyapredefinedpartitiontable
name-namethecurrenttable
print-displaythecurrenttable
label-writepartitionmapandlabeltothedisk
!
quit
partition%26gt;modify
partition%26gt;label
partition%26gt;quit
format%26gt;save
使用命令newfs来为每一个分区创建文件系统:
newfs/dev/rdsk/c?t?d?s?
硬盘包含启动分区(根分区),我们需要手动安装启动模块
#rebootcdrom-s(从光盘启动,并进入单用户模式)
#mount/dev/dsk/c0t1d0s0/mnt (将系统根分区挂接到mnt目录下)
#cp/ufsboot/mnt
#installboot/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0(安装启动模块)
#umount/mnt(卸下挂接)
#reboot(重启动)
2)重新分区
format命令也可以对硬盘进行重新分区。重新分区后,受影响分区上的所有文件将被清除
要对该分区表命名,SAVE退出format命令。分区结束后,我们要用newfs命令为改变的分区创建文件系统
