歡迎您光臨本站 註冊首頁

一、在SUN E250上增加大容量硬碟

SUN E250伺服器是一款可插入六塊硬碟的工作組伺服器,SUN公司官方稱此伺服器只可使用36GB以下的SCSI硬碟,通過實踐我們成功的在SUN E250上插入了一塊18GB的SCSI硬碟安裝操作系統,五塊146GB的SCSI硬碟作數據存儲,具體操作過程如下:

 1、先插入18GB硬碟,安裝Solaris 9操作系統。

 2、關閉系統,調整每一塊SCSI大容量硬碟的ID號,使之不重複后,插入機器中。

 3、開機按Stop-A進入PROM狀態 % init 0 ok (PROM狀態提示) 。

 4、在PROM狀態提示符下確認當前系統所連接的SCSI設備狀況鍵入

 probe-scsi 或 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米以內?

 5、重新起動系統,鍵入

 boot -r

注意,只有加入"-r"選項時, 系統在起動時才給所識別了的設備(包括SCSI設備) 生成相應的設備文件。

 6、對新增設的硬碟進行盤區劃分

進入系統狀態后,執行format命令,對新增設的硬碟進行盤區劃分。

 # format (CR)

 Searching for disks...done

 AVAILABLE DISK SELECTIONS:

 0. c0t0d0

 /pci@1f,4000/scsi@3/sd@0,0

 1. c0t1d0

 /pci@1f,4000/scsi@3/sd@9,0

 2. c0t2d0

 /pci@1f,4000/scsi@3/sd@a,0

 3. c0t3d0

 /pci@1f,4000/scsi@3/sd@b,0

 4. c0t4d0

 /pci@1f,4000/scsi@3/sd@d,0

 5. c0t5d0

 /pci@1f,4000/scsi@3/sd@f,0

 Specify disk (enter its number): 1 //<-- 選擇硬碟

 selecting c0t1d0

 [disk unformatted]

 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

 inquiry show vendor, product and revision

 volname set 8-character volume name

 ! execute , then return

 quit

 format> partition <-- 鍵入partition(或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

 partition> modify <-- 鍵入modify(或m),修改當前分區表.

 Select partitioning base:

 0. Current partition table (original)

 1. All Free Hog Choose base

 (enter number) [0]? 1 <-- 選擇當前分區表.

 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 unassigned wm 0-49779 136.72GB (49780/0/0) 286732800

 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

 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' [0b,0c,0mb]:0mb<-- 指定容量(注2)

 Enter size of partition '1' [0b,0c,0mb]:0mb

 Enter size of partition '3' [0b,0c,0mb]:0mb

 Enter size of partition '4' [0b,0c,0mb]:0mb

 Enter size of partition '5' [0b,0c,0mb]:0mb

 Enter size of partition '6' [0b,0c,0mb]:0mb

 Enter size of partition '7' [0b,0c,0mb]:0mb

 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 unassigned wm 0-49779 136.72GB (49780/0/0) 286732800

 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

 Okay to make this the current partition table[yes]? 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",以兆位元組為單位指定分區容量。

如需要對硬碟陣列創建RAID,則需要對每塊硬碟均進行上述操作,然後跳過7~12步直接創建RAID即可。

 7、生成新的文件系統

用newfs命令將所劃分的分區生成為新的文件系統。

 # /usr/sbin/newfs /dev/rdsk/c0t1d0s2 (CR)

此命令將整個硬碟指定為一個分區。

 8、檢查新生成的文件系統

用fsck命令檢查新生成的文件系統是否正確。

 # /usr/sbin/fsck /dev/rdsk/c0t1d0s2 (CR)

 9、安裝新生成的文件系統

建立安裝用目錄後用mount命令進行安裝。

例如,要將第2分區之文件系統用於home1時,可執行下述命令。

 # mkdir /home1 (CR)

 # mount /dev/dsk/c0t1d0s2 /home1 (CR)

 10、確認安裝結果,用df命令確認安裝結果。

 # df -k (CR)

 11、自動安裝新設文件系統

在系統起動時自動安裝新設文件系統,修改/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/c0t1d0s2 /dev/rdsk/c0t1d0s2 /home1 ufs 6 yes -

 12、重新起動系統

 # reboot (CR)

至此,大容量SCSI硬碟即可被機器認可。

二、用軟體對硬碟陣列創建RAID 5

以下是用solaris9系統和6塊硬碟(一個系統盤,另外五塊做raid5,mount在/var/eyou下做郵件系統的實例。

在Solaris 9系統下用命令行形式下配置可分為9步完成!

 1、根據上述介紹的方法,使用format命令對每一塊硬碟進行分區和格式化,設置硬碟卷標和其他參數。

 2、創建metadevice database他包括了硬碟分區在metadevices中的各項信息。

 # metadb -a -f -c2 c0t1d0s2 c0t2d0s2 c0t3d0s2 c0t4d0s2 c0t5d0s2

用戶應根據自己系統和添加硬碟的實際情況自己改變c0t1d0s2 c0t2d0s2 c0t3d0s2 c0t4d0s2 c0t5d0s2等參數。

 3、配置raid0 metadevice,此步定義了raid0 metadevice的名字,metadevice中的slices participating和stripe width等信息。

 # metainit d0 -r c0t1d0s2 c0t2d0s2 c0t3d0s2 c0t4d0s2 c0t5d0s2 -i 65k

 4、配置一個或多個hot spare pool,進行初始化。

 # metainit hsp001

 # metaparam -h hsp001 d0

此步操作需要時間較長,根據硬碟個數和容量而定,一般需要幾個小時。是否結束可隨時使用如下命令查看。

#metastat

 5、在metadevice創建一個文件系統

 # newfs -c 256 -i 8192 -m 8 -C 65 /dev/md/rdsk/d0

至此RAID 5已經創建成功。

 6、安裝新生成的文件系統

建立安裝用目錄後用mount命令進行安裝。

 # mkdir /var/eyou (CR)

 # mount /dev/md/dsk/d0 /var/eyou (CR)

 7、確認安裝結果,用df命令確認安裝結果。

 # df -k (CR)

 8、自動安裝新設文件系統

將新建的文件系統mount在需要的目錄,並設置開機自動載入!使用vi命令修改/etc/vfstab文件,在該文件后加入如下一行。

 /dev/md/dsk/d0 /dev/md/rdsk/d0 /var/eyou ufs 6 yes -

 9、重新啟動系統即可。

在solaris9系統下,也可啟動管理控制台(SMC)工具在圖型界面下配置,因為是中文圖形界面,且每一步都有幫助提示,所以這裡不再贅述!

注意:不要採取圖形和命令行形式混合使用,否則將導致配置不成功,在圖形界面時也要先創建database,否則將無法進行下一步!

[火星人 ] 在SUN E250工作組伺服器上增加大容量硬碟和創建磁碟陣列RAID5已經有784次圍觀

http://coctec.com/docs/linux/show-post-203834.html