solaris裸设备和格式化分区和查看硬盘

# format       ====查看已经挂接上的硬盘==
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 7293 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1f,2/ide@0/cmdk@0,0
       1. c2t1d0 <DEFAULT cyl 157 alt 2 hd 64 sec 32>  (这个数字是硬盘的容量)=160m
          /iscsi/[email protected]%3Arac1.ocr0001,0
       2. c2t2d0 <DEFAULT cyl 61 alt 2 hd 64 sec 32>
          /iscsi/[email protected]%3Arac1.vot0001,0
       3. c2t3d0 <DEFAULT cyl 157 alt 2 hd 64 sec 32>
          /iscsi/[email protected]%3Arac1.asmspfile0001,0
       4. c2t4d0 <DEFAULT cyl 11473 alt 2 hd 255 sec 63>
          /iscsi/[email protected]%3Arac1.asm10001,0
       5. c2t5d0 <DEFAULT cyl 11473 alt 2 hd 255 sec 63>
          /iscsi/[email protected]%3Arac1.asm20001,0
       6. c2t6d0 <DEFAULT cyl 12746 alt 2 hd 255 sec 63>
          /iscsi/[email protected]%3Arac1.asm30001,0
Specify disk (enter its number): 1
                   selecting c2t1d0
[disk formatted]

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
     fdisk     - run the fdisk program
     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
     !<cmd>    - execute <cmd>, then return
format> partition  ==分区硬盘==
Please run fdisk first
format> fdisk     ===格式化硬盘====
No fdisk table exists. The default partition for the disk is:

   a 100% "SOLARIS system" partition

Type "y" to accept the default partition, otherwise type "n" to edit the partition table.
y
format> partition  ===在格式化硬盘后,分区===

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 the partition map and label to the disk
     !<cmd> - execute <cmd>, then return
     quit


partition> print ==查看,当前分区表====( c2t1d0 硬盘上)
Current partition table (original):
Total disk cylinders(圆柱) available: 156 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders       Size            Blocks
  0 unassigned    wm       0              0         (0/0/0)        0
  1 unassigned    wm       0              0         (0/0/0)        0
  2     backup    wu       0 - 156      157.00MB    (157/0/0) 321536
  3 unassigned    wm       0              0         (0/0/0)        0
  4 unassigned    wm       0              0         (0/0/0)        0
  5 unassigned    wm       0              0         (0/0/0)        0
  6 unassigned    wm       0              0         (0/0/0)        0
  7 unassigned    wm       0              0         (0/0/0)        0
  8       boot    wu       0 -   0        1.00MB    (1/0/0)     2048
  9 unassigned    wm       0              0         (0/0/0)        0

partition> 1
Part      Tag    Flag     Cylinders       Size            Blocks
  1 unassigned    wm       0              0         (0/0/0)        0

Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 3
Enter partition size[0b, 0c, 3e, 0.00mb, 0.00gb]: 153c   ===153 cyl(圆柱)=


partition> label  --加标签
Ready to label disk, continue? y



=====================

说明:

Flag:wm=磁盤分區是寫并且可mount的     write mount

      wu=磁盤分區是可寫并且不可mount的 write unmount

      rm=磁盤分區是可讀并且可mount的   read mount

      ru=磁盤分區是可讀并且不可mount的 read unmount







Current partition table (original):

Total disk cylinders available: 14087 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks

  0       root    wm     0 -  1610       7.82GB    (1611/0/0)   16393536

  1       swap    wu    1611 -  2013     1.96GB    (403/0/0)   4100928

  2     backup    wm     0 - 14086     68.35GB    (14087/0/0) 143349312

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

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

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

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

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

partition> 7

Part      Tag    Flag     Cylinders         Size            Blocks

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



Enter partition id tag[unassigned]:                --之前定義的可選的標記符

--( 只可以使用 unassigned, boot, root, swap, usr, backup, stand, var, home, alternates )

Enter partition permission flags[wm]:             --之前定義的的可選的標示位

--( wm - read-write, mountable,wu - read-write, unmountable,rm - read-only, mountable,ru - --read-only, unmountable )

Flag:wm=磁盤分區是寫并且可mount的

      wu=磁盤分區是可寫并且不可mount的

      rm=磁盤分區是可讀并且可mount的

      ru=磁盤分區是可讀并且不可mount的



  Cylinders分區的起始柱頭數和中止柱頭數      

Enter new starting cyl[0]: 2014

Enter partition size[0b, 0c, 2014e, 0.00mb, 0.00gb]: 100mb

partition> lab                        --將當前定義的分區寫入磁盤卷標

Ready to label disk, continue? y

partition> s                      --save - save new disk/partition definitions



切忌,第二個分區(分區編號為 2)稱為備份分區,她是整個磁盤




重点:

这个过程一般可以分为3个步骤:(更好理解)
1. 物理格式化,也就是通常所说的低级格式化(Low-Level Formatting,LLF); ==fdisk
2. 分区;                                                            ==partition
3. 逻辑格式化,也就是通常所说的高级格式化(High-Level Formatting,HLF) ==format





1.磁盘管理-——分区命名惯例

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

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

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

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

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

比如上面的c0t0d0  



裸设备存放地址:===重点

============/dev/rdsk/c2t1d0s* 下面已经都有了,=====

#chown root:dba /dev/rdsk/c2t1d0s1
# chmod 660 /dev/rdsk/c2t1d0s1
# chown oracle:dba /dev/rdsk/c2t2d0s1
# chmod 660 /dev/rdsk/c2t2d0s1
# chown oracle:dba /dev/rdsk/c2t3d0s1
# chown oracle:dba /dev/rdsk/c2t4d0s1
# chown oracle:dba /dev/rdsk/c2t5d0s1
# chown oracle:dba /dev/rdsk/c2t6d0s1

猜你喜欢

转载自huangfeng555.iteye.com/blog/837902