Solaris 10 添加裸设备

1.添加磁盘
--添加完物理磁盘后在root用户下执行命令

1 #devfsadm  #对新加设备进行在线识别和加载

2.分区

  1 --显示磁盘的编号列表   2 # format

  3 Searching for disks...done

  4 

  5 

  6 AVAILABLE DISK SELECTIONS:

  7        0. c1t0d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63>

  8           /pci@0,0/pci15ad,1976@10/sd@0,0

  9        1. c2t0d0 <DEFAULT cyl 1020 alt 2 hd 128 sec 32>

 10           /pci@0,0/pci15ad,790@11/pci15ad,1976@2/sd@0,0

 11        2. c2t1d0 <DEFAULT cyl 1020 alt 2 hd 128 sec 32>

 12           /pci@0,0/pci15ad,790@11/pci15ad,1976@2/sd@1,0

 13        3. c2t2d0 <DEFAULT cyl 1021 alt 2 hd 128 sec 32>

 14           /pci@0,0/pci15ad,790@11/pci15ad,1976@2/sd@2,0

 15        4. c2t3d0 <DEFAULT cyl 1021 alt 2 hd 128 sec 32>

 16           /pci@0,0/pci15ad,790@11/pci15ad,1976@2/sd@3,0

 17           

 18              --0. c1t0d0 代表一块磁盘(至于c0t0d0的具体含义,稍后会介绍)

 19              --<DEFAULT cyl 1021 alt 2 hd 128 sec 32>  代表的是这个硬盘的大小和柱面信息

 20              --/pci@0,0/pci15ad,1976@10/sd@0,0         代表的是这个硬盘的实际物理地址

 21 

 22 --选择新添加磁盘  23 Specify disk (enter its number): 3 

 24 selecting c2t2d0

 25 [disk formatted]                   --说明c2t2d0磁盘已经被格式化

 26 

 27 

 28 FORMAT MENU:

 29         disk       - select a disk

 30         type       - select (define) a disk type

 31         partition  - select (define) a partition table

 32         current    - describe the current disk

 33         format     - format and analyze the disk

 34         fdisk      - run the fdisk program

 35         repair     - repair a defective sector

 36         label      - write label to the disk

 37         analyze    - surface analysis

 38         defect     - defect list management

 39         backup     - search for backup labels

 40         verify     - read and display labels

 41         save       - save new disk/partition definitions

 42         inquiry    - show vendor, product and revision

 43         volname    - set 8-character volume name

 44         !<cmd>     - execute <cmd>, then return

 45         quit   

 46 --创建Solaris fdisk 分区 --create a fdisk partition for Solaris software  47 --通过在提示符下指定 y,创建并激活跨整个磁盘的 Solaris fdisk 分区

 48 --所显示的 fdisk 菜单取决于磁盘是否存在现有 fdisk 分区     

 49 format>fdisk   

 50 No fdisk table exists. The default partition for the disk is:

 51 

 52   a 100% "SOLARIS System" partition

 53 

 54 Type "y" to accept the default partition,  otherwise type "n" to edit the

 55  partition table.

 56 y

 57 

 58 --创建和修改分片--Create and modify slices  59 format> partition

 60 

 61 PARTITION MENU:

 62         0      - change `0' partition

 63         1      - change `1' partition

 64         2      - change `2' partition

 65         3      - change `3' partition

 66         4      - change `4' partition

 67         5      - change `5' partition

 68         6      - change `6' partition

 69         7      - change `7' partition

 70         select - select a predefined table

 71         modify - modify a predefined partition table

 72         name   - name the current table

 73         print  - display the current table

 74         label  - write partition map and label to the disk

 75         !<cmd> - execute <cmd>, then return

 76         quit

 77 ---显示当前分区表-- VTOC-Solaris fdisk 分区被分成 10 个分片,编号为 09

 78 partition> print

 79 Current partition table (original):

 80 Total disk cylinders available: 1020 + 2 (reserved cylinders)

 81 

 82 Part      Tag    Flag     Cylinders        Size            Blocks

 83   0 unassigned    wm       0               0         (0/0/0)          0

 84   1 unassigned    wm       0               0         (0/0/0)          0

 85   2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920

 86   3 unassigned    wm       0               0         (0/0/0)          0

 87   4 unassigned    wm       0               0         (0/0/0)          0

 88   5 unassigned    wm       0               0         (0/0/0)          0

 89   6 unassigned    wm       0               0         (0/0/0)          0

 90   7 unassigned    wm       0               0         (0/0/0)          0

 91   8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096

 92   9 unassigned    wm       0               0         (0/0/0)          0

 93   

 94 注 疑问? partition时, - change `n' partition 只到7,即0-7个partition。可print时,part却是9个

 95   

 96 --- 修改分片 0

 97 partition> 0

 98 Part      Tag    Flag     Cylinders        Size            Blocks

 99   0 unassigned    wm       0               0         (0/0/0)          0

100 

101 Enter partition id tag[unassigned]:   --标识标记

102 Enter partition permission flags[wm]:  --权限标志

103 Enter new starting cyl[0]: 0           --起始柱面

104 Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 15mb  --大小

105 partition>      

106 

107 --- 修改分片 1

108 partition> print (查看0分片的占用柱面)

109 Current partition table (unnamed):

110 Total disk cylinders available: 1020 + 2 (reserved cylinders)

111 

112 Part      Tag    Flag     Cylinders        Size            Blocks

113   0 unassigned    wm       0 -    7       16.00MB    (8/0/0)      32768

114   1 unassigned    wm       0               0         (0/0/0)          0

115   2     backup    wu       0 - 1019        1.99GB    (1020/0/0) 4177920

116   3 unassigned    wm       0               0         (0/0/0)          0

117   4 unassigned    wm       0               0         (0/0/0)          0

118   5 unassigned    wm       0               0         (0/0/0)          0

119   6 unassigned    wm       0               0         (0/0/0)          0

120   7 unassigned    wm       0               0         (0/0/0)          0

121   8       boot    wu       0 -    0        2.00MB    (1/0/0)       4096

122   9 unassigned    wm       0               0         (0/0/0)          0

123 

124 partition> 1

125 Part      Tag    Flag     Cylinders        Size            Blocks

126   1 unassigned    wm       0               0         (0/0/0)          0

127 

128 Enter partition id tag[unassigned]:   --标识标记

129 Enter partition permission flags[wm]: --权限标志

130 Enter new starting cyl[0]: 8 --0分区以柱面7结尾,1分区则以8为起点

131 Enter partition size[0b, 0c, 8e, 0.00mb, 0.00gb]: 1.95gb  --分片1主要用于存储

132 partition> 

133 --- 为当前分区表指定名称 134 partition> name

135 Enter table name (remember quotes): physic3

136 

137 --- 将分区映射和标签写入当前磁盘138 

139 partition> label

140 Ready to label disk, continue? y

141 

142 partition>

143 

144 --- 退出partition

145 partition> quit

146 

147 --- VTOC-保存新的磁盘和分区信息。 148 format> save

149 Saving new disk and partition definitions

150 Enter file name["./format.dat"]: /etc/format.dat

151 format> 

3 查看添加的slice的信息

3.1分片命名惯例

--对于每个一磁盘分片,通常以cxtxdxsx表示,其中c/t/d/s的含义如下:

--*C代表控制器标号。控制器位于主板上面,所谓控制器,就是控制,发出命令的器件。

--*T代表目标编号。 即分配给每个存储设备的一个唯一的硬件地址。

--*D代表磁盘编号。 这个数字反映的是目标位置上的磁盘号,即具体的磁盘

--*S代表分片编号。 通常从0~7,即分片的号码了

3.2 查看/dev/dsk/c2t2d0s1 (分区中,添加的主存储分片为1)

 1 #  prtvtoc /dev/dsk/c2t1d0s1

 2 * /dev/dsk/c2t1d0s1 partition map

 3 *

 4 * Dimensions:

 5 *     512 bytes/sector

 6 *      32 sectors/track

 7 *     128 tracks/cylinder

 8 *    4096 sectors/cylinder

 9 *    1022 cylinders

10 *    1020 accessible cylinders

11 *

12 * Flags:

13 *   1: unmountable

14 *  10: read-only

15 *

16 * Unallocated space:

17 *       First     Sector    Last

18 *       Sector     Count    Sector 

19 *     4128768     49152   4177919

20 *

21 *                          First     Sector    Last

22 * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory

23        0      0    00          0     32768     32767

24        1      0    00      32768   4091904   4124671

25        2      5    01          0   4177920   4177919

26        8      1    01          0      4096      4095

27 # 

  本实验只对添加裸设备做介绍,对于磁盘的挂载,属性的更改暂不做介绍

 --参考oracle文档:http://docs.oracle.com/cd/E26926_01/html/E25884/disksxadd-50.html#scrolltoc

 

你可能感兴趣的:(Solaris)