System Administration Guide: Devices and File Systems

ProcedureHow to Create a Solaris Partition and Modify the Slices on a USB Mass Storage Device

The following steps illustrate how to create a Solaris partition and modify the slices.

Make sure you back up any data before you perform this task.

  1. Become superuser.

  2. Start the fdisk utility.

    For example:


    # 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. Display the current slices.

    For example:


    # 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. Create a text file with the slice information.

    For example:


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

    Make sure each slice starts on a cylinder boundary. For example, slice 1 starts at 822280000 bytes, which is the cylinder size in bytes multiplied by 1000.

    For more information, see the -s option description in rmformat(1).

  5. Create the slices by including the slice file created above.

    For example:


    # rmformat -s slice_file /dev/rdsk/c5t0d0s2
    
  6. View the new slice information.

    For example:


    # 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