You are on page 1of 6

Formating and Partitioning

When to Use the format Utility

Disk drives are partitioned and labeled by the Solaris installation program when you install the
Solaris release. You can use the format utility to do the following:

 Display slice information

 Divide a disk into slices

 Add a disk drive to an existing system

 Format a disk drive

 Label a disk

 Repair a disk drive

 Analyze a disk for errors

Disk Labels
A special area of every disk is set aside for storing information about the disk's controller,
geometry, and slices. That information is called the disk's label. Another term that is used to
described the disk label is the VTOC (Volume Table of Contents) on a disk with a VTOC label.
To label a disk means to write slice information onto the disk. You usually label a disk after you
change its slices.

Partition Table

An important part of the disk label is the partition table, which identifies a disk's slices, the slice
boundaries (in cylinders), and the total size of the slices. You can display a disk's partition table
by using the format utility

Partition Table Terminology

Partition
Value Description
Term
Number 0-7 VTOC - Partitions or slices, numbered 0-7.

EFI - Partitions or slices, numbered 0-6.


Tag 0=UNASSIGNED 1=BOOT 2=ROOT A numeric value that usually describes the file
3=SWAP 4=USR 5=BACKUP
system mounted on this partition.
7=VAR 8=HOME 11=RESERVED
Flags wm The partition is writable and mountable.
  wu rm The partition is writable and unmountable. This is
the default state of partitions that are dedicated for
swap areas. (However, the mount command does not
check the "not mountable" flag.)
  rm The partition is read only and mountable.

The following is an example of a partition table from a 4.0-Gbyte disk with a VTOC label
displayed from the format utility:

#format

Enter 0

Enter Partition

Enter Print

Total disk cylinders available: 8892 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks


0 root wm 1110 - 4687 1.61GB (0/3578/0) 3381210
1 swap wu 0 - 1109 512.00MB (0/1110/0) 1048950
2 backup wm 0 - 8891 4.01GB (0/8892/0) 8402940
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 unassigned wm 0 0 (0/0/0) 0

7 home wm 4688 - 8891 1.89GB (0/4204/0) 3972780


Dividing a Disk Into Slices
The format utility is most often used by system administrators to divide a disk into slices. The
steps are as follows:

 Determining which slices are needed

 Determining the size of each slice

 Using the format utility to divide the disk into slices

 Labeling the disk with new slice information

 Creating the file system for each slice

How to Identify the Disks on a System

1. Become superuser or assume an equivalent role.

2. Identify the disks that are recognized on the system with the format utility.

# format

How to Determine if a Disk is Formatted

1. Become superuser or assume an equivalent role.

2. Invoke the format utility.

# format

3. Type the number of the disk that you want to check from the list displayed on your
screen.

Specify disk (enter its number): 0

4. Verify that the disk you chose is formatted by noting the following message.
[disk formatted]

How to Format a Disk

1. Become superuser or assume an equivalent role.

2. Invoke the format utility.

# format

3. Type the number of the disk that you want to format from the list displayed on your
screen.

Specify disk (enter its number): 0

4. Caution - Do not select the system disk. If you format your system disk, you delete
the operating system and any data on this disk.

5. To begin formatting the disk, type format at the format> prompt. Confirm the
command by typing y.

format> format
Ready to format. Formatting cannot be interrupted
and takes 23 minutes (estimated). Continue? yes

6. Verify that the disk format is successful by noting the following messages.

Beginning format. The current time Tue ABC xx xx:xx:xx xxxx

Formatting...
done

Verifying media...
pass 0 - pattern = 0xc6dec6de
2035/12/18

pass 1 - pattern = 0x6db6db6d


2035/12/18

Total of 0 defective blocks repaired.

Displaying Disk Slice Information

The following example displays slice information for disk with a VTOC label.
# format
Searching for disks...done
Specify disk (enter its number):1
Selecting c0t0d0
format> partition
partition> print
Current partition table (original):
Total disk cylinders available: 8892 + 2 (reserved cylinders)

Part Tag Flag Cylinders Size Blocks


0 root wm 1110 - 4687 1.61GB (0/3578/0) 3381210
1 swap wu 0 - 1109 512.00MB (0/1110/0) 1048950
2 backup wm 0 - 8891 4.01GB (0/8892/0) 8402940
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 unassigned wm 0 0 (0/0/0) 0
7 home wm 4688 - 8891 1.89GB (0/4204/0) 3972780
partition> q
format> q
#

Partitioning:

#format

Enter 0

Enter format>Partition

Enter Partition>Print

Select the slice number to partition partition>3(which is not labeled)

It asks Tag: help (select which is not used in the partition table)

It asks: enter

It asks cy (cylinders’ range) :( enter the below range which is specified in partition table)

It asks partition size: 1gb (example)

It asks lable: l

Enter y

Verify partition is created or not

Partition>print
Partition>q

Format>q

Create a new file system on raw disk

#newfs /dev/rdsk/c0d0s3

#mkdir slice3

Mount the new file system

#mount /dev/dsk/c0d0s3 /slice3

Make an entry for this new file system in vfstab to make this as permanent.

#vi /etc/vfstab

(Device to mount) (device to fsck) (mount point) (fs type) (fsck pass) (mount at boot) (mount options)

/dev/dsk/c0d0s3 /dev/rdsk/c0d0s3 slice3 ufs 2 yes -

Esc # :wq!( to save the changes)

You might also like