在 Oracle® Solaris 11.2 中管理设备

退出打印视图

更新时间: 2014 年 7 月
 
 

如何在 USB 海量存储设备中创建 Solaris 分区和修改分片

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

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

  1. 成为管理员。
  2. (u53ef选) 显示系统的分区信息。
    # fdisk device
  3. 显示当前的分片。
    # prtvtoc device
  4. 创建包含分片信息的文本文件。

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

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

  5. 通过引用在上一步中创建的分片文件来创建分片。
    # rmformat -s slice-file device
  6. 查看新的分片信息。
    # prtvtoc device
示例 13-2  在 USB 设备上创建分片

以下示例将在设备 c5t0d0s2 上创建分片。已创建包含以下内容的分片文件 myslice

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

创建新分片时将使用该文件。

# 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.
yThe current partition is accepted and will not be modified.

# 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

# rmformat -s myslice /dev/rdsk/c5t0d0s2

# 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