萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 作業系統 >  >> Solaris 介紹

Solaris 10 x86 新增硬碟完整操作指南:識別、分區、格式化、掛載

步驟 1:識別新增硬碟

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
  0. c0d0 <DEFAULT cyl 1302 alt 2 hd 255 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
Specify disk (enter its number): ^C

# 掃描新裝置
devfsadm

# 再次確認
format
AVAILABLE DISK SELECTIONS:
  0. c0d0 ...
  1. c0d1 <DEFAULT cyl 1303 alt 2 hd 255 sec 63> /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0  ← 新磁碟
Specify disk (enter its number): 1

devfsadm 會掃描硬體總線並建立 /devices、/dev 節點。若無效可嘗試 drvconfig; disks 或重啟。

步驟 2:FDISK 分區表建立 (x86 平台必要)

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

接受預設將整顆磁碟劃為單一 Solaris 分區 (ID 191)。

步驟 3:寫入磁碟標籤

format> label
Ready to label disk, continue? y

步驟 4:Slice (分區) 規劃

format> p          # 進入 partition 選單
partition> print   # 顯示預設分區表

Current partition table (original):
Total disk cylinders available: 1302 + 2 (reserved cylinders)

Part  Tag    Flag   Cylinders      Size         Blocks
  0    unassigned wm   0             0            0
  1    unassigned wm   0             0            0
  2    backup   wu   0 - 1301       9.97GB       20916630  ← 整盤備份分區,勿動
  3    unassigned wm   0             0            0
  ...
partition> 0         # 設定 slice 0 (通常為 / 或 /export/home)
Enter partition id tag[root]: 
Enter partition permission flags[wm]: 
Enter new starting cyl[0]: 3          # 保留 cyl 0-2 給 boot/alternates
Enter partition size[0b, 0c, 0.00mb, 0.00gb]: 25427808b  # 全部剩餘空間
partition> label   # 再次寫入標籤生效
partition> quit
format> quit

步驟 5:建立檔案系統與掛載

# 建立 UFS 檔案系統 (以 slice 0 為例)
newfs /dev/rdsk/c0d1s0

# 建立掛載點並掛載
mkdir /data1
mount /dev/dsk/c0d1s0 /data1

# 設定開機自動掛載 (/etc/vfstab)
/dev/dsk/c0d1s0   /dev/rdsk/c0d1s0   /data1   ufs   1   yes   -

關鍵提醒

  • x86 平台必須先 fdisk 建立 Solaris 分區,再進行 Slice 切割;SPARC 平台無此步驟。
  • Slice 2 (backup) 代表整顆磁碟,絕不可格式化或掛載。
  • 起始柱面建議從 3 開始 (0-2 保留給 boot/alternates)。
  • 分區修改後必須執行 label 寫入 VTOC,否則不生效。
copyright © 萬盛學電腦網 all rights reserved