Solaris 添加新硬盤 分區 格式化

Solaris添加新硬盤 分區 格式化一般對於一塊新硬盤的處理方法也就用到format,newfs,mount這幾個命令就夠了,爲了更好的交流和學習我認爲還是具體一些的好。 

Solaris平臺下的硬盤具體增設方法大致如下: 
1. 關閉系統,進入PROM狀態 # init 0 ok (PROM狀態提示) 
2. 在PROM狀態提示符下確認當前系統所連接的SCSI設備狀況 ok probe-scsi 或 ok probe-scsi-all 
這時,系統將顯示所能識別的SCSI設備極其設備號(Target ID).如果新連接的硬 盤之信息沒有出現時,請按下述方法進行確認. 
1) 檢查設備號是否重複? 
Target-ID SunOS 4.xSolaris 2.x 
3 內藏硬盤  
1 硬盤 通常與SunOS 4.x一致. 
2 硬盤 當ID不重複時, 4,5也 
0 硬盤 可以用於硬盤. 
4 磁帶   
5 磁帶   
6 CD-ROM CD-ROM 
2) 檢查電纜,插口,終端器等物理連接是否無誤? 
3) SCSI電纜的總長度是否在6米以內? 
3. 重新起動系統 ok boot -r 
注意,只有加入"-r"選項時, 系統在起動時纔給所識別了的設備(包括SCSI設備) 生成相應的設備文件. 
4. 對新增設的硬盤進行盤區劃分 
進入系統狀態後,執行format命令,對新增設的硬盤進行盤區劃分. 
執行例 
format 
Searching for disks...done 

AVAILABLE DISK SELECTIONS: 
0. c0t3d0 
/sbus@1,f8000000/esp@0,800000/sd@3,0 
Specify disk (enter its number): 0 <-- 選擇硬盤selecting c0t3d0 [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 repair repair a defective sector show translate a disk address 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 volname set 8-character volume name quit format> partition <-- 鍵入partition(或par)進入分區狀態   

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 quit partition> modify <-- 鍵入modify(或mod),修改當前分區表. 

Select partitioning base: 
0. Current partition table (original) 
1. All Free Hog Choose base (enter number) [0]? 0 <-- 選擇當前分區表. 

Part    Tag    Flag Cylinders Size Blocks 
0 unassigned wm 0 17 15.90MB (18/0/0) 
1 unassigned wm 18 88 62.71MB (71/0/0) 
2 unassigned wm 0 742 656.29MB (743/0/0) 
3 unassigned wm 89 121 29.15MB (33/0/0) 
4 unassigned wm 0 0 (0/0/0) 
5 unassigned wm 122 230 96.28MB (109/0/0) 
6 unassigned wm 231 555 287.07MB (325/0/0) 
7 unassigned wm 556 742 165.18MB (187/0/0) Do you wish to continue creating a new partition table based on above table[yes]? y <-- 鍵入y,以當前分區表爲基準分區. 
Free Hog partition[6]? 7 <-- 選擇適當的浮動區.(注1) 
Enter size of partition ''''''''0'''''''' [32562b, 18c, 15.90mb]: 16mb <-- 指定容量 
Enter size of partition ''''''''1'''''''' [128439b, 71c, 62.71mb]: 62.7mb (注2) 
Enter size of partition ''''''''3'''''''' [59697b, 33c, 29.15mb]: 29mb 
Enter size of partition ''''''''4'''''''' [0b, 0c, 0.00mb]: 0 
Enter size of partition ''''''''5'''''''' [197181b, 109c, 96.28mb]: 96mb 
Enter size of partition ''''''''6'''''''' [587925b, 325c, 287.07mb]: 287mb 

Part Tag Flag Cylinders Size Blocks 
0 unassigned wm 0 18 16.78MB (19/0/0) 
1 unassigned wm 19 89 62.71MB (71/0/0) 
2 unassigned wm 0 742 656.29MB (743/0/0) 
3 unassigned wm 90 122 29.15MB (33/0/0) 
4 unassigned wm 0 0 (0/0/0) 
5 unassigned wm 123 231 96.28MB (109/0/0) 
6 unassigned wm 232 556 287.07MB (325/0/0) 
7 unassigned wm 557 742 164.29MB (186/0/0) Okay to make this the current partition table[yes]? y <-- 確認後鍵入y. 
Enter table name (remember quotes): new_table <-- 鍵入適當的名稱. 
partition> label <-- 鍵入label(或lab),設定系統標識. 
ok to label disk? y <-- 鍵入y 
partition> q <-- 鍵入q退出分區狀態. 
format> q <-- 鍵入q退出format 
(注1) 當改變其他分區尺寸時, 浮動區(Free Hog)用於在容量範圍內進行自動調 節. 
(注2) 分區容量的具體指定方法爲: 
容量數值後面加"b": 指定塊數. 
容量數值後面加"c": 指定柱面數. 
容量數值後面加"mb": 指定MB數. 
建議採用"mb",以兆字節爲單位指定分區容量. 
5. 生成新的文件系統用newfs命令將所劃分的分區生成爲新的文件系統. 
#/usr/sbin/newfs /dev/rdsk/c0t1d0s7 (CR) 
如果在上述過程中將整個硬盤指定爲一個分區,可執行下述命令. 
# /usr/sbin/newfs /dev/rdsk/c0t1d0s2 (CR) 
6. 檢查新生成的文件系統 
用fsck命令檢查新生成的文件系統是否正確. 
# /usr/sbin/fsck /dev/rdsk/c0t1d0s7 (CR) 
如果在上述過程中將整個硬盤指定爲一個分區,可執行下述命令. 
# /usr/sbin/fsck /dev/rdsk/c0t1d0s2 (CR) 
7. 安裝新生成的文件系統 
建立安裝用目錄後用mount命令進行安裝. 
例如,要將第7分區之文件系統用於home1時,可執行下述命令. 
# mkdir /home1 (CR) 
# mount /dev/dsk/c0t1d0s7 /home1 (CR) 
8. 確認安裝結果 用df命令確認安裝結果. 
# df -k (CR) 
9. 自動安裝新設文件系統 
爲在系統起動時自動安裝新設文件系統,修改/etc/vfstab文件. 

# vi /etc/vfstab (CR) 
#device device mount FS fsck mount mount 
#to mount to fsck point type pass at boot options 


/dev/dsk/c0t3d0s7 /dev/rdsk/c0t3d0s7 /home1 ufs 6 yes - 

10. 重新起動系統 
# sync;sync;reboot (CR)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章