Solaris硬盘分区学习笔记

Solaris硬盘分区学习笔记

参考文章《隆重推荐:Solaris硬盘分区简介》,地址:http://chinaunix.net/jh/6/538888.html

好久没来了,最近单位的事很多,剩下的大部分时间都在看SA119,也没什么东西要写上来,今天看了这篇文章,就写些心得上来。

整个系统的硬盘信息能够用format命令查看,但必须在root权限下。例如:

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t8d0
/pci@1f,4000/scsi@3/sd@8,0
1. c0t10d0
/pci@1f,4000/scsi@3/sd@a,0
2. c0t12d0
/pci@1f,4000/scsi@3/sd@c,0
Specify disk (enter its number): 1
selecting c0t10d0
[disk formatted]
Warning: Current Disk has mounted partitions.


FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
format> p


PARTITION MENU:
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 - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
! - execute , then return
quit
从中能够看出笔者有三块硬盘,其中/pci@1f,4000/scsi@3/sd@8,0: /pci@1f,4000/scsi@3/sd@a,0:/pci@1f,4000/scsi@3/sd@c,0就是三块是硬盘的物理地址。

一块硬盘要使用,一般要经过低格,分区,格式化三个步骤,而用户一般只需要后面两个步骤,第一个步骤硬盘在出厂前,厂家就已做好了。经过分区后,一个硬盘上就会有一个或多个分区(在solaris下,一块硬盘有8个分区,由 0至7),每个分区由若干个柱面构成。solaris中一个分区对应一个文档系统,他们之间是一一对应的(即一个分区只能包含一个文档系统,而一个文档系统也不能跨分区存在)。分区用format命令能够实现。

当格式化后,将分区内的柱面分成柱面组,每个柱面组包含几个连续的柱面。solaris中用newfs来实现高级格式化,默认的是unix文档系统(ufs,unix file system),他使用一下四种类型的块:引导块,终极块,索引节点(I节点),文档块/数据块。

磁盘的命名

solaris中用设备名指代磁盘,磁盘的设备名是以cNtNdN为格式的字母和数字的组合(N代表数字),其中cN代表逻辑控制器号(控制接口),tN代表物理总线目标号(目标地址,scsi设备将给予scsi-ID),dN代表磁盘或逻辑单元号(设备地址或卷的raid地址,一个地址多个盘)。至于逻辑设备名称格式则是如:cNtNdNsN,sN代表分区号(片地址,也就是说分区地址),其他同上。

任何的设备地址都将作为链接文档存于/dev/dsk和/dev/rdsk这两个目录下,这些链接点将直接链接到物理设备名