Become superuser or assume an equivalent role.
# format |
A list of available disks is displayed. For more information, see format(1M).
Type the number of the disk that you want to repartition from the list displayed on your screen.
Specify disk (enter its number): disk-number |
disk-number is the number of the disk that you want to repartition.
Select the partition menu.
format> partition |
Display the current partition (slice) table.
partition> print |
Start the modification process.
partition> modify |
Set the disk to all free hog.
Choose base (enter number) [0]? 1 |
For more information about the free hog slice, see Using the Free Hog Slice.
Create a new partition table by answering y when prompted to continue.
Do you wish to continue creating a new partition table based on above table[yes]? y |
Identify the free hog partition (slice) and the sizes of the slices when prompted.
When adding a system disk, you must set up slices for:
root (slice 0) and swap (slice 1)
/usr (slice 6)
After you identify the slices, the new partition table is displayed.
For an example of creating disk slices, see SPARC: Example—Creating Disk Slices and Labeling a System Disk.
Make the displayed partition table the current partition table by answering y when asked.
Okay to make this the current partition table[yes]? y |
If you do not want the current partition table and you want to change it, answer no and go to Step 6.
Name the partition table.
Enter table name (remember quotes): "partition-name" |
partition-name is the name for the new partition table.
Label the disk with the new partition table after you have finished allocating slices on the new disk.
Ready to label disk, continue? yes |
Quit the partition menu.
partition> q |
Verify the disk label.
format> verify |
Exit the format menu.
format> q |
The following example shows the format utility being used to divide a 1-Gbyte disk into three slices: one slice for the root (/) file system, one slice for the swap area, and one slice for the /usr file system.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): 0 selecting c0t1d0 [disk formatted] format> partition partition> print partition> modify Select partitioning base: 0. Current partition table (original) 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 - 2035 1002.09MB (2036/0/0) 2052288 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 Do you wish to continue creating a new partition table based on above table[yes]? yes Free Hog partition[6]? 6 Enter size of partition `0' [0b, 0c, 0.00mb]: 200mb Enter size of partition `1' [0b, 0c, 0.00mb]: 200mb Enter size of partition `3' [0b, 0c, 0.00mb]: Enter size of partition `4' [0b, 0c, 0.00mb]: Enter size of partition `6' [0b, 0c, 0.00mb]: Enter size of partition `7' [0b, 0c, 0.00mb]: Part Tag Flag Cylinders Size Blocks 0 root wm 0 - 406 200.32MB (407/0/0) 410256 1 swap wu 407 - 813 200.32MB (407/0/0) 410256 2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288 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 814 - 2035 601.45MB (1222/0/0) 1231776 7 unassigned wm 0 0 (0/0/0) 0 Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "disk0" Ready to label disk, continue? yes partition> quit format> verify format> quit |
The following example shows the format utility being used to divide a 1-Gbyte disk into one slice for the /export/home file system.
# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t1d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0 1. c0t3d0 <SUN1.05 cyl 2036 alt 2 hd 14 sec 72> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0 Specify disk (enter its number): 0 selecting c0t1d0 [disk formatted] format> partition partition> print partition> modify Select partitioning base: 0. Current partition table (original) 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 - 2035 1002.09MB (2036/0/0) 2052288 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 Do you wish to continue creating a new partition table based on above table[yes]? y Free Hog partition[6]? 7 Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 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]: 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 - 2035 1002.09MB (2036/0/0) 2052288 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 - 2035 1002.09MB (2036/0/0) 2052288 Okay to make this the current partition table[yes]? yes Enter table name (remember quotes): "home" Ready to label disk, continue? y partition> q format> verify format> q # |
The following example shows how to use the format utility to divide a 1.15 Tbyte disk with an EFI label into 3 slices.
# format . . . partition> modify Select partitioning base: 0. Current partition table (original) 1. All Free Hog Choose base (enter number) [0]? 1 Part Tag Flag First Sector Size Last Sector 0 unassigned wm 0 0 0 1 unassigned wm 0 0 0 2 unassigned wm 0 0 0 3 unassigned wm 0 0 0 4 unassigned wm 0 0 0 5 unassigned wm 0 0 0 6 usr wm 0 0 0 Do you wish to continue creating a new partition table based on above table[yes]? y Free Hog partition[6]? 4 Enter size of partition 0 [0b, 34e, 0mb, 0gb, 0tb]: Enter size of partition 1 [0b, 34e, 0mb, 0gb, 0tb]: Enter size of partition 2 [0b, 34e, 0mb, 0gb, 0tb]: 400gb Enter size of partition 3 [0b, 838860834e, 0mb, 0gb, 0tb]: 400gb Enter size of partition 5 [0b, 1677721634e, 0mb, 0gb, 0tb]: Enter size of partition 6 [0b, 1677721634e, 0mb, 0gb, 0tb]: Part Tag Flag First Sector Size Last Sector 0 unassigned wm 0 0 0 1 unassigned wm 0 0 0 2 usr wm 34 400.00GB 838860833 3 usr wm 838860834 400.00GB 1677721633 4 usr wm 1677721634 382.20GB 2479251421 5 unassigned wm 0 0 0 6 unassigned wm 0 0 0 Ready to label disk, continue? yes partition> q |
After you create disk slices and label the disk, you can create file systems on the disk. Go to SPARC: How to Create File Systems.