Solaris 9 安裝指南

建立磁碟配置檔案

本節說明建立單一磁碟和多重磁碟配置檔案的方法。磁碟配置檔案讓您可以使用單一系統的 pfinstall (1M) 來測試不同磁碟配置的設定檔。

SPARC:建立一個磁碟配置檔

  1. 找出您要測試的磁碟所在的 SPARC 系統。

  2. 成為超級使用者。

  3. 藉由將 prtvtoc(1M) 指令的輸出重新導向一個檔案來建立一個磁碟配置檔案。


    # prtvtoc /dev/rdsk/device_name>disk_config_file
    

    /dev/rdsk/device_name

    系統磁碟的裝置名稱。device_name 的格式必須是 cwtxdy s2cxd ys2

    disk_config_file

    磁碟配置檔案的名稱。 

  4. 請決定您是否要在多重磁碟上測試 Solaris 軟體的安裝。

    • 如果選擇否,就會立即停止。您會離開程序。

    • 如果選擇是,請結合單一磁碟配置檔案,然後將輸出結果儲存在一個新的檔案中。


      # cat disk_file1 disk_file2>multi_disk_config
      

      新檔案會變成多重磁碟配置檔案,如下例所示:


      # cat 104_disk2 104_disk3 104_disk5>multi_disk_test
      
  5. 請決定磁碟裝置名稱的目標編號是否為您在前一步驟中所建立的多重磁碟配置檔案中的唯一編號。

    • 如果選擇是,就會立即停止。您會離開程序。

    • 如果選擇否,請以文字編輯器開啟檔案,並讓磁碟裝置名稱的目標編號成為唯一。

      例如,假設有三個不同的磁碟裝置名稱的檔案包含同一個目標編號 t0,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t0d0s2 partition map

      將第二個目標編號變更為 t2,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t2d0s2 partition map

SPARC: 磁碟配置檔範例

下例顯示在有 104 Mb 磁碟的 SPARC 系統上建立單一磁碟配置檔案 104_test 的方法。


範例 24–6 SPARC: 建立磁碟配置檔

您將 prtvtoc 指令的輸出結果重新導向名為 104_test 的單一磁碟配置檔案。


# prtvtoc /dev/rdsk/c0t3d0s2>104_test

104_test 檔案的內容就像下面這樣:

* /dev/rdsk/c0t3d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      72 sectors/track
*      14 tracks/cylinder
*    1008 sectors/cylinder
*    2038 cylinders*    2036 accessible cylinders
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       1      2    00          0     164304   164303   /
       2      5    00          0    2052288  2052287  
       3      0    00     164304     823536   987839   /disk2/b298
       5      0    00     987840     614880  1602719   /install/298/sparc/work
       7      0    00    1602720     449568  2052287   /space

您已經為基於 SPARC 的系統建立了磁碟配置檔。測試設定檔 包含關於使用磁碟配置檔案來測試設定檔的資訊。


x86: 建立磁碟配置檔案

  1. 尋找您正在測試的磁碟所在的 IA 系統。

  2. 成為超級使用者。

  3. 透過在檔案中儲存fdisk(1M) 指令的輸出來建立部份單一磁碟配置檔。


    # fdisk -R -W disk_config_file -h /dev/rdsk/device_name
    

    disk_config_file

    磁碟配置檔的名稱。 

    /dev/rdsk/device_name

    整個磁碟的 fdisk 佈局之裝置名稱。 device_name 的格式必須是 cwtxdy s2cxd ys2

  4. prtvtoc(1M) 指令的輸出附加到磁碟配置檔:


    # prtvtoc /dev/rdsk/device_name >>disk_config
    

    /dev/rdsk/device_name

    系統磁碟的裝置名稱。device_name 的格式必須是 cwtxdy s2cxd ys2

    disk_config

    磁碟配置檔案的名稱。 

  5. 請決定您是否要在多重磁碟上測試 Solaris 軟體的安裝。

    • 如果選擇否,就會立即停止。您會離開程序。

    • 如果選擇是,請結合單一磁碟配置檔案,然後將輸出結果儲存在一個新的檔案中。


      # cat disk_file1 disk_file2>multi_disk_config
      

      新檔案會變成多重磁碟配置檔案,如下例所示:


      # cat 104_disk2 104_disk3 104_disk5>multi_disk_test
      
  6. 請決定磁碟裝置名稱的目標編號是否為您在前一步驟中所建立的多重磁碟配置檔案中的唯一編號。

    • 如果選擇是,就會立即停止。您會離開程序。

    • 如果沒有,利用文字編輯器開啟一個檔並設定特定目標編號。

      例如,假設有三個不同的磁碟裝置名稱的檔案包含同一個目標編號 t0,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t0d0s2 partition map

      將第二個目標編號變更為 t2,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t2d0s2 partition map

x86: 磁碟配置檔案範例

以下範例顯示如何在具有 500 MB 磁碟空間的 IA 系統上建立單一-磁碟配置檔,500_test


範例 24–7 x86: 建立磁碟配置檔案

首先,您必須先將 fdisk 指令的輸出結果儲存到一個稱為 500_test的檔案:


# fdisk -R -W 500_test -h /dev/rdsk/c0t0d0p0

500_test 檔案如下所示:

 * /dev/rdsk/c0t0d0p0 default fdisk table
* Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
*  HBA Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
* systid:
*  1:    DOSOS12
*  2:    PCIXOS
*  4:    DOSOS16
*  5:    EXTDOS
*  6:    DOSBIG
*  86:   DOSDATA
*  98:   OTHEROS
*  99:   UNIXOS
* 130:   SUNIXOS
*
* Id  Act Bhead Bsect   Bcyl  Ehead  Esect  Ecyl Rsect  Numsect
 130  128 44    3       0     46    30     1001 1410   2050140

然後,將 prtvtoc 指令的輸出結果附加到 500_test 檔案中:


# prtvtoc /dev/rdsk/c0t0d0s2>>500_test

500_test 檔案現在是一個完整的磁碟配置檔:

* /dev/rdsk/c0t0d0p0 default fdisk table	
* Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
*  HBA Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
* systid:
*  1:    DOSOS12
*  2:    PCIXOS
*  4:    DOSOS16
*  5:    EXTDOS
*  6:    DOSBIG
*  86:   DOSDATA
*  98:   OTHEROS
*  99:   UNIXOS
*  130:  SUNIXOS
*
* Id  Act Bhead Bsect Bcyl  Ehead  Esec  Ecyl Rsect  Numsect
 130  128 44    3     0     46    30    1001 1410   2050140
* /dev/rdsk/c0t0d0s2 partition map
*
* Dimensions:
*      512 bytes/sector
*       94 sectors/track
*       15 tracks/cylinder
*     1110 sectors/cylinder
*     1454 cylinders
*     1452 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*                          First    Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       2      5    01       1410   2045910   2047319
       7      6    00       4230   2043090   2047319  /space
       8      1    01          0      1410     1409
       9      9    01       1410      2820     422987

您已為基於 IA 的系統建立了磁碟配置檔。 測試設定檔 包含關於使用磁碟配置檔案來測試設定檔的資訊。


SPARC:建立一個磁碟配置檔

  1. 找出您要測試的磁碟所在的 SPARC 系統。

  2. 成為超級使用者。

  3. 藉由將 prtvtoc(1M) 指令的輸出重新導向一個檔案來建立一個磁碟配置檔案。


    # prtvtoc /dev/rdsk/device_name>disk_config_file
    

    /dev/rdsk/device_name

    系統磁碟的裝置名稱。device_name 的格式必須是 cwtxdy s2cxd ys2

    disk_config_file

    磁碟配置檔案的名稱。 

  4. 請決定您是否要在多重磁碟上測試 Solaris 軟體的安裝。

    • 如果選擇否,就會立即停止。您會離開程序。

    • 如果選擇是,請結合單一磁碟配置檔案,然後將輸出結果儲存在一個新的檔案中。


      # cat disk_file1 disk_file2>multi_disk_config
      

      新檔案會變成多重磁碟配置檔案,如下例所示:


      # cat 104_disk2 104_disk3 104_disk5>multi_disk_test
      
  5. 請決定磁碟裝置名稱的目標編號是否為您在前一步驟中所建立的多重磁碟配置檔案中的唯一編號。

    • 如果選擇是,就會立即停止。您會離開程序。

    • 如果選擇否,請以文字編輯器開啟檔案,並讓磁碟裝置名稱的目標編號成為唯一。

      例如,假設有三個不同的磁碟裝置名稱的檔案包含同一個目標編號 t0,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t0d0s2 partition map

      將第二個目標編號變更為 t2,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t2d0s2 partition map

SPARC: 磁碟配置檔範例

下例顯示在有 104 Mb 磁碟的 SPARC 系統上建立單一磁碟配置檔案 104_test 的方法。


範例 24–6 SPARC: 建立磁碟配置檔

您將 prtvtoc 指令的輸出結果重新導向名為 104_test 的單一磁碟配置檔案。


# prtvtoc /dev/rdsk/c0t3d0s2>104_test

104_test 檔案的內容就像下面這樣:

* /dev/rdsk/c0t3d0s2 partition map
*
* Dimensions:
*     512 bytes/sector
*      72 sectors/track
*      14 tracks/cylinder
*    1008 sectors/cylinder
*    2038 cylinders*    2036 accessible cylinders
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       1      2    00          0     164304   164303   /
       2      5    00          0    2052288  2052287  
       3      0    00     164304     823536   987839   /disk2/b298
       5      0    00     987840     614880  1602719   /install/298/sparc/work
       7      0    00    1602720     449568  2052287   /space

您已經為基於 SPARC 的系統建立了磁碟配置檔。測試設定檔 包含關於使用磁碟配置檔案來測試設定檔的資訊。


x86: 建立磁碟配置檔案

  1. 尋找您正在測試的磁碟所在的 IA 系統。

  2. 成為超級使用者。

  3. 透過在檔案中儲存fdisk(1M) 指令的輸出來建立部份單一磁碟配置檔。


    # fdisk -R -W disk_config_file -h /dev/rdsk/device_name
    

    disk_config_file

    磁碟配置檔的名稱。 

    /dev/rdsk/device_name

    整個磁碟的 fdisk 佈局之裝置名稱。 device_name 的格式必須是 cwtxdy s2cxd ys2

  4. prtvtoc(1M) 指令的輸出附加到磁碟配置檔:


    # prtvtoc /dev/rdsk/device_name >>disk_config
    

    /dev/rdsk/device_name

    系統磁碟的裝置名稱。device_name 的格式必須是 cwtxdy s2cxd ys2

    disk_config

    磁碟配置檔案的名稱。 

  5. 請決定您是否要在多重磁碟上測試 Solaris 軟體的安裝。

    • 如果選擇否,就會立即停止。您會離開程序。

    • 如果選擇是,請結合單一磁碟配置檔案,然後將輸出結果儲存在一個新的檔案中。


      # cat disk_file1 disk_file2>multi_disk_config
      

      新檔案會變成多重磁碟配置檔案,如下例所示:


      # cat 104_disk2 104_disk3 104_disk5>multi_disk_test
      
  6. 請決定磁碟裝置名稱的目標編號是否為您在前一步驟中所建立的多重磁碟配置檔案中的唯一編號。

    • 如果選擇是,就會立即停止。您會離開程序。

    • 如果沒有,利用文字編輯器開啟一個檔並設定特定目標編號。

      例如,假設有三個不同的磁碟裝置名稱的檔案包含同一個目標編號 t0,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t0d0s2 partition map

      將第二個目標編號變更為 t2,如此處所示:

      * /dev/rdsk/c0t0d0s2 partition map
      ...
      * /dev/rdsk/c0t2d0s2 partition map

x86: 磁碟配置檔案範例

以下範例顯示如何在具有 500 MB 磁碟空間的 IA 系統上建立單一-磁碟配置檔,500_test


範例 24–7 x86: 建立磁碟配置檔案

首先,您必須先將 fdisk 指令的輸出結果儲存到一個稱為 500_test的檔案:


# fdisk -R -W 500_test -h /dev/rdsk/c0t0d0p0

500_test 檔案如下所示:

 * /dev/rdsk/c0t0d0p0 default fdisk table
* Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
*  HBA Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
* systid:
*  1:    DOSOS12
*  2:    PCIXOS
*  4:    DOSOS16
*  5:    EXTDOS
*  6:    DOSBIG
*  86:   DOSDATA
*  98:   OTHEROS
*  99:   UNIXOS
* 130:   SUNIXOS
*
* Id  Act Bhead Bsect   Bcyl  Ehead  Esect  Ecyl Rsect  Numsect
 130  128 44    3       0     46    30     1001 1410   2050140

然後,將 prtvtoc 指令的輸出結果附加到 500_test 檔案中:


# prtvtoc /dev/rdsk/c0t0d0s2>>500_test

500_test 檔案現在是一個完整的磁碟配置檔:

* /dev/rdsk/c0t0d0p0 default fdisk table	
* Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
*  HBA Dimensions:
*     512 bytes/sector
*      94 sectors/track
*      15 tracks/cylinder
*    1455 cylinders
*
* systid:
*  1:    DOSOS12
*  2:    PCIXOS
*  4:    DOSOS16
*  5:    EXTDOS
*  6:    DOSBIG
*  86:   DOSDATA
*  98:   OTHEROS
*  99:   UNIXOS
*  130:  SUNIXOS
*
* Id  Act Bhead Bsect Bcyl  Ehead  Esec  Ecyl Rsect  Numsect
 130  128 44    3     0     46    30    1001 1410   2050140
* /dev/rdsk/c0t0d0s2 partition map
*
* Dimensions:
*      512 bytes/sector
*       94 sectors/track
*       15 tracks/cylinder
*     1110 sectors/cylinder
*     1454 cylinders
*     1452 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*                          First    Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       2      5    01       1410   2045910   2047319
       7      6    00       4230   2043090   2047319  /space
       8      1    01          0      1410     1409
       9      9    01       1410      2820     422987

您已為基於 IA 的系統建立了磁碟配置檔。 測試設定檔 包含關於使用磁碟配置檔案來測試設定檔的資訊。