系统管理指南:设备和文件系统

Procedure如何在不运行 vold 的情况下在 USB 海量存储设备中创建 Solaris 分区和修改片

以下步骤说明如何创建 Solaris 分区和修改片。

有关禁用 vold 的信息,请参见如何在不运行 vold 的情况下准备使用 USB 海量存储设备

执行此任务之前,请确保先备份所有数据。

  1. 成为超级用户。

  2. 启动 fdisk 实用程序。

    例如:


    # fdisk /dev/rdsk/c5t0d0s2
    
    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
    
  3. 显示当前的片。

    例如:


    # prtvtoc /dev/rdsk/c5t0d0s2
    
    * /dev/rdsk/c5t0d0s2 partition map
    
    *
    
    * Dimensions:
    
    *     512 bytes/sector
    
    *      63 sectors/track
    
    *     255 tracks/cylinder
    
    *   16065 sectors/cylinder
    
    *    5836 cylinders
    
    *    5836 accessible cylinders
    
    *
    
    * Flags:
    
    *   1: unmountable
    
    *  10: read-only
    
    *
    
    *                          First     Sector    Last
    
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
    
           0      0    00          0  93755340  93755339
    
           2      0    00          0  93755340  93755339
  4. 创建包含片信息的文本文件。

    例如:


    slices: 0 = 0, 5GB, "wm", "home" :
    
            1 = 8225280000, 6GB :
    
            2 = 0, 44GB, "wm", "backup" :
    
            6 = 16450560000, 15GB

    请确保每个片都从柱面边界开始。例如,片 1 的初始大小为 822280000 字节,即柱面大小与 1000 的乘积(以字节为单位)。

    有关更多信息,请参见 rmformat(1) 中的 -s 选项说明。

  5. 通过包含以上创建的片文件来创建片。

    例如:


    # rmformat -s slice_file /dev/rdsk/c5t0d0s2
    
  6. 查看新的片信息。

    例如:


    # prtvtoc /dev/rdsk/c5t0d0s2
    
    * /dev/rdsk/c5t0d0s2 partition map
    
    *
    
    * Dimensions:
    
    *     512 bytes/sector
    
    *      63 sectors/track
    
    *     255 tracks/cylinder
    
    *   16065 sectors/cylinder
    
    *    5836 cylinders
    
    *    5836 accessible cylinders
    
    *
    
    * Flags:
    
    *   1: unmountable
    
    *  10: read-only
    
    *
    
    * Unallocated space:
    
    *       First     Sector    Last
    
    *       Sector     Count    Sector
    
    *    10485760   5579240  16064999
    
    *    28647912   3482088  32129999
    
    *    63587280  30168060  93755339
    
    *
    
    *                          First     Sector    Last
    
    * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
    
           0      8    00          0  10485760  10485759
    
           1      3    01   16065000  12582912  28647911
    
           2      5    00          0  92274688  92274687
    
           6      4    00   32130000  31457280  63587279