Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Managing Local Disk Devices in Solaris

News Solaris Recommended Links Disk and Filesystems Disk Partitions in Solaris  
UFS ZFS TMPFS NFS VxFS  
Mounting CdRom Performing Mounts Mount Options Mount tutorial    
Solaris Volume Manager (SVM) Solaris Volume Manager - Soft Partitioning Explained Raid Solaris snapshots mount Mount Options
   df du    Humor  Etc

Introduction

Upon completion of this module, you should be able to:

Introduction

A disk device has physical components and logical components. The physical components include disk platters and read/write heads. The logical components include disk slices, cylinders, tracks, and sectors.

A disk is physically composed of a series of flat, magnetically coated platters that are stacked on a spindle. The spindle turns while the read/write heads move as a single unit radially, reading and writing data on the platters.

A disk platter is divided into sectors, tracks, and cylinders. The number of sectors per track varies with the radius of a track on the platter. The outermost tracks are larger and can hold more sectors than the inner tracks. Note – Disks present a fixed number of sectors per track to the Solaris even though, physically, the number of sectors per track varies by track location. Because a disk spins continuously and the read/write heads move as a single unit, the most efficient seeking occurs when the sectors to be read from or written to are located in a single cylinder.

Disk Slices == Partitions

Disks are logically divided into individual partitions known as disk slices. Disk slices are groupings of cylinders that are commonly used to organize data by function. For example, one slice can store critical system files and programs while another slice on the same disk can store user-created files.

Note – Grouping cylinders into slices is done to organize data, facilitate backups, and provide swap space.

By convention, Slice 2 represents the entire disk. Slice 2 maintains important data about the entire disk, such as the size of the actual disk and the total number of cylinders available for the storage of files and directories.

A starting cylinder and an ending cylinder define each slice. These cylinder boundaries determine the size of a slice.

Slice Name Function

Disk Slice Naming Convention

An eight-character string typically represents the full name of a slice. The string includes the controller number, the target number, the disk number, and the slice number.

The embedded SCSI configuration and the integrated device electronics (IDE) configuration represent the disk slice naming conventions across two different architectures. The disk number is always set to d0 with SCSI disks.

c#t#d#s#

Controller number
Disk number
Target number
Slice number

A slice name is an eight-character string:

Introducing Solaris Device Naming Conventions

In the Solaris, all devices are represented by three different types of names, depending on how the device is being referenced:

Note – The Berkeley Software Distribution (BSD) device names exist in the Solaris if the BSD compatibility packages are installed with the Solaris Developer, Entire Distribution, or Entire Distribution Plus the original equipment manufacturer (OEM) Solaris software group. The BSD device names, for example /dev/sd0a, are typically used for backward compatibility with old scripts.

Logical Device Names

Logical disk device names are symbolic links to the physical device names kept in the /devices directory. Logical device names are used primarily to refer to a device when you are entering commands on the command line. All logical device names are kept in the /dev directory. The logical device names contain the controller number, target number, disk number, and slice number.

Every disk device has an entry in both the /dev/dsk and /dev/rdsk directories for the block and character disk devices, respectively.

To display the entries in the /dev/dsk directory, perform the command: # ls /dev/dsk

c0t0d0s0 c0t0d0s4 c0t3d0s0 c0t3d0s4 c0t6d0s0 c0t6d0s4

c0t0d0s1 c0t0d0s5 c0t3d0s1 c0t3d0s5 c0t6d0s1 c0t6d0s5

c0t0d0s2 c0t0d0s6 c0t3d0s2 c0t3d0s6 c0t6d0s2 c0t6d0s6

c0t0d0s3 c0t0d0s7 c0t3d0s3 c0t3d0s7 c0t6d0s3 c0t6d0s7

Physical Device Names

Physical device names uniquely identify the physical location of the hardware devices on the system and are maintained in the /devices directory.

A physical device name contains the hardware information, represented as a series of node names, separated by slashes, that indicate the path to the device. To display a physical device name, perform the command:

# ls -l /dev/dsk/c0t0d0s0

lrwxrwxrwx 1 root root 46 Jun 16 19:07 /dev/dsk/c0t0d0s0 ->

../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a

Note – Various hardware platforms have different device trees. The top-most directory in the hierarchy is called the root node of the device tree. The bus nexus nodes and the leaf nodes below the root object have device drivers associated with them.

A device driver is the software that communicates with the device. This software must be available to the kernel so that the system can use the device.

During system initialization, the kernel identifies the physical location of a device. The kernel associates a node with an address, nodename@address, which is the physical device name.

For example, dad@0 is the direct access disk device at address 0.

Instance Names

Instance names are abbreviated names (aliases) assigned by the kernel for each device on the system. An instance name is a shortened name for the physical device name.

For SCSI disk devices they have the format sdn, for example sd0 is the first SCSI disk device.

for IDE devices they have format dadn,where dad (direct access device) is the disk name and nis the number, such as dad0 for the first IDE drive.

Listing a System’s Devices

In the Solaris, there are several ways to list a system’s devices, including:

The /etc/path_to_inst File

For each device, the system records its physical name and instance name in the /etc/path_to_inst file. These names are used by the kernel to identify every possible device. This file is read only at boot time. The /etc/path_to_inst file is maintained by the kernel, and it is generally not necessary, nor is it advisable, for the system administrator to change this file.

The following example shows entries in the /etc/path_to_inst file. The text within the parentheses indicates what device is referred to by the entry and does not appear in the actual file.

# more /etc/path_to_inst

## Caution! This file contains critical kernel state

(output edited for clarity)

"/pci@1f,0" 0 "pcipsy" (PCI bus controller, "psycho" chip)

"/pci@1f,0/pci@1,1" 0 "simba" (PCI bus B)

"/pci@1f,0/pci@1,1/ebus@1" 0 "ebus" (extended bus)

"/pci@1f,0/pci@1,1/ebus@1/power@14,724000" 0 "power" (power management bus)

"/pci@1f,0/pci@1,1/ebus@1/fdthree@14,3023f0" 0 "fd" (floppy disk)

"/pci@1f,0/pci@1,1/ebus@1/SUNW,CS4231@14,200000" 0 "audiocs" (crystal semiconductor)

"/pci@1f,0/pci@1,1/ebus@1/su@14,3062f8" 1 "su" (mouse)

"/pci@1f,0/pci@1,1/ebus@1/se@14,400000" 0 "se" (serial ports A and B)

"/pci@1f,0/pci@1,1/ebus@1/su@14,3083f8" 0 "su" (keyboard)

"/pci@1f,0/pci@1,1/ebus@1/ecpp@14,3043bc" 0 "ecpp" (extended capability parallel

port)

"/pci@1f,0/pci@1,1/ide@3" 0 "uata" (ATA controller)

"/pci@1f,0/pci@1,1/ide@3/sd@2,0" 0 "sd" (CD-ROM)

"/pci@1f,0/pci@1,1/ide@3/dad@0,0" 0 "dad" (hard disk)

"/pci@1f,0/pci@1,1/network@1,1" 0 "hme" (Fast Ethernet)

"/pci@1f,0/pci@1,1/SUNW,m64B@2" 0 "m64" (color memory frame buffer)

"/pci@1f,0/pci@1" 1 "simba" (pci bus A controller)

"/options" 0 "options"

"/scsi_vhci" 0 "scsi_vhci"

"/pseudo" 0 "pseudo"

Here is more eleborate list from an old E450 system

# cat /etc/path_to_inst
#
#       Caution! This file contains critical kernel state
#
"/options" 0 "options"
"/pci@1f,4000" 0 "pcipsy"
"/pci@1f,4000/scsi@3" 0 "glm"
"/pci@1f,4000/scsi@3/sd@0,0" 15 "sd"
"/pci@1f,4000/scsi@3/sd@1,0" 16 "sd"
"/pci@1f,4000/scsi@3/sd@2,0" 17 "sd"
"/pci@1f,4000/scsi@3/sd@3,0" 18 "sd"
"/pci@1f,4000/scsi@3/sd@4,0" 19 "sd"
... ... ... 

The device instance number, shown in the preceding example, appears to the left of the device instance name when recorded in this file.

Note – Different systems have different physical device paths. The preceding example shows an on-board peripheral component interconnect (PCI) bus configuration.

The following is a /etc/path_to_inst file from a system that has a different bus architecture. In this case, it is an example of a system that has an on-board Sun System bus (SBus).

# more /etc/path_to_inst

# Caution! This file contains critical kernel state

#"/sbus@1f,0" 0 "sbus"

"/sbus@1f,0/espdma@e,8400000" 0 "dma"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000" 0 "esp"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@3,0" 3 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@2,0" 2 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@1,0" 1 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@0,0" 0 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@6,0" 6 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@5,0" 5 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/sd@4,0" 4 "sd"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@3,0" 3 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@2,0" 2 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@1,0" 1 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@0,0" 0 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@6,0" 6 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@5,0" 5 "st"

"/sbus@1f,0/espdma@e,8400000/esp@e,8800000/st@4,0" 4 "st"

... < remaining lines removed > ...

The prtconf Command

Use the prtconf command to display the system’s configuration information, including the total amount of memory installed and the configuration of system peripherals, which is formatted as a device tree. The prtconf command lists all possible instances of devices, whether the device is attached or not attached to the system. To view a list of only attached devices on the system, perform the command:

# prtconf | grep -v not

Note – The grep -v not command is used to omit all lines containing the word " not" from the output (such as driver not attached).

The format Command

Use the format command to display both logical and physical device names for all currently available disks. To view the logical and physical devices for currently available disks, perform the command:

# format

Searching for disks...done

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>

/pci@1f,0/pci@1,1/ide@e/dad@0,0

1. c1t0d0 <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>

/pci@if,0/pci@1/SUNW,isptwo@4/sd@3,0

Specify disk (enter its number):

Note – Press Control-D to exit the format command.

Reconfiguring Devices

The system recognizes a newly added peripheral device if:

Reconfiguring Devices

To reconfiger devices the command devfsadm -i is usually used. The following examples use the -i option:

To print the changes made by the devfsadm command to the /dev and /devices directories, perform the command:

# devfsadm -v

To invoke cleanup routines that remove unreferenced symbolic links for

devices, perform the command:

# devfsadm -C

Exercise: Configuring and Naming Devices (Level 3)

In this exercise, you complete the following tasks:

This exercise requires a system that is configured with an external disk or tape drive. During system boot, this external disk must remain powered off to avoid creating links and device files.

Task Summary

Complete the following tasks:

Task 1 – Identifying Device Files

Complete the following steps:

  1. Log in as the root user, and open a terminal window. Expand the window so that it occupies the entire screen area. Change to the /dev/dsk directory.
  2. List the files in this directory. Identify the files related to the boot disk of your system. Most systems use c0t0d0. Locate the item related to Slice 0 on this disk, and display a long listing of it.

    # ls

    # ls -l c0t0d0s0

    Which type of file did you just locate? The file type indicator is the first character on the left side of the long listing. Files in this directory are symbolic links. The letter l in the left-most column identifies a symbolic link.

    Record the full path name to which this file points.

    Systems that use PCI bus architectures list path names similar to the following:

    ../../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a

  3. Highlight the path name you recorded in Step 2 by double-clicking the path name. Copy and paste this path name into a long listing command. If you are not using the CDE, you need to type the path name.

    # ls -l pathname

    Which type of file is this?

    Files in this directory are device files. The b character in the left-most column identifies a block-special device file.

    The command ls -lL c0t0d0s0 displays the same information but shows only the link file name, not the real device file name.

  4. Change to the /dev/rdsk directory. Display a long listing of the same file name you selected in Step 2.

    # cd /dev/rdsk

    # ls -l c0t0d0s0

    Which type of file is this?

    Files in this directory are symbolic links. The letter l in the left-most column identifies a symbolic link.

    Record the full path name to which this file points.

    Systems that use PCI bus architectures list path names similar to the following:

    ./../devices/pci@1f,0/pci@1,1/ide@3/dad@0,0:a,raw

  5. Highlight the path name you recorded in Step 4. Use the Copy and Paste keys to copy and paste this path name into a long listing command. If you are not using CDE, you need to type in the path name.

    # ls -l pathname

    Which type of file is this?

    Files in this directory are device files. The c character in the left-most column identifies a character-special device file.

    The ls -lL c0t0d0s0 command displays the same information but shows only the link file name, not the real device file name.

  6. Change to the /etc directory. Display the contents of the

    path_to_inst file.

    # cd /etc

    # more path_to_inst

  7. Use the information from the previous steps to locate and record the

    entry for your boot disk. An Ultra 5 workstation, for example, would

    use c0t0d0 as its boot disk. This relates to the device file called

    dad@0,0 and is listed in the /etc/path_to_inst directory.

    Systems that use PCI bus architectures list path names similar to the

    following:

    /pci@1f,0/pci@1,1/ide@3/dad@0,0

    The instance name is composed of the dad or sd tag and the number that precedes it in the /etc/path_to_inst file. What is the instance name for the device listed in this step?

    dad0, sd3, or sd0, depending on the system architecture.

Task 2 – Adding a New Disk or Tape Device

Complete the following steps:

1. In the /dev/dsk and /dev/rdsk directories, confirm that no files exist for your external disk or device, for example, /dev/dsk/c1t0d0s0 or /dev/rmt/0.

2. Shut down your system to run state 0.

# init 0

3. Power on the external disk or tape drive attached to your system.

4. Boot the system to its default run state.

ok boot

5. Log in as the root user, and open a terminal window. Run the devfsadm command with the -v option to create new links and device files for the new disk or tape drive. Observe the messages that the devfsadm command displays.

# devfsadm -v

6. Confirm that new links and device files exist in the /dev/dsk and /dev/rdsk directories for disks or /dev/rmt for tape drives.

Partitioning the Hard Disk

The format utility is a system administration tool used primarily to prepare hard disk drives for use in the Solaris. Although the format utility also performs a variety of disk-management activities, the main function of the format utility is to divide a disk into disk slices.

Note – You do not need to partition the disk before you install the Solaris.

Introducing the Fundamentals of Disk Partitioning

Only the root user can use the format utility. If a regular user runs the format utility, the following error message appears. To divide a disk into partitions(slices):

  1. Identify the correct disk.

  2. Plan the layout of the disk.

  3. Use the format utility to divide the disk into slices.

  4. Label (write partition to the disk) the disk with new slice information.

Disk slices are defined by an offset and a size in cylinders. The offset is the distance from Cylinder 0. There are two common problems with the disk allocation:

partition> modify

Select partitioning base:

0. Current partition table (unnamed)

1. All Free Hog

Choose base (enter number) [0]? 0

Warning: Overlapping partition (1) in table.

Warning: Fix, or select a different partition table.

Caution – Do not change the size of disk slices that are currently in use.

Caution – When a disk with existing slices is repartitioned and relabeled, any existing data can become inaccessible. Copy existing data to backup media before the disk is repartitioned, and restore the data to the disk after the disk is relabeled and contains a new filesystem.

Introducing Disk Partition Tables

As the root user, when you use the format utility and select a disk to partition, a copy of the disk’s partition table is read from the label on the disk into memory and is displayed as the current disk partition table.

The format utility can also works with a file called /etc/format.dat, which is read when you invoke the format utility.

The /etc/format.dat file is a table of available disk types and a set of predefined partition tables that you can use to partition a disk quickly.

Introducing Disk Labels

The disk’s label is the area set aside for storing information about the disk’s controller, geometry, and slices. Another term used to describe a disk label is the volume table of contents (VTOC). The disk’s label or VTOC is stored on the first sector of the disk (MBR in DOS terms).

To label a disk means to write slice information onto the disk. If you fail to label a disk after defining slices, the slice information is lost. 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.

Note – The terms disk slice and disk partition are interchangeable.

Using the format Command

The format utility is organized into two tiers of commands. When you type format on the command line, the first tier of commands appears. This set of commands allow you to, among other functions, select a disk, select a partition, save new disk and partition definitions, and write the label to the disk. The top tier of commands is denoted by the format> prompt.

The second tier of commands appears when you type partition from the format> prompt. This set of commands allow you to, among other functions, define the characteristics of the individual slices, print the existing partition table, and write the partition map and label to the disk.

Part The slice number. Valid slice numbers are 0 through 7. Tag A value that indicates how the slice is being used.

0 = unassigned

1 = boot

2 = root

3 = swap

4 = usr

5 = backup

6 = stand

8 = home

Sun StorEdge™ Volume Manager array tags:

14 = public (region)

15 = private (region)

Flag 00 wm = The disk slice is writable and mountable.

01 wu = The disk slice is writable and unmountable. This is the default state

of slices dedicated for swap areas.

10 rm = The disk slice is read-only and mountable.

11 ru = The disk slice is read-only and unmountable.

Cylinders The starting and ending cylinder number for the disk slice.

Size The slice size: Mbytes ( MB), Gbytes ( GB), blocks ( b), or cylinders ( c).

Blocks The total number of cylinders and the total number of sectors per slice.

Partitioning a Disk

Caution – Do not change the size of disk slices that are currently in use. The following steps demonstrate how to divide a disk into slices:

1. As the root user, type format at the prompt, and press Return.

# format

Searching for disks...done

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <ST34321A cyl 8892 alt 2 hd 15 sec 63>

/pci@1f,0/pci@1,1/ide@3/dad@0,0

1. c1t0d0 <SUN1.3G cyl 1965 alt 2 hd 17 sec 80>

/pci@1f,0/pci@1/scsi@1/sd@0,0

Specify disk (enter its number):

The format utility searches for all attached disks that are powered on. For each disk it finds, the format utility displays the logical device name, Sun marketing name, physical parameters, and physical device name.

2. Choose the second disk by selecting the number located to the left of that disk’s logical device name. From the preceding display, the number chosen is 1. The format utility’s main menu appears.

Specify disk (enter its number): 1

selecting c1t0d0

[disk formatted]

FORMAT MENU:

disk - select a disk

type - select (define) a disk type

partition - select (define) a partition table

current - describe the current disk

format - format and analyze the disk

repair - repair a defective sector

label - write label to the disk

analyze - surface analysis

defect - defect list management

backup - search for backup labels

verify - read and display labels

save - save new disk/partition definitions

inquiry - show vendor, product and revision

volname - set 8-character volume name

!<cmd> - execute <cmd>, then return

quit

format>

The specific menu selections that you can use to view, change, or commit disk slices include the following:

3. Type partition at the format prompt. The Partition menu appears.

format> partition

PARTITION MENU:

0 - change ‘0’ partition

1 - change ‘1’ partition

2 - change ‘2’ partition

3 - change ‘3’ partition

4 - change ‘4’ partition

5 - change ‘5’ partition

6 - change ‘6’ partition

7 - change ‘7’ partition

select - select a predefined table

modify - modify a predefined partition table

name - name the current table

print - display the current table

label - write partition map and label to the disk

!<cmd> - execute <cmd>, then return

quit

partition Displays the Partition menu

label Writes the current partition definition to the disk

label

verify Reads and displays the disk label

quit Exits the format utility

The Partition menu enables you to perform the following functions:

4. Type print at the partition prompt to display the disk label that was copied to random access memory (RAM) when the format utility was invoked.

partition> print

Current partition table (unnamed):
Total disk cylinders available: 1965 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 0 (0/0/0) 0

1 unassigned wm 0 0 (0/0/0) 0

2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400

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 wu 0 0 (0/0/0) 0

7 unassigned wm 0 0 (0/0/0) 0

The name of the partition table appears in parentheses in the first line of the table.

0–7 Specify the offset and size of up to eight slices select Choose a predefined partition table from the /etc/format.dat file modify Change the current partition table in memory name Provide a means to identify the partition table in the /etc/format.dat file print Display the current partition table in memory label Write the current partition table to the disk label !<cmd> Escape from the utility and execute a command from the shell The columns of the table have the following meanings:

5. Select Slice 0 (zero) by entering 0.

partition> 0

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 0 (0/0/0) 0

6. When prompted for the ID tag, type a question mark ( ?), and press Return to list the available choices. You can change a tag by entering a new tag name.

Enter partition id tag[unassigned]: ?

Expecting one of the following: (abbreviations ok):

unassigned boot root swap

usr backup stand var

home alternates

Enter partition id tag[unassigned]:

7. Type the tag alternates, and press Return. Enter partition id tag[unassigned]: alternates

8. When prompted for the permission flags, type a question mark ( ?), and press Return to list the available choices. You can change a flag by entering the new flag name.

Enter partition permission flags[wm]: ?

Expecting one of the following: (abbreviations ok):

wm - read-write, mountable

wu - read-write, unmountable

rm - read-only, mountable

ru - read-only, unmountable

Enter partition permission flags[wm]:

Part The disk slice number

Tag The predefined, optional tag

Flag The predefined, optional flag

Cylinders The starting and ending cylinder number for the slice

Size The slice size in blocks ( b), cylinders (c), Mbytes ( MB),

or Gbytes (GB)

Blocks The total number of cylinders and the total number of

sectors per slice

9. Press Return to accept the default flag.

10. Press Return to accept the starting cylinder of 0 (zero).

11. Enter 400mb for the new partition size for Slice 0.

12. Type print, and press Return. The Partition table appears.

partition> print

Current partition table (unnamed):

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

Part Tag Flag Cylinders Size Blocks

0 alternates wm 0 - 602 400.43MB (603/0/0) 820080

1 unassigned wm 0 0 (0/0/0) 0

2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400

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 wu 0 0 (0/0/0) 0

7 unassigned wm 0 0 (0/0/0) 0

The current partition table shows the change to Slice 0. Now adjust the starting cylinder for Slice 1.

13. Select slice number 1 by typing 1. partition> 1

Part Tag Flag Cylinders Size Blocks

1 unassigned wm 0 0 (0/0/0) 0

14. Type the tag swap, and press Return. Enter partition id tag[unassigned]: swap

15. Type wu at the permission flags selection, and press Return. Enter partition permission flags[wm]: wu

16. Enter the new starting cylinder for Slice 1. Enter new starting cyl[0]: 603

17. Enter the new partition size for Slice 1. Enter partition size[0b, 0c, 603e, 0.00mb, 0.00gb]: 60mb

18. Type print, and press Return.

partition> print

Current partition table (unnamed):

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

Part Tag Flag Cylinders Size Blocks

0 alternates wm 0 - 602 400.43MB (603/0/0) 820080

1 swap wm 603 - 693 60.43MB (91/0/0) 123760

2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400

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 wu 0 0 (0/0/0) 0

7 unassigned wm 0 0 (0/0/0) 0

The current partition table shows the change to Slice 1. The new starting cylinder for Slice 1 is one greater than the ending cylinder for Slice 0. Now adjust the starting cylinder for Slice 7.

19. Type 7 to select Slice 7.

partition> 7

Part Tag Flag Cylinders Size Blocks

7 unassigned wm 0 0 (0/0/0) 0

20. Type the tag home, and press Return. Enter partition id tag[unassigned]: home

21. Press Return to select the default flag. Enter partition permission flags[wm]: <return>

22. Type the new starting cylinder for Slice 7. Enter new starting cyl[0]: 694

23. Type the new partition size for Slice 7 by typing a dollar ( $) sign.

Enter partition size[0b, 0c, 694e, 0.00mb, 0.00gb]: $

partition>

Note – Enter a dollar ( $) sign as a value for the last partition size to automatically assign the remaining space on the disk to this slice.

Partitioning the Hard Disk

Managing Local Disk Devices 2-43

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

24. Type print to display the partition table.

partition> print

Current partition table (unnamed):

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

Part Tag Flag Cylinders Size Blocks

0 alternates wm 0 - 602 400.43MB (603/0/0) 820080

1 swap wm 603 - 693 60.43MB (91/0/0) 123760

2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400

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 wu 0 0 (0/0/0) 0

7 home wm 694 - 1964 844.02MB (1271/0/0) 1728560

Add up the cylinders in the Blocks column for Slice 0, Slice 1, and

Slice 7. The number should equal the total number of cylinders

contained in Slice 2.

25. After checking the partition table to ensure that there are no errors,

label the disk by typing label.

partition> label

Ready to label disk, continue? y

partition>

Saving a Partition Table to the /etc/format.dat File

Use this optional procedure to add the newly created partition table to the

/etc/format.dat file. You can save customized partition tables to the

/etc/format.dat file and use them to quickly partition other disks of the

same type on the system.

Note – Remember that, by default, the system saves the new partition

information to the ./format.dat file.You must enter the full path of the

/etc/format.dat file to update the proper file.

Partitioning the Hard Disk

2-44 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

To save a customized partition table, display the Partition menu and

perform the following steps:

1. Type name to enter a unique name for the current partition table.

Frequently, the disk manufacturer’s name is used.

partition> name

Enter table name (remember quotes): SUN1.3G

Note – Quotes are only required if the partition table name is more than

one word, for example, " SUN1.3G Generic."

2. Exit the Partition menu.

partition> quit

3. Type save to save the new partition table information, and enter the

full path name for the /etc/format.dat file.

format> save

Saving new partition definition

Enter file name["./format.dat"]: /etc/format.dat

Using the Customized Partition Table

To retrieve a customized partition table, display the format menu and

perform the following steps:

1. Type partition.

format> partition

2. Type select to display a list of customized partition tables, and

choose the desired table by entering its assigned number.

partition> select

0. SUN1.3G

1. original

2. SUN4.2

Specify table (enter its number)[3]: 0

3. Label the disk with the selected partition table.

partition> label

Ready to label disk, continue? yes

Partitioning the Hard Disk

Managing Local Disk Devices 2-45

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

4. Exit the Partition menu.

partition> quit

5. Read the new disk label.

format> verify

Primary label contents:

Volume name = < >

ascii name = <SUN1.3G cyl 1965 alt 2 hd 17 sec 80>

pcyl = 3500

ncyl = 1965

acyl = 2

nhead = 17

nsect = 80

Part Tag Flag Cylinders Size Blocks

0 alternates wm 0 - 602 400.43MB (603/0/0) 820080

1 swap wm 603 - 693 60.43MB (91/0/0) 123760

2 backup wu 0 - 1964 1.27GB (1965/0/0) 2672400

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 wu 0 0 (0/0/0) 0

7 home wm 694 - 1964 844.02MB (1271/0/0) 1728560

6. Exit the format utility.

format> quit

Managing Disk Labels

2-46 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Managing Disk Labels

Every disk in the Solaris has a label set aside for storing information

about the disk’s controller, geometry, and slices.

Viewing the Disk VTOC

You can use two methods for locating and viewing a disk’s label or

VTOC:

l Use the verify command from the format utility

l Invoke the prtvtoc command from the command line

Reading a Disk’s VTOC Using the verifyCommand

The verify command enables you to view a disk’s VTOC from within the

format utility. To read a disk’s VTOC, perform the following steps:

1. At the format prompt, enter the verify command, and press

Return.

format> verify

Primary label contents:

Volume name = < >

ascii name = <SUN1.3G cyl 1965 alt 2 hd 17 sec 80>

pcyl = 3500

ncyl = 1965

acyl = 2

nhead = 17

nsect = 80

Part Tag Flag Cylinders Size Blocks

0 root wm 0 - 602 400.43MB (603/0/0) 820080

1 swap wm 603 - 693 60.43MB (91/0/0) 123760

2 backup wm 0 - 1964 1.27GB (1965/0/0) 2672400

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 694 - 1964 844.02MB (1271/0/0) 1728560

2. Type quit or q, and press Return to exit the format menu.

Managing Disk Labels

Managing Local Disk Devices 2-47

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Reading a Disk’s VTOC Using the prtvtocCommand

The prtvtoc command enables you to view a disk’s VTOC from the

command line. To view a disk’s VTOC from the command line, type the

following:

# prtvtoc /dev/rdsk/c1t0d0s2

* /dev/rdsk/c1t0d0s2 partition map

*

* Dimensions:

* 512 bytes/sector

* 80 sectors/track

* 17 tracks/cylinder

* 1360 sectors/cylinder

* 3500 cylinders

* 1965 accessible cylinders

*

* Flags:

* 1: unmountable

* 10: read-only

*

* First Sector Last

* Partition Tag Flags Sector Count Sector Mount Directory

0 2 00 0 820080 820079

1 3 00 820080 123760 943839

2 5 00 0 2672400 2672399

7 8 00 943840 1728560 2672399

The disk label information includes the following fields:

Dimensions Describes the logical dimensions of the disk.

Flags Describes the flags that are listed in the partition

table.

Partition A slice number. It is described further in

Table 2-2 on page 2-36.

Tag A value used to indicate how the slice is being

used. It is described further in Table 2-2 on page

2-36.

Flags The 00 flag is read/write, mountable; 01 is

read/write, unmountable; and 10 is read only.

These are described further in Table 2-2 on page

2-36.

First Sector Defines the first sector of the slice.

Managing Disk Labels

2-48 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Relabeling a Disk

Save a disk’s VTOC to a file by using the prtvtoc command. This allows

you to relabel the disk by using the fmthard command if one of the

following situations occurs:

l The VTOC on the disk has been destroyed.

l You accidentally changed the partition information on the disk and

did not save a backup label in the /etc/format.dat file.

To save a disk’s VTOC to a file, perform the command:

# prtvtoc /dev/rdsk/c1t0d0s2 > /vtoc/c1t0d0

The fmthard Command

To relabel a disk, you can save the output of the prtvtoc command into a

file on another disk and use it as the datafile argument to the fmthard

command.

fmthard -s datafile /dev/rdsk/c #t #d #s2

Caution – The fmthard command cannot write a disk label on an

unlabeled disk. Use the format utility for this purpose.

If the need to relabel a disk arises and the VTOC was previously saved to

a file, the following options are available:

l Run format, select the disk, and label it with the default partition

table.

l Use the fmthard command to write the desired label information,

previously saved to a datafileback to the disk.

# fmthard -s /vtoc/c1t0d0 /dev/rdsk/c1t0d0s2

Sector Count Defines the total number of sectors in the slice.

Last Sector Defines the last sector number in the slice.

Mount Directory If the field is empty, the slice is currently not

mounted and no entry exists in the /etc/vfstab

file.

Performing the Exercises

Managing Local Disk Devices 2-49

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Performing the Exercises

You have the option to complete any one of three versions of a lab. To

decide which to choose, consult the following descriptions of the levels:

l Level 1 – This version of the lab provides the least amount of

guidance. Each bulleted paragraph provides a task description, but

you must determine your own way of accomplishing each task.

l Level 2 – This version of the lab is more difficult. Although each step

describes what you should do, you must determine which

commands (and options) to input.

l Level 3 – This version of the lab is the easiest to accomplish because

each step provides exactly what you should input to the system. This

level also includes the task solutions for all three levels.

Exercise: Working With Disks and Partitions (Level 1)

2-50 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Exercise:Working With Disks and Partitions (Level 1)

In this exercise, you complete the following tasks:

l Use the format utility to partition a disk

l Use the prtvtoc and fmthard commands to repair a corrupted

disk label

Preparation

This exercise requires a system configured with an external disk.

Tasks

Complete the following tasks:

l Use the format command to list the disks currently attached to your

system. Use the prtvtoc command to identify a disk that does not

currently hold any mounted file systems. Examine the information

that the prtvtoc command displays. Record the name of a disk that

has no mount directory listed.

(Steps 1–4 in the Level 2 lab)

l Use the format command to divide the unused disk into four slices

of equal size. Use Slices 0, 1, 3, and 4. Set all other slices to size 0.

Manually change the size of Slice 0 so that it ends 25 Mbytes into the

space assigned to Slice 1.

(Steps 4–11 in the Level 2 lab)

Exercise: Working With Disks and Partitions (Level 1)

Managing Local Disk Devices 2-51

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

l Attempt to correct the overlap by using the Modify menu. Record

the message that appears. Then correct the overlap by using the all

free hog option. Verify your disk label with the prtvtoc command.

(Steps 12–18 in the Level 2 lab)

l Create a directory called /vtoc. Run the prtvtoc command to read

the label of the disk you modified, and save its output in a file in the

/vtoc directory. Use the dd command from Step 21 of the Level 2 lab

to destroy the label on the same disk. Attempt to read the disk label

by using the prtvtoc command, and record the result. If required,

use the format command to write a default label to the disk. Use the

fmthard command to restore the label by using the output from the

prtvtoc command that you saved earlier. Verify that the new label

exists.

(Steps 19–25 in the Level 2 lab)

Exercise: Working With Disks and Partitions (Level 2)

2-52 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Exercise:Working With Disks and Partitions (Level 2)

In this exercise, you complete the following tasks:

l Use the format utility to partition a disk

l Use the prtvtoc and fmthard commands to repair a corrupted disk

label

Preparation

This exercise requires a system configured with an external disk.

Task Summary

In this exercise, you accomplish the following:

l Use the format command to list the disks currently attached to your

system. Use the prtvtoc command to identify a disk that does not

currently hold any mounted file systems. Examine the Mount

Directory field in the information that the prtvtoc command

displays. Record the name of a disk that has no mount directory

listed.

l Use the format command to divide the unused disk into four slices

of equal size. Use Slices 0, 1, 3, and 4. Set all other slices to size 0.

Manually change the size of Slice 0 so that it ends 25 Mbytes into the

space assigned to Slice 1.

l Attempt to correct the overlap by using Option 0 from the Modify

menu. Record the message that appears. Then correct the overlap by

using the all free hog option. Verify your disk label with the

prtvtoc command.

l Create a directory called /vtoc. Run the prtvtoc command to read

the label of the disk you modified, and save its output in a file in the

/vtoc directory. Use the dd command to destroy the label on the

same disk. Attempt to read the disk label by using the prtvtoc

command, and record the result. If required, use the format

command to write a default label to the disk. Use the fmthard

command to restore the label by using the output from the prtvtoc

command that you saved earlier. Verify that the new label exists.

Exercise: Working With Disks and Partitions (Level 2)

Managing Local Disk Devices 2-53

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Tasks

Complete the following steps:

1. Log in as the root user, and open a terminal window. Run the

format command.

2. Record the list of disks presented by the format command, for example, c0t0d0 and c1t0d0.

Press the Control-D keys to exit the format utility.

3. Use the prtvtoc command to list the VTOC for each of the disks

that you found in the previous step. Examine the Mount Directory

field in the information that the prtvtoc command displays. Record

the name of a disk that has no mount directory listed. This is an

unused disk.

4. Run the format command again. Select the unused disk from the list

of disks presented.

5. Display the Partition menu. Print the current partition table, and

record the number of megabytes assigned to Slice 2. For example, if

the disk reports 4 Gbytes, record 4000 Mbytes.

Mbytes:

6. Divide the number of megabytes by 4. Use the result as the number

of megabytes to assign as disk space to four slices. Round down to

the next whole megabyte if the result includes a fraction.

Mbytes/4:

7. Display the Partition menu again. Select Slice 0. Accept the defaults

for tags and flags. Start this first slice on Cylinder 0. Enter the

resulting number of megabytes from the previous step for the slice

size. Print the partition table again to verify the change.

8. Set the sizes of Slices 1, 3, and 4 so that they are the same as Slice 0.

Begin each successive slice on the cylinder that follows the ending

cylinder of the previous slice.

9. Set Slices 5, 6, and 7 to start at Cylinder 0, and assign them 0 Mbytes.

10. Print the partition table. Is there any overlap of ending and

beginning cylinders for any of the slices listed? Proceed to the

following steps to introduce this problem.

Exercise: Working With Disks and Partitions (Level 2)

2-54 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

11. Add 25 to the number Mbytes/4 value listed in Step 6.

(Mbytes/4) + 25:

Change Slice 0 so that it uses the new size listed above.

The partition table should now indicate that Slice 0 ends after Slice 1

begins.

12. Use the modify command from the Partition menu to attempt to fix

this problem. Select Item 0 to modify the current partition table.

Which warnings appear?

13. Modify the partition table. Select Item 1 to use the All Free Hog

method.

14. The partition table appears. Observe the Cylinders and Size columns,

and notice that they are all zero.

15. Respond to the prompts to continue the process. Select Slice 4 as the

All Free Hog slice. Use the size listed in Step 6 for Slices 0, 1, and

3. Set the other slices to Size 0.

At the end of this process, you should have three slices of equal size,

where Slice 4 takes up any extra room if it exists.

16. Name the partition table SA239Partition. Quit the Partition

menu.

17. Label and save your new partition table to the /etc/format.dat

file. Carefully read the message that is displayed by the format

utility, and enter the correct file name. Quit the format utility when

you have finished. Use the cat command to view the contents of the

/etc/format.dat file. Note that your information is appended to

the file.

18. Verify your new partition table with the prtvtoc command.

19. Create a directory called /vtoc.

20. Use the prtvtoc command to print the partition table that you just

created, and save its output to a file in the /vtoc directory. Name the

file so that it corresponds with the disk you are examining. Use the

cat command to verify that valid information exists in the file that

you create.

Exercise: Working With Disks and Partitions (Level 2)

Managing Local Disk Devices 2-55

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

21. Use the following dd command to destroy the disk label. Be certain

to specify the correct disk device name for the of= argument. Enter

all other arguments exactly as listed.

# dd if=/dev/zero of=/dev/rdsk/c1t0d0s2 bs=512 count=1

1+0 records in

1+0 records out

#

22. Attempt to read the label from the same disk by using the prtvtoc

command.

What happens?

23. If the prtvtoc command reported an "Unable to read Disk

geometry" message, use the format command to place a default

label on the disk for which you destroyed the label earlier.

If the prtvtoc command reports that only Slice 2 exists on the disk,

skip to the next step. Otherwise, perform the commands:

# format

Searching for disks...done

c1t0d0: configured with capacity of 4.00GB

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <Seagate Medalist 34342A cyl 8892 alt 2 hd 15 sec 63>

/pci@1f,0/pci@1,1/ide@3/dad@0,0

1. c1t0d0 <SUN4.2G cyl 3880 alt 2 hd 16 sec 135>

/pci@1f,0/pci@1/pci@2/SUNW,isptwo@4/sd@3,0

Specify disk (enter its number): 1

selecting c1t0d0

[disk formatted]

Disk not labeled. Label it now? Y

(format menu)

format> q

#

# prtvtoc /dev/rdsk/c1t0d0s2

Exercise: Working With Disks and Partitions (Level 2)

2-56 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

24. Use the fmthard command to write to the disk the label information

you saved earlier.

25. Attempt to read the label from the same disk.

Was this successful?

Exercise: Working With Disks and Partitions (Level 3)

Managing Local Disk Devices 2-57

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

Exercise:Working With Disks and Partitions (Level 3)

In this exercise, you complete the following tasks:

l Use the format utility to partition a disk

l Us the prtvtoc and fmthard commands to repair a corrupted disk

label

Preparation

This exercise requires a system configured with an external disk.

Task Summary

In this exercise, you accomplish the following:

l Use the format command to list the disks currently attached to your

system. Use the prtvtoc command to identify a disk that does not

currently hold any mounted file systems. Examine the Mount

Directory field in the information that the prtvtoc command

displays. Record the name of a disk that has no mount directory

listed.

l Use the format command to divide the unused disk into four slices

of equal size. Use Slices 0, 1, 3, and 4. Set all other slices to size 0.

Manually change the size of Slice 0 so that it ends 25 Mbytes into the

space assigned to Slice 1.

l Attempt to correct the overlap using Option 0 from the Modify

menu. Record the message that appears. Then correct the overlap by

using the all free hog partition. Verify your disk label with the

prtvtoc command.

l Create a directory called /vtoc. Run the prtvtoc command to read

the label of the disk you modified, and save its output in a file in the

/vtoc directory. Use the dd command to destroy the label on the

same disk. Attempt to read the disk label by using the prtvtoc

command, and record the result. If required, use the format

command to write a default label to the disk. Use the fmthard

command to restore the label by using the output from the prtvtoc

command that you saved earlier. Verify that the new label exists.

Tasks

Complete the following steps:

1. Log in as the root user, and open a terminal window. Run the

format command.

# format

2. Record the list of disks presented by the format command, for

example, c0t0d0 and c1t0d0.

Press Control-D to exit the format utility.

format> Control-D

#

3. Use the prtvtoc command to list the VTOC for each of the disks

you found in the previous step. Examine the Mount Directory field

in the information that the prtvtoc command displays. Record the

name of a disk that has no mount directory listed. This will be an

unused disk.

# prtvtoc /dev/rdsk/c1t0d0s2

Unused disk: Your entry will depend on your system.

4. Run the format command again. Select the unused disk from the list

of disks presented.

# format

(list of disks)

Specify disk (enter its number): x

5. Display the Partition menu. Print the current partition table, and

record the number of megabytes assigned to Slice 2. For example, if

the disk reports 4 Gbytes, record 4000 Mbytes.

format> part

partition> print

Mbytes: Your entry will depend on your system.

6. Divide the number of megabytes by 4. Use the result as the number

of megabytes to assign as disk space to four slices. Round down to

the next whole megabyte if the result includes a fraction.

Mbytes/4: Your entry will depend on your system.

Exercise: Working With Disks and Partitions (Level 3)

Managing Local Disk Devices 2-59

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

7. Display the Partition menu again. Select Slice 0. Accept the defaults

for tags and flags. Start this first slice on Cylinder 0. Enter the

resulting number of megabytes from the previous step for the slice

size. Print the partition table again to verify the change.

partition> 0

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]: <Return>

Enter partition permission flags[wm]: <Return>

Enter new starting cyl[0]: 0

Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 300mb

partition> print

(partition table)

8. Set the sizes of Slices 1, 3, and 4 so that they are the same as Slice 0.

Begin each successive slice on the cylinder that follows the ending

cylinder of the previous slice.

partition> ?

(Partition menu)

partition> 1

Part Tag Flag Cylinders Size Blocks

1 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]: <Return>

Enter partition permission flags[wm]: <Return>

Enter new starting cyl[0]: 452

Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 300mb

partition> print

(partition table)

9. Set Slices 5, 6, and 7 to start at Cylinder 0, and assign them 0 Mbytes.

partition> ?

(Partition menu)

partition> 5

Part Tag Flag Cylinders Size Blocks

5 unassigned wm 0 0 (0/0/0) 0

Enter partition id tag[unassigned]: <Return>

Enter partition permission flags[wm]: <Return>

Enter new starting cyl[0]: 0

Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 0m

partition>

10. Print the partition table. Is there any overlap of ending and

beginning cylinders for any of the slices listed? Proceed to the

following steps to introduce this problem.

partition> print

Exercise: Working With Disks and Partitions (Level 3)

2-60 Intermediate System Administration for the Solaris™ 9 Operating Environment

Copyright 2002 Sun Microsystems, Inc. All Rights Reserved. Enterprise Services, Revision A

11. Add 25 to the number Mbytes/4 value listed in Step 6.

(Mbytes/4) + 25: Your entry will depend on your system.

Change Slice 0 so that it uses the new size listed previously.

partition> ?

(Partition menu)

partition> 0

Part Tag Flag Cylinders Size Blocks

0 unassigned wm 0 - 451 300.16MB (452/0/0) 614720

Enter partition id tag[unassigned]: <Return>

Enter partition permission flags[wm]: <Return>

Enter new starting cyl[0]: 0

Enter partition size[614720b, 452c, 451e, 300.16mb, 0.29gb]: 325mb

partition> print

(partition table)

The partition table should now indicate that Slice 0 ends after Slice 1

begins.

12. Use the modify command from the Partition menu to attempt to fix

this problem. Select Item 0 to modify the current partition table.

partition> ?

(Partition menu)

partition> modify

Select partitioning base:

0. Current partition table (unnamed)

1. All Free Hog

Choose base (enter number) [0]? 0

Which warnings display?

Warning: Overlapping partition (1) in table.

Warning: Fix, or select a different partition table.

13. Modify the partition table. Select Item 1 to use the All Free Hog

option.

partition> modify

Select partitioning base:

0. Current partition table (original)

1. All Free Hog

Choose base (enter number) [0]? 1

14. The partition table appears. Observe the Cylinders and Size columns, and notice that they are all zero; for example:

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 - 1964 1.27GB (1965/0/0) 2672400

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

15. Respond to the prompts to continue the process. Select Slice 4 as the All Free Hog partition. Use the size listed in Step 6 for Slices 0, 1, and 3. Set the other slices to Size 0.

Do you wish to continue creating a new partition table based on above table[yes]? yes

Free Hog partition[6]? 4

Enter size of partition ’0’ [0b, 0c, 0.00mb, 0.00gb]: 300mb

Enter size of partition ’1’ [0b, 0c, 0.00mb, 0.00gb]: 300mb

Enter size of partition ’3’ [0b, 0c, 0.00mb, 0.00gb]: 300mb

Enter size of partition ’5’ [0b, 0c, 0.00mb, 0.00gb]: 0

Enter size of partition ’6’ [0b, 0c, 0.00mb, 0.00gb]: 0

Enter size of partition ’7’ [0b, 0c, 0.00mb, 0.00gb]: 0

At the end of this process, you should have three slices of equal size,

where Slice 4 takes up any extra room if it exists.

16. Name the slice SA239Partition. Quit the Partition menu.

Okay to make this the current partition table[yes]? y

Enter table name (remember quotes): "SA239partition"

Ready to label disk, continue? y

partition>

partition> quit

(format menu)

format>

17. Label the drive and save your new partition table to the /etc/format.dat file. Carefully read the message that is displayed by the format utility, and enter the correct file name. Quit the format utility when you have finished. Use the cat command to view the contents of the /etc/format.dat file. Note that your information is appended to the file.

format> save

Saving new disk and partition definitions

Enter file name["./format.dat"]: /etc/format.dat

format> quit

#

# cat /etc/format.dat

Verify your new partition table with the prtvtoc command.

# prtvtoc /dev/rdsk/c1t0d0s2

19. Create a directory called /vtoc.

# mkdir /vtoc

20. Use the prtvtoc command to print the partition table that you just created, and save its output to a file in the /vtoc directory. Name the file so that it corresponds with the disk you are examining. Use the cat command to verify that valid information exists in the file that you create.

# prtvtoc /dev/rdsk/c1t0d0s2 > /vtoc/c1t0d0

# cat /vtoc/c1t0d0

21. Use the following dd command to destroy the disk label. Be certain to specify the correct disk device name for the of= argument. Enter all other arguments exactly as listed.

# dd if=/dev/zero of=/dev/rdsk/c1t0d0s2 bs=512 count=1

1+0 records in
1+0 records out

22. Attempt to read the label from the same disk by using the prtvtoc command.

# prtvtoc /dev/rdsk/c1t0d0s2

What happens?

Different disk types present different results. SCSI disks might report messages that indicate that the disk label is unreadable, for example:

prtvtoc: /dev/rdsk/c1t0d0s2: Unable to read Disk geometry

IDE disks might report a partition table where only Slice 2 remains defined, for example:

Partition Tag Flags Sector Count Sector

Mount Directory

2 501 0

17801280 17801279

23. If the prtvtoc command reported an "Unable to read Diskgeometry" message, use the format command to place a default label on the disk for which you destroyed the label earlier. If the prtvtoc command reports that only Slice 2 exists on the disk, skip to the next step. Otherwise, perform the commands:

# format

Searching for disks...done

c1t0d0: configured with capacity of 1.3GB

AVAILABLE DISK SELECTIONS:

0. c0t0d0 <Seagate Medalist 34342A cyl 8892 alt 2 hd 15 sec 63>

/pci@1f,0/pci@1,1/ide@3/dad@0,0

1. c1t0d0 <SUN1.3G cyl 1965 alt 2 hd 17 sec 80>

/pci@1f,0/pci@1/scsi@1/sd@0,0

Specify disk (enter its number): 1

selecting c1t0d0

[disk formatted]

Disk not labeled. Label it now? Y

(format menu)

format> q

#

# prtvtoc /dev/rdsk/c1t0d0s2

24. Use the fmthard command to write to the disk the label information you saved earlier.

# fmthard -s /vtoc/c1t0d0 /dev/rdsk/c1t0d0s2

fmthard: New volume table of contents now in place.

#

25. Attempt to read the label from the same disk.

# prtvtoc /dev/rdsk/c1t0d0s2

Was this successful?

This command should successfully read the disk label.

Introducing the Solaris™ Management Console

The Solaris Management Console is a Java technology-based tool for the administration of systems. It provides a central integration point for the configuration and administration of important applications and services. The Solaris Management Console software simplifies the job of configuring and administering servers. With point-and-click graphical user interface (GUI) tools, the Solaris Management Console makes the Solaris easy to administer, especially for administrators who are not familiar with the UNIX environment.

Starting the Solaris Management Console

The Solaris Management Console can be started from the command line or from within the Application Manager by clicking the Solaris Management Console icon. Log in to your system as root, and type smc& in a terminal window. You can start the Solaris Management Console as a normal user, but some tools and applications are not available to you. When you initiate the Solaris Management Console for the first time, it can take a few minutes to launch.

Note – The information provided in this course is only a small subset of the overall capabilities of the Solaris Management Console.

Using the Solaris Management Console Tools

The default toolbox for a Solaris Management Console server includes the following folders and tools:

The Solaris Management Console enables local users and administrators to register remote Solaris Management Console servers and applications on the network they want to administer. When you access the Solaris Management Console, it dynamically configures tree views of those registered hosts and services. Point and click with the mouse to invoke an application remotely on a selected Solaris Management Console server and view the application’s GUI on the local display.

Introducing the Help Screen

The online help for the Solaris Management Console provides an alternative to standard documentation. The information panes that appear in both the Solaris Management Console and the Solaris Management Console Toolbox Editor provide the steps necessary to perform the tasks executed within these windows. In addition, the Help menu item Contents displays a window that further describes the features and functions of the window components.

Restarting the Solaris Management Console

If you have trouble accessing Solaris Management Console, the reason might be that the Solaris Management Console server is not running or is in a problem state. To determine if the Solaris Management Console server is running, as the root user, perform the command:

# /etc/init.d/init.wbem status

If the Solaris Management Console server is running, a response similar to the following returns:

"Solaris Management Console server version 2.1.0 running on port 898."

To stop the Solaris Management Console server, as the root user, perform the command:

# /etc/init.d/init.wbem stop

The following response returns: "SMC stopped." To start the Solaris Management Console server, as the root user, perform the command:

# /etc/init.d/init.wbem start

After a short time, the following response returns: "SMC server started."

Identifying the Functional Areas
of the Solaris Management Console

The Solaris Management Console and the Solaris Management Console Toolbox Editor windows are divided into functional areas as follows:

Navigation Pane

The Navigation pane works like a frame in a web page. Clicking an item in the Navigation pane determines what appears in the View pane. The turner icon is displayed to the left of items that represent a group of items. Click the icon or the item to expand or collapse the group. The Navigation pane is displayed or not displayed, depending on the Show setting in the View menu. Click View on the Menu bar, select the Show option, and select or deselect the Navigation option.

View Pane

The View pane displays the contents of the node selected in the Navigation pane. The contents could be a folder or a tool.

If the node selected in the Navigation pane is a folder, the View pane displays the contents of that folder. If the node selected is a simple tool, such as the Process tool, the View pane displays a list of current processes. If the node selected is a complex tool, such as User Manager, the View pane displays additional tools, such as the tools for user accounts and email accounts. Select one of the additional tools, such as the user accounts node, and the View pane displays the contents of the tool.

Information Pane

The Information pane at the bottom of the Solaris Management Console window displays either context help for the object selected in the Navigation pane or a list of events and alarms for all Solaris Management Console events.

The Context Help tab and Console Events tab determine what is shown in the Information pane. Click the Context Help tab to display context help for the object selected. Click the Console Events tab to display a list of events and alarms for all Console events.

The Information pane is displayed or not displayed, depending on the Show setting in the View menu. Click View on the Menu bar, select the Show option, and select or deselect the Information option.

Location Bar

The Location bar, beneath the tool bar in the Solaris Management Console window, displays a Home Toolbox icon and a Toolbox field. Click the Home Toolbox icon to open the home toolbox. The Toolbox field indicates the current toolbox and the item currently selected in the toolbox. Click the button to the right of the Toolbox field to display a pull-down menu of recent toolboxes visited. Select a toolbox from the pull-down menu to open that toolbox.

The Location bar is displayed or not displayed, depending on the Show setting in the View menu. Click View on the Menu bar, select the Show option, and select or deselect the Location option.

Status Bar

The Status bar, located across the bottom of the Solaris Management Console window, displays three panes. The left pane of the Status bar indicates the number of nodes directly subordinate to the node selected in the Navigation pane. The center pane of the Status bar indicates Console activity. A moving bar inside the center pane functions as an activity indicator when Console activity occurs. The right pane of the Status bar provides progress information during some Console tasks. The Status Bar is displayed or not displayed, depending on the Show setting in the View menu. Click View on the Menu bar, select the Show option, and select or deselect the Status bar option.

Partitioning a Disk
by Using the Solaris Management

Console Disks Manager Tool

The following section describes how to partition a disk by using the Solaris Management Console Disks Manager Tool (from this point on, referred to as the Disks Tool).

Partitioning the Disk Using the Disks Tool

To partition a disk by using the Disks Tool, you must first locate the Storage folder within the Navigation pane. The Storage folder consists of the Mounts and Shares folder, the Disks Tool, and the Enhanced Storage tools. Use the Disks Tool to perform the following tasks:

Perform the following steps to partition a disk by using Disks Tool:

  1. Click the Disks Tool. The Log In: User Name window appears, prompting you to enter the root password.

  2. Click to select a specific disk. Then click the Action menu on the Menu bar. The Action menu displays a list of functions that this window performs.

  3. To display a graphical representation of a disk’s partitioning, select the Properties option from the Action menu.

  4. Basic disk information, including size, address, and available free space, is reported. Move the cursor over any partition on the Disk Layout bar to see the size and geometry of the partition slice in a pop-up window.

  5. To create a new partition map on a disk, select the Create Solaris Partitions option from the Action menu. This window prompts you to choose between creating custom-sized partitions and creating equal-sized partitions. In the figure, Create Custom-Sized Partitions is selected.

  6. Click Next after choosing how to divide the disk. You are prompted to select the number of partitions. You can select up to seven partitions. You can also create some of them as zero-length partitions.

  7. After selecting the number of partitions, click Next. When a partition is displayed, the size of the partition is also displayed. You can choose to display the size of the partition in either a percentage of the disk space or the total number of megabytes, and you can adjust the size of each partition. The disk layout bar graphically represents the disk partitions. Place the cursor over the bar to view the amount of space that remains to be partitioned.

  8. Use this window to adjust the size of each partition to the desired size. Click Next when you have finished sizing the partitions.

  9. In the Create Solaris Partitions on Disk window, check the box under the file system that corresponds to each partition you want to use. Click Next when you are finished making your selections.

  10. If you are satisfied with the partitions, click Finish. The new partitioning is written, and the newfs utility runs on the partitions you selected to create a new file system.

Exercise:Working With the Solaris Management Console

In this exercise, you complete the following tasks partition the second drive of your system to match the boot drive . This exercise requires a system with at least two disks, one of which is available for the student to re-partition.

Tasks:

  1. Launch the Solaris Management Console, and choose the Disks Tool from the Storage folder.

  2. Authenticate as the root user by typing the root password.

  3. View information about your boot drive from the Disks Tool, and make note of it.

  4. On your spare hard drive, make four equal sized partitions on Slices 0, 1, 3, and 4.

Tasks

Complete the following steps:

1. Launch the Solaris Management Console from the command line or by using Application Manager.

2. Open the Disks Tool.

3. Select your boot drive from the Disks Tool, and record the partition information listed.

4. Select your spare drive from the Disks Tool. Select Create Solaris Partitions from the Action menu.

5. Choose Create Equal-Sized Partitions, and click Next.

6. Specify Number of Partitions as 4. Click Next.

7. Verify that you have four equal-sized partitions on Slices 0, 1, 3, and

4. Click Next.

8. Check the box beside Slice 4 to create a File System, and click Next.

9. After reviewing your choices and verifying that they are correct, click Finish.

The Solaris Management Console window refreshes, and you should see the four equal-sized partitions listed in the View Pane.

10. Exit from the Solaris Management Console.



Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: March, 12, 2019