Managing Devices in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Modifying Slices or Partitions

In most cases, disks are formatted and partitioned by the manufacturer. Thus, you configure disk partitions or slices if you want to modify partition configuration, either by changing the slice or partition size, or by changing the partition type.

SPARC: Using the partition Option

The Format utility's partition option configures disk slices on SPARC based systems. This section provides examples on the use of the partition option.

Example 6-15  SPARC: Resizing a Disk Slice

In this example, the root pool disk's size is insufficient. For an optimal size, the bulk of the disk space must be in slice 0. You change the partition size by modifying the current partition.

...Format Menu
format> partition
partition> print
Current partition table (default):
Total disk cylinders available: 14085 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       1 -    13      129.19MB    (13/0/0)       264576
1       swap    wu      14 -    26      129.19MB    (13/0/0)       264576
2     backup    wu       0 - 14086      136.71GB    (14087/0/0) 286698624
3 unassigned    wm       0                0         (0/0/0)             0
4 unassigned    wm       0                0         (0/0/0)             0
5 unassigned    wm       0                0         (0/0/0)             0
6        usr    wm      27 - 14084      136.43GB    (14058/0/0) 286108416
7 unassigned    wm       0                0         (0/0/0)             0
8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
9 alternates    wm       0                0         (0/0/0)             0

partition> modifyChange partition size.
Select partitioning base:
0. Current partition table (default)
1. All Free Hog
Choose base (enter number) [0]? 1

Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       0                0         (0/0/0)             0
1       swap    wu       0                0         (0/0/0)             0
2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
3 unassigned    wm       0                0         (0/0/0)             0
4 unassigned    wm       0                0         (0/0/0)             0
5 unassigned    wm       0                0         (0/0/0)             0
6        usr    wm       0                0         (0/0/0)             0
7 unassigned    wm       0                0         (0/0/0)             0
8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
9 alternates    wm       0                0         (0/0/0)             0

Do you wish to continue creating a new partition
table based on above table[yes]? yes
Free Hog partition[6]? 0
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '7' [0b, 0c, 0.00mb, 0.00gb]:

Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       1 - 14084      136.68GB    (14084/0/0) 286637568
1       swap    wu       0                0         (0/0/0)             0
2     backup    wu       0 - 14084      136.69GB    (14085/0/0) 286657920
3 unassigned    wm       0                0         (0/0/0)             0
4 unassigned    wm       0                0         (0/0/0)             0
5 unassigned    wm       0                0         (0/0/0)             0
6        usr    wm       0                0         (0/0/0)             0
7 unassigned    wm       0                0         (0/0/0)             0
8       boot    wu       0 -     0        9.94MB    (1/0/0)         20352
9 alternates    wm       0                0         (0/0/0)             0

Okay to make this the current partition table[yes]? yes
Enter table name (remember quotes): "c2t0d0"
Ready to label disk, continue? yes
partition> q
format> q

x86: Using the fdisk Option

You use the Format utility's fdisk option to administer fdisk partitions on x86 based systems.

You can use x86-type disks for ZFS storage pools, provided that the following requirements are met:

  • If the disk has multiple partitions, one of partitions must be a Solaris partition.

    With the fdisk option, you can determine if a Solaris partition exists. If not, create one, as shown in Example 6–16

  • The Solaris partition must be the active partition on the disk.

    The active partition is partition whose operating system will be booted by default at system startup.

  • Solaris fdisk partitions must begin on cylinder boundaries.

    The Solaris fdisk partitions must not begin at cylinder 0 on the first disk, which is reserved for storing additional boot information, including the master boot record.

  • The Solaris fdisk partition can be the entire disk or only part of the disk to leave space for other partitions.

    Provided the disk has sufficient space, you can create new partitions without having to reconfigure existing partitions on the disk.

All fdisk partitions have identifiers. A Solaris partition has two identifiers:

  • Solaris uses the 0x82 identifier.

  • Solaris2 uses the 0xbf identifier.

All Oracle Solaris commands, utilities, and drivers have been updated to work with either identifier with no impact on the fdisk functionality. Thus, you can switch between the two identifiers by selecting the appropriate option from the fdisk menu as follows:

format > fdisk
...
SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Specify the active partition
3. Delete a partition
4. Change between Solaris and Solaris2 Partition IDsToggle between identifiers
5. Edit/View extended partitions
6. Exit (update disk configuration and exit)
7. Cancel (exit without updating disk configuration)

Note -  You can change the fdisk identifier even when the file system that is contained in the partition is mounted.
Example 6-16  x86: Creating a Solaris fdisk Partition That Spans the Entire Drive

The following example shows how to create a Solaris fdisk partition that spans the entire c8t3d0 drive.

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c8t0d0 <SEAGATE-ST973401LSUN72G-0556 cyl 8921 alt 2 hd 255 sec 63>
/pci@0,0/pci1022,7458@11/pci1000,3060@4/sd@0,0
/dev/chassis/SYS/HD0/disk
1. c8t1d0 <SEAGATE-ST973401LSUN72G-0556 cyl 8921 alt 2 hd 255 sec 63>
/pci@0,0/pci1022,7458@11/pci1000,3060@4/sd@1,0
/dev/chassis/SYS/HD1/disk
2. c8t2d0 <SEAGATE-ST973401LSUN72G-0556-68.37GB>
/pci@0,0/pci1022,7458@11/pci1000,3060@4/sd@2,0
/dev/chassis/SYS/HD2/disk
3. c8t3d0 <SEAGATE-ST973401LSUN72G-0556 cyl 14087 alt 2 hd 24 sec 424>
/pci@0,0/pci1022,7458@11/pci1000,3060@4/sd@3,0
/dev/chassis/SYS/HD3/disk
Specify disk (enter its number): 3
selecting c8t3d0
[disk formatted]
No Solaris fdisk partition found.
format> fdisk
No fdisk table exists. The default partitioning for your disk is:

a 100% "SOLARIS System" partition.

Type "y" to accept the default partition, otherwise type "n" to edit the
partition table. y

format> label
Ready to label disk, continue? yes
format> quit
Example 6-17  x86: Converting an x86 Partition to a Solaris Partition

This example shows how to convert an existing partition to a Solaris partition. By default, disks have the EFI label on most x86 based systems. To change a partition type, you first destroy the existing one. When you change partition types, the labels are also automatically changed. Because the disk is originally an EFI disk, then you use the format –e command to launch the Format utility.

# format -e
...
format> fdisk
FORMAT MENU:
disk       - select a disk
type       - select (define) a disk type
Total disk size is 17833 cylinders
Cylinder size is 16065 (512 byte) blocks

Cylinders
Partition   Status    Type          Start   End    Length    %
=========   ======    ============  =====   ===    ======   ===
1                     EFI           0       17833  17834    100

SELECT ONE OF THE FOLLOWING:
1. Create a partition
2. Specify the active partition
3. Delete a partition
4. Change between Solaris and Solaris2 Partition IDs
5. Edit/View extended partitions
6. Exit (update disk configuration and exit)
7. Cancel (exit without updating disk configuration)
Enter Selection: 3
Specify the partition number to delete (or enter 0 to exit): 1
This will make all files and
programs in this partition inaccessible (type "y" or "n"). y
Enter Selection: 1
Select the partition type to create:
1=SOLARIS2   2=UNIX      3=PCIXOS     4=Other        5=DOS12
6=DOS16      7=DOSEXT    8=DOSBIG     9=DOS16LBA     A=x86 Boot
B=Diagnostic C=FAT32     D=FAT32LBA   E=DOSEXTLBA    F=EFI (Protective)
G=EFI_SYS    0=Exit? 1
Specify the percentage of disk to use for this partition
(or type "c" to specify the size in cylinders). 100
Should this become the active partition? If yes, it  will be activated
each time the computer is reset or turned on.
Please type "y" or "n". y
Enter Selection: 6
Partition 1 is now the active partition.