Sun StorEdge D1000


 

 

Overview

The Sun StorEdge D1000 is a disk tray with hot-pluggable

  1. Power supplies
  2. Fans
  3. Disks (If SPARCstorage Volume Manager configured).

A D1000 is disk array attached to the hostname is configured as a RAID5 metadevice.

 

Disk Terminology

Before you can effectively use the information in this section, you should be familiar with basic disk architecture. In particular, you should be familiar with the following terms:

 

Disk Slices

Files stored on a disk are contained in file systems. Each file system on a disk is assigned to a slice-a group of cylinders set aside for use by that file system. Each disk slice appears to the operating system (and to the system administrator) as though it were a separate disk drive. Slices are sometimes referred to as partitions.

  1. Each disk slice holds only one file system.

  2. No file system can span multiple slices.
On SPARC based systems, Solaris defines eight disk slices and assigns to each a conventional use. These slices are numbered 0 through 7.

Slice File System Purpose
0 root Holds files and directories that make up the operating system.
1 swap Provides virtual memory, or swap space. Swap space is used when running programs are too large to fit in a computer's memory. The Solaris operating environment then "swaps" programs from memory to the disk and back as needed.
2 - Refers to the entire disk, by convention. It is defined automatically by the format and the Solaris installation programs. The size of this slice should not be changed.
3 /export Holds alternative versions of the operating system. These alternative versions are required by client systems whose architectures differ from that of the server. Clients with the same architecture type as the server obtain executables from the /usr file system, usually slice 6.
4 /export/swap Provides virtual memory space for client systems.
5 /opt Holds application software added to a system. If a slice is not allocated for this file system during installation, the /opt directory is put in slice 0.
6 /usr Holds operating system commands-also known as executables- designed to be run by users. This slice also holds documentation, system programs (init and /tech/sun/commands/syslogd.html">syslogd, for example) and library routines.
7 /export/home Holds files created by users.

 

Raw Data Slices

The SunOS operating system stores the disk label in block 0, cylinder 0 of each disk. This means that using third-party database applications that create raw data slices must not start at block 0, cylinder 0, or the disk label will be overwritten and the data on the disk will be inaccessible.

Do not use the following areas of the disk for raw data slices, which are sometimes created by third-party database applications:

Block 0, cylinder 0 Where the disk label is stored.
Cylinder 0 Avoid for improved performance.
Slice 2 Represents the entire disk.

 

Slice Arrangements on Multiple Disks

Although a single disk that is large enough can hold all slices and their corresponding file systems, two or more disks are often used to hold a system's slices and file systems. A slice cannot be split between two or more disks. However, multiple swap slices on separate disks are allowed.

For instance, a single disk might hold the root (/) file system, a swap area, and the /usr file system, while a separate disk is provided for the /export/home file system and other file systems containing user data.

In a multiple disk arrangement, the disk containing the operating system software and swap space (that is, the disk holding the root (/) or /usr file systems or the slice for swap space) is called the system disk. Disks other than the system disk are called secondary disks or non-system disks.

Locating a system's file systems on multiple disks allows you to modify file systems and slices on the secondary disks without having to shut down the system or reload operating system software.

Having more than one disk also increases input-output (I/O) volume. By distributing disk load across multiple disks, you can avoid I/O bottlenecks.

 

Determining Which Slices to Use

When you set up a disk's file systems, you choose not only the size of each slice, but also which slices to use. The system configuration requires the use of different slices. The table below lists these requirements.

Slice Server
0 root
1 swap
2 -
3 /export
4 /export/swap
5 /opt
6 /usr
7 /export/home

 

The format Utility

The format utility can be used to manipulate hard disk drives:

 

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 used to described the disk label is the VTOC (Volume Table of Contents). To label a disk means to write slice information onto the disk. You usually label a disk after changing its slices.

If you fail to label a disk after creating slices, the slices will be unavailable because the operating system has no way of "knowing" about the slices. The partition table identifies a disk's slices, the slice boundaries (in cylinders), and total size of the slices. A disk's partition table can be displayed using the format utility. Partition flags and tags are assigned by convention and require no maintenance.

The following partition table example is displayed from a 1.05-Gbyte disk using the format utility:

Total disk cylinders available: 2036 + 2 (reserved cylinders)
Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -  300      148.15MB    (301/0/0)   303408
  1       swap    wu     301 -  524      110.25MB    (224/0/0)   225792
  2     backup    wm       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     525 - 2035      743.70MB    (1511/0/0) 1523088
  7 unassigned    wm       0               0         (0/0/0)          0

The partition table contains the following information:

Column Name Description
Part Partition or (slice number). Valid numbers are 0-7.
Tag A numeric value that usually describes the file system mounted on this partition.
0=UNASSIGNED
1=BOOT
2=ROOT
3=SWAP
4=USR
5=BACKUP
7=VAR
8=HOME
Flags
wm Partition is writable and mountable.
wu rm Partition is writable and unmountable. Default state of partitions dedicated for swap areas. The mount command does not check the "not mountable" flag.
top>rm The partition is read only and mountable.
Cylinders The starting and ending cylinder number for the slice.
Size The slice size in Mbytes.
Blocks The total number of cylinders and the total number of sectors per slice in the far right column.

The following example displays a disk label using the prtvtoc command.

# prtvtoc /dev/rdsk/c0t1d0s0
* /dev/rdsk/c0t1d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      72 sectors/track
*      14 tracks/cylinder
*    1008 sectors/cylinder
*    2038 cylinders
*    2036 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00          0    303408    303407   /
       1      3    01     303408    225792    529199
       2      5    00          0   2052288   2052287
       6      4    00     529200   1523088   2052287   /usr

The disk label includes the following information:

 

Dividing a Disk Into Slices

The format utility is most often used by system administrators to divide a disk into slices. The steps are:

  1. Determining which slices are needed
  2. Determining the size of each slice
  3. Using the format utility to divide the disk into slices
  4. Labeling the disk with new slice information
  5. Creating the file system for each slice

The easiest way to divide a disk into slices is to use the modify command from the partition menu. The modify command allows you to create slices by specifying the size of each slice in megabytes without having to keep track of starting cylinder boundaries. It also keeps tracks of any disk space remainder in the "free hog" slice.

 

Using the Free Hog Slice

When you use the format utility to change the size of one or more disk slices, you designate a temporary slice that will expand and shrink to accommodate the resizing operations.

This temporary slice donates, or "frees," space when you expand a slice, and receives, or "hogs," the discarded space when you shrink a slice. For this reason, the donor slice is sometimes called the free hog.

The donor slice exists only during installation or when you run the format utility. There is no permanent donor slice during day-to-day, normal operations.

 

 

How to Identify the Disks on a System

  1. Become superuser.

  2. Run the format utility.

    # format
    The format utility displays a list of disks that it recognizes under AVAILABLE DISK SELECTIONS.

Here is sample format output:

# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf785d11,0
       1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w21000004cf78670e,0
       2. c2t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/scsi@1/sd@0,0
       3. c2t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/scsi@1/sd@1,0
       4. c2t8d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/scsi@1/sd@8,0
       5. c2t9d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@8,600000/scsi@1/sd@9,0

The format output associates a disk's physical and local device name to the disk's marketing name which appears in angle brackets <>. This is an easy way to identify which local device names represent the disks connected to your system. The following example uses a wildcard to display the disks connected to a second controller.

# format /dev/rdsk/c2*
AVAILABLE DISK SELECTIONS:
  0. /dev/rdsk/c2t0d0s0 
     /io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@0,0
  1. /dev/rdsk/c2t1d0s0 
     /io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@1,0
  2. /dev/rdsk/c2t2d0s0 
     /io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@2,0
  3. /dev/rdsk/c2t3d0s0 
     /io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@3,0
  4. /dev/rdsk/c2t5d0s0 
     /io-unit@f,e0200000/sbi@0,0/QLGC,isp@2,10000/sd@5,0
Specify disk (enter its number): 

The format output identifies that disk 2 (targets 0-5) are connected to the first SCSI host adapter (sbi@...), which is connected to the first SBus device (io-unit@).

 


 

Displaying Disk Slices

You can use the format utility to check whether or not a disk has the appropriate disk slices. If you determine that a disk does not contain the slices you want to use, use the format utility to re-create them and label the disk. The format utility uses the term partition in place of slice.

  1. Become superuser.

  2. Enter the format utility.

  3. Identify the disk for which you want to display slice information by selecting a disk listed under AVAILABLE DISK SELECTIONS.

    Specify disk (enter its number):1

  4. Enter the partition menu by typing partition at the format> prompt.

    format> partition

  5. Display the slice information for the current disk drive by typing print at the partition> prompt.

    partition> print

  6. Exit the format utility by typing q at the partition> prompt and typing q at the format> prompt.

    partition> q
    format> q
    #

  7. Verify displayed slice information by identifying specific slice tags and slices. If the screen output shows that no slice sizes are assigned, the disk probably does not have slices.

 

Examples--Displaying Disk Slice Information

The following example displays slice information for disk /dev/rdsk/c2t0d0s0

Total disk cylinders available: 24620 + 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 - 24619       33.92GB    (24620/0/0) 71127180
  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 - 24618       33.91GB    (24619/0/0) 71124291
  7 unassigned    wm       0                0         (0/0/0)            0

The following example displays slice information for disk /dev/rdsk/c2t8d0s0

Total disk cylinders available: 24620 + 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 - 24619       33.92GB    (24620/0/0) 71127180
  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 - 24618       33.91GB    (24619/0/0) 71124291
  7 unassigned    wm       0                0         (0/0/0)            0

 


 

Creating and Examining a Disk Label

Labeling a disk is usually done during system installation or when you are creating new disk slices. You might need to relabel a disk if the disk label is corrupted (for example, from a power failure). The format utility will attempt to automatically configure any unlabeled SCSI disk. If format is able to automatically configure an unlabeled disk, it will display a message like the following:

c1t0d0:configured with capacity of 404.65MB

 

How to Label a Disk

  1. Become superuser.

  2. Enter the format utility.

  3. Enter the number of the disk that you want to label from the list displayed on your screen. Specify disk (enter its number):1

  4. If the disk is unlabeled and was successfully configured, format will ask if you want to label the disk. Go to step 5 to label the disk.

    If the disk was labeled and you want to change the type, or format was not able to automatically configure the disk you must specify the disk type. Go to steps 6-7 to set the disk type and label the disk.

  5. Label the disk by typing y at the Label it now? prompt.

    Disk not labeled. Label it now? y

  6. The disk is now labeled. Go to step 10 to exit the format utility.

  7. Enter type at the format> prompt.

    format> type
    Format displays the Available Drive Types menu.

  8. Select a disk type from the list of possible disk types.

    Specify disk type (enter its number)[12]: 12

  9. Label the disk. If the disk is not labeled, the following message is displayed.

    Disk not labeled. Label it now? y
    Otherwise you are prompted with this message:

    Ready to label disk, continue? y

  10. Use the verify command from the format main menu to verify the disk label.

    format> verify

  11. Exit the format utility by typing q at the format> prompt.

    partition> q
    format> q
    #

 

Example-Labeling a Disk

The following example automatically configures and labels a 1.05-Gbyte disk.

# format
 c1t0d0: configured with capacity of 1002.09MB
 AVAILABLE DISK SELECTIONS:
   0. c0t3d0 
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
   1. c1t0d0 
     /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
Specify disk (enter its number): 1
Disk not labeled.  Label it now?  yes
format> verify
#

 

How to Examine a Disk Label

  1. Examine disk label information by using the prtvtoc(1M) command. See Chapter 28, Disk Management (Overview) for a detailed description of the disk label and the information displayed by the prtvtoc command.

  2. Become superuser.

  3. Display the disk label information by using the prtvtoc command.

    # prtvtoc /dev/rdsk/device-name

 

 

Automatically Configuring SCSI Disk Drives

In Solaris 2.3 release and compatible versions, the format utility automatically configures SCSI disk drives even if that specific type of drive is not listed in the /etc/format.dat file. This feature enables you to format, slice, and label any disk driver compliant with SCSI-2 specification for disk device mode sense pages. The following steps are involved in configuring a SCSI drive using autoconfiguration:

  1. Shutting down the system
  2. Attaching the SCSI disk drive to the system
  3. Turning on the disk drive
  4. Performing a reconfiguration boot
  5. Using the format utility to automatically configure the SCSI disk drive

After the reconfiguration boot, invoke the format utility. The format utility will attempt to configure the disk and, if successful, alert the user that the disk was configured. See How to Automatically Configure a SCSI Drive for step-by-step instructions on configuring a SCSI disk drive automatically.

Here are the default slice rules that format uses to create the partition table.

Disk Size Root File System Swap Slice
0 - 180 Mbytes 16 Mbytes 16 Mbytes
180 Mbytes - 280 Mbytes 16 Mbytes 32 Mbytes
280 Mbytes - 380 Mbytes 24 Mbytes 32 Mbytes
380 Mbytes - 600 Mbytes 32 Mbytes 32 Mbytes
600 Mbytes - 1.0 Gbytes 32 Mbytes 64 Mbytes
1.0 Gbytes - 2.0 Gbytes 64 Mbytes 128 Mbytes
More than 2.0 Gbytes 128 Mbytes 128 Mbytes

In all cases, slice 6 (for the /usr file system) gets the remainder of the space on the disk.

Here's an example of a format-generated partition table for a 1.3-Gbyte SCSI disk drive.

Part    Tag    Flag     Cylinders     Size        Blocks
   0     root    wm       0 -   96    64.41MB      (97/0/0)
   1     swap    wu      97 -  289   128.16MB     (193/0/0)
   2   backup    wu       0 - 1964     1.27GB    (1965/0/0)
   6      usr    wm     290 - 1964     1.09GB    (1675/0/0)

 

How to Automatically Configure a SCSI Drive

  1. Become superuser.

  2. Create the /reconfigure file that will be read when the system is booted.

    # /tech/sun/commands/touch.html">touch /reconfigure

  3. Shut down the system.

    # /tech/sun/commands/shutdown.html">shutdown -i0 -g30 -y

    The ok or > prompt is displayed after the operating environment is shut down.

  4. Turn off power to the system and all external peripheral devices.

  5. Make sure the disk you are adding has a different target number than the other devices on the system. You will often find a small switch located at the back of the disk for this purpose.

  6. Connect the disk to the system and check the physical connections.

  7. Turn on the power to all external peripherals.

  8. Turn on the power to the system. The system will boot and display the login prompt.

  9. Login as superuser, invoke the format utility, and select the disk to be configured automatically.

    # format
    Searching for disks...done
    c1t0d0: configured with capacity of 1002.09MB
    AVAILABLE DISK SELECTIONS:
      0. c0t1d0 
         /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
      1. c0t3d0 
         /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
    Specify disk (enter its number): 1
    

  10. Reply yes to the prompt to label the disk. Replying y will cause the disk label to be generated and written to the disk by the autoconfiguration feature.

    Disk not labeled. Label it now? y

  11. Verify the disk label with the verify command.

    format> verify

  12. Exit the format utility.

    format> q

 


 

SPARC: How to Create Disk Slices and Label a Disk

  1. Become superuser.

  2. Start the format(1M) utility.

    # format
    A list of available disks is displayed.

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

    Specify disk (enter its number): disk-number

  4. Go into the partition menu (which lets you set up the slices).

    format> partition

  5. Display the current partition (slice) table.

    partition> print

  6. Start the modification process.

    partition> modify

  7. Set the disk to all free hog.

    Choose base (enter number) [0]? 1
    See Using the Free Hog Slice for more information about the free hog slice.

  8. 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

  9. 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) and/or /usr (slice 6) After you identify the slices, the new partition table is displayed.

  10. 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 don't want the current partition table and you want to change it, answer no and go to Step 6 .

  11. Name the partition table.

    Enter table name (remember quotes): "partition-name"

  12. Label the disk with the new partition table when you have finished allocating slices on the new disk.

    Ready to label disk, continue? yes

  13. Quit the partition menu.

    partition> q

  14. Verify the disk label using the verify command.

    format> verify

  15. Quit the format menu.

    format> q

 

SPARC: Example-Creating Disk Slices and Labeling a System Disk

The following example uses the format utility to divide a 1-Gbyte disk into three slices: one for the root (/) file system, one for the swap area, and one for the /usr file system.

# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
   0. c0t1d0 
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
   1. c0t3d0 
      /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

 

SPARC: Example-Creating Disk Slices and Labeling a Secondary Disk

The following example uses the format utility 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 
      /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@1,0
   1. c0t3d0 
      /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
# 

 

SPARC: How to Create File Systems

  1. Become superuser.

  2. Create a file system for each slice with the newfs(1M) command.

    # newfs /dev/rdsk/cwtxdysz

  3. Verify the new file system by mounting it on an unused mount point.

    # mount /dev/dsk/cwtxdysz /mnt
    # ls
    lost+found

 

 

How to Stop All Processes Accessing a File System

  1. Become superuser.

  2. List all the processes that are accessing the file system, so you know which processes you are going to stop.

    # /tech/sun/commands/fuser.html">fuser -c [ -u ] mount-point

  3. Stop all processes accessing the file system. You should not stop a user's processes without warning.

    # /tech/sun/commands/fuser.html">fuser -c -k mount-point
    A SIGKILL is sent to each process using the file system.

  4. Verify that there are no processes accessing the file system.

    # /tech/sun/commands/fuser.html">fuser -c mount-point

 


 

Add Disk

Follow the steps below to add a new external/internal disk:

  1. Bring the system down to the ok prompt.

    # init 0
    

  2. Find an available target setting. This command will show what you currently have on your system.

    # probe-scsi
    
    If the disk is on another scsi controller (another card off of an sbus slot)

    # probe-scsi-all
    

  3. Attach the new disk with the correct target setting. Run probe-scsi again to make sure the system sees it. If it doesn't, the disk is either not connected properly, has a target conflict, or is defective. Resolve this issue before continuing.

    In this example, we'll say:

    T3 original internal drive
    T1 new/other internal drive where a duplicate copy of the OS will be placed.

  4. Perform a reconfiguration boot.

    # boot -rv
    rv -> reconfigure in verbose mode.
    

  5. Run format and partition the disk. (Here's our example):

    
    # format
    Searching for disks...done
    
    AVAILABLE DISK SELECTIONS:
    
    1. c0t1d0 
    /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@1,0
    2. c0t3d0 
    /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@3,0
    Specify disk (enter its number): 1
    selecting c0t1d0
    [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
    quit
    format> part
    
    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
    quit
    
    partition> print
    
    Current partition table (original):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	Tag 	Flag 	Cylinders 	Size 			Blocks
    0 	root 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    1 	swap 	wu 	204 - 407 	100.41MB 	(204/0/0) 	205632
    2 	backup 	wm 	0 - 2035 	1002.09MB 	(2036/0/0) 	2052288
    3   unassigned 	wm 	0 		0 		(0/0/0) 	0
    4 	var 	wm 	408 - 611 	100.41MB 	(204/0/0) 	205632
    5   unassigned 	wm 	612 - 1018 	200.32MB 	(407/0/0) 	410256
    6 	usr 	wm 	1019 - 2034 	500.06MB 	(1016/0/0) 	1024128
    7   unassigned 	wm 	0 		0 		(0/0/0) 	0
    
    partition>
    
    ****** Modify partitions to suit your needs ******
    ****** Do NOT alter partition 2, backup !!! ******
    
    
    In this example we'll go with the current displayed partition table listed:

    partition> 0
    Part 	    Tag 	Flag 	Cylinders 	Size 	     Blocks
    0 	unassigned 	wm 	0 - 162 	80.23MB (163/0/0) 164304
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[0]: o
    `o' is not an integer.
    Enter new starting cyl[0]: 0
    Enter partition size[164304b, 163c, 80.23mb, 0.08gb]: 100.41mb
    partition> pr
    Current partition table (unnamed):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	   Tag 		Flag Cylinders 		Size 		Blocks
    0 	unassigned 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    1 	unassigned 	wu 	163 - 423 	128.46MB 	(261/0/0) 	263088
    2 	backup 		wu 	0 - 2035 	1002.09MB 	(2036/0/0) 	2052288
    3 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    4 	unassigned 	wm 	424 - 749 	160.45MB 	(326/0/0) 	328608
    5 	unassigned 	wm 	750 - 1109 	177.19MB 	(360/0/0) 	362880
    6 	unassigned 	wm 	1110 - 2035 	455.77MB 	(926/0/0) 	933408
    7 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    
    partition> 1
    Part 	Tag 		Flag Cylinders 		Size 		Blocks
    1 	unassigned 	wu 	163 - 423 	128.46MB 	(261/0/0) 	263088
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wu]:
    Enter new starting cyl[163]: 204
    Enter partition size[263088b, 261c, 128.46mb, 0.13gb]: 100.41mb
    partition> pr
    Current partition table (unnamed):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	Tag 		Flag Cylinders 		Size 			Blocks
    0 	unassigned 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    1 	unassigned 	wu 	204 - 407 	100.41MB 	(204/0/0) 	205632
    2 	backup 		wu 	0 - 2035 	1002.09MB 	(2036/0/0) 	2052288
    3 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    4 	unassigned 	wm 	424 - 749 	160.45MB 	(326/0/0) 	328608
    5 	unassigned 	wm 	750 - 1109 	177.19MB 	(360/0/0) 	362880
    6 	unassigned 	wm 	1110 - 2035 	455.77MB 	(926/0/0) 	933408
    7 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    
    
    partition> 4
    Part 	Tag 		Flag 	Cylinders 	Size 		Blocks
    4 	unassigned 	wm 	424 - 749 	160.45MB 	(326/0/0) 328608
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[424]: 408
    Enter partition size[328608b, 326c, 160.45mb, 0.16gb]: 100.41mb
    partition> pr
    Current partition table (unnamed):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	Tag 		Flag 	Cylinders 	Size 			Blocks
    0 	unassigned 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    1 	unassigned 	wu 	204 - 407 	100.41MB 	(204/0/0) 	205632
    2 	backup 		wu 	0 - 2035 	1002.09MB 	(2036/0/0) 	2052288
    3 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    4 	unassigned 	wm 	408 - 611 	100.41MB 	(204/0/0) 	205632
    5 	unassigned 	wm 	750 - 1109 	177.19MB 	(360/0/0) 	362880
    6 	unassigned 	wm 	1110 - 2035 	455.77MB 	(926/0/0) 	933408
    7 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    
    partition> 5
    Part 	Tag 		Flag 	Cylinders 	Size 			Blocks
    5 	unassigned 	wm 	750 - 1109 	177.19MB 	(360/0/0) 	362880
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[750]: 612
    Enter partition size[362880b, 360c, 177.19mb, 0.17gb]: 177mb
    partition> pr
    Current partition table (unnamed):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	Tag 		Flag 	Cylinders 	Size 			Blocks
    0 	unassigned 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    1 	unassigned 	wu 	204 - 407 	100.41MB 	(204/0/0) 	205632
    2 	backup 		wu 	0 - 2035 	1002.09MB 	(2036/0/0) 	2052288
    3 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    4 	unassigned 	wm 	408 - 611 	100.41MB 	(204/0/0) 	205632
    5 	unassigned 	wm 	612 - 971 	177.19MB 	(360/0/0) 	362880
    6 	unassigned 	wm 	1110 - 2035 	455.77MB 	(926/0/0) 	933408
    7 	unassigned 	wm 	0 		0 		(0/0/0) 	0
    
    partition> 6
    Part 	Tag 		Flag 	Cylinders 	Size 			Blocks
    6 	unassigned 	wm 	1110 - 2035 	455.77MB 	(926/0/0) 	933408
    
    Enter partition id tag[unassigned]:
    Enter partition permission flags[wm]:
    Enter new starting cyl[1110]: 972
    Enter partition size[933408b, 926c, 455.77mb, 0.45gb]: $
    partition> pr
    Current partition table (unnamed):
    Total disk cylinders available: 2036 + 2 (reserved cylinders)
    
    Part 	Tag 		Flag 	Cylinders 	Size 			Blocks
    0 	unassigned 	wm 	0 - 203 	100.41MB 	(204/0/0) 	205632
    
    1 unassigned wu 204 - 407 100.41MB (204/0/0) 205632
    2 backup wu 0 - 2035 1002.09MB (2036/0/0) 2052288
    3 unassigned wm 0 0 (0/0/0) 0
    4 unassigned wm 408 - 611 100.41MB (204/0/0) 205632
    5 unassigned wm 612 - 971 177.19MB (360/0/0) 362880
    6 unassigned wm 972 - 2035 523.69MB (1064/0/0) 1072512
    7 unassigned wm 0 0 (0/0/0) 0
    
    partition>
    

    NOTE: You will know for certain that your partitioning is correct if you add all the cylinder values [the values enclosed in ( )], like so, 204+204+204+360+1064=2036 which is the same value for slice 2 or the whole disk (Tag = backup).

    Now label the disk. This is important as this is what saves the partition table in your VTOC (Virtual Table Of Contents). It's also always recommended to do the labeling part twice to be certain that the VTOC gets saved.

    partition> label
    partition> q
    format> q
    

    After partitioning c0t1d0 to be exactly the same as c0t3d0, be sure you label the disk so that VTOC gtes updated with the correct partition table.

    To recap, our scenario is:

    c0t3d0 (running Solaris 2.6) being copied to c0t1d0 (which will have the copied Solaris 2.6 slices/partitions)
    c0t3d0s0 / -> c0t1d0s0 /
    c0t3d0s4 /var -> c0t1d0s4 /var
    c0t3d0s5 /opt -> c0t1d0s5 /opt
    c0t3d0s6 /usr -> c0t1d0s6 /usr
    

  6. For each of the partitions that you wish to mount, run newfs to contruct a unix filesystem.

    So, newfs each partition.

    # newfs -v /dev/rdsk/c0t1d0s0
    # newfs -v /dev/rdsk/c0t1d0s4
    # newfs -v /dev/rdsk/c0t1d0s5
    # newfs -v /dev/rdsk/c0t1d0s6
    

  7. To ensure that they are clean and mounted properly, run fsck on these mounted partitions:

    # fsck /dev/rdsk/c0t1d0s0
    # fsck /dev/rdsk/c0t1d0s4
    # fsck /dev/rdsk/c0t1d0s5
    # fsck /dev/rdsk/c0t1d0s6
    

  8. Make the mount points.

    # /tech/sun/commands/mkdir.html">mkdir /mount_point
    

    Create mountpoints for each slice/partition, like so:

    # /tech/sun/commands/mkdir.html">mkdir /root2
    # /tech/sun/commands/mkdir.html">mkdir /var2
    # /tech/sun/commands/mkdir.html">mkdir /opt2
    # /tech/sun/commands/mkdir.html">mkdir /usr2
    

  9. Mount the new partitions.

    # mount /dev/dsk/c0t1d0sX /mount_point
    
    Mount each partition (of the new disk), like so:

    # mount /dev/dsk/c0t1d0s0 /root2
    # mount /dev/dsk/c0t1d0s4 /var2
    # mount /dev/dsk/c0t1d0s5 /opt2
    # mount /dev/dsk/c0t1d0s6 /usr2
    

  10. Now we /tech/sun/commands/ufsdump.html">ufsdump each slices/partitions: It is often difficult to copy from one disk to another disk. If you try to use dd, and the disks are of differing sizes, then you will undoubtedly run into trouble. Use this method to copy from disk to disk and you should not have any problems. Of course you're still on the old disk (that's where you booted from c0t3d0):

    # cd /
    

    (Just ensures that you are in the root's parent/top directory).

    # /tech/sun/commands/ufsdump.html">ufsdump 0f - /dev/rdsk/c0t3d0s0 | (cd /root2; /tech/sun/commands/ufsrestore.html">ufsrestore rf -)
    # /tech/sun/commands/ufsdump.html">ufsdump 0f - /dev/rdsk/c0t3d0s4 | (cd /var2; /tech/sun/commands/ufsrestore.html">ufsrestore rf -)
    # /tech/sun/commands/ufsdump.html">ufsdump 0f - /dev/rdsk/c0t3d0s5 | (cd /opt2; /tech/sun/commands/ufsrestore.html">ufsrestore rf -)
    # /tech/sun/commands/ufsdump.html">ufsdump 0f - /dev/rdsk/c0t3d0s6 | (cd /usr2; /tech/sun/commands/ufsrestore.html">ufsrestore rf -)
    
    The gotcha here is that you can't really specify the directory name as /tech/sun/commands/ufsdump.html">ufsdump will interpret it as not being a block or character device. To illustrate this error:

    # cd /usr
    # /tech/sun/commands/ufsdump.html">ufsdump 0f - /usr | (cd /usr2; /tech/sun/commands/ufsrestore.html">ufsrestore xf - )
    DUMP: Writing 32 Kilobyte records
    DUMP: Date of this level 0 dump: Wed Dec 10 17:33:42 1997
    DUMP: Date of last level 0 dump: the epoch
    DUMP: Dumping /dev/rdsk/c0t3d0s0 (tmpdns:/usr) to standard output
    DUMP: Mapping (Pass I) [regular files]
    DUMP: Mapping (Pass II) [directories]
    DUMP: Estimated 317202 blocks (154.88MB)
    DUMP: Dumping (Pass III) [directories]
    DUMP: Broken pipe
    DUMP: The ENTIRE dump is aborted
    

    If you want to use the directory names to simplify your command line, use the tar command instead of /tech/sun/commands/ufsdump.html">ufsdump as follows:

    Example:

    # cd /usr
    # tar cvfp - . | (cd /usr2; tar xvfp - )
    

  11. OPTIONAL (This may be redundant BUT ensures that the copied files are once again clean and consistent). Checking the integrity of a filesystem is always highly recommended even if it becomes redundant in nature. Now, check and run fsck on the new partition/slices:

    # fsck /dev/rdsk/c0t1d0s0
    # fsck /dev/rdsk/c0t1d0s4
    # fsck /dev/rdsk/c0t1d0s5
    # fsck /dev/rdsk/c0t1d0s6
    

  12. Edit your /mount_point/etc/vfstab file to have this disk bootup from the correct disk/devices c0t1d0 as opposed to c0t3d0.

    # cd /root2
    # vi /root2/etc/vfstab
    
    Change c0tXd0sX devices to reflect the new disk!

    #device device mount FS fsck mount mount
    #to mount to fsck point type pass at boot options
    #
    #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes -
    fd - /dev/fd fd - no -
    /proc - /proc proc - no -
    /dev/dsk/c0t1d0s1 - - swap - no -
    /dev/dsk/c0t1d0s0 /dev/rdsk/c0t1d0s0 / ufs 1 no -
    /dev/dsk/c0t1d0s6 /dev/rdsk/c0t1d0s6 /usr ufs 1 no -
    /dev/dsk/c0t1d0s4 /dev/rdsk/c0t1d0s4 /var ufs 1 no -
    /dev/dsk/c0t1d0s5 /dev/rdsk/c0t1d0s5 /opt ufs 2 yes -
    swap - /tmp tmpfs - yes -
    :wq!
    

  13. Now you must run /tech/sun/commands/installboot.html">installboot to load a new bootblk on that disk. Not loading a bootblk will leave this disk in an unbootable state as the boot strap program is contained within the bootblk, and this in turn is what loads the boot file called ufsboot after interfacing with the OBP (Open Boot PROM).

    You can do this from your current booted disk or you may choose to boot off from cdrom via ok> boot cdrom -sw (single-user mode, writeable mode off of cdrom's mini-root).

    If you choose to get bootblk from your current disk the location of the bootblk in Solaris 2.5 or higher is under:

    /usr/platform/`uname -i`/lib/fs/ufs/bootblk
    

    # /usr/sbin/installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
    /dev/rdsk/c0t1d0s0
    

    If you choose to get bootblk from your cdrom image:

    ok> boot cdrom -sw
    # /tech/sun/commands/installboot.html">installboot /cdrom/solaris_2_5_sparc/s0/export/exec/sparc.Solaris_2.5 \
    /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0txd0s0
    
    ANOTHER SPARC EXAMPLE:

    To install a ufs bootblock on slice 0 of target 0 on con- troller 1, of the platform where the command is being run, use:

    example# /tech/sun/commands/installboot.html">installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk \
    /dev/rdsk/c1t0d0s0
    

  14. Now create an alias for the other disk (this may be existent if it's off of the onboard/first scsi controller).

    ok> probe-scsi
        T3 original boot disk
        T1 new disk with copied slices
    

    Verify via devalias command to see current /tech/sun/commands/aliases.html">aliases: disk1 is for sd@1,0 which is scsi id/target 1

    ok> devalias
    
    ok> setenv boot-device disk1
    ok> boot -rv
    

    You do not necessarily need to do a reconfiguration boot as devices had already been created. This parameter will only be run if you attached new devices to your system.

    By default this will always boot from the new disk. If you want to boot from the old disk you can manually tell it to boot to that alias, like so:

    ok> boot disk
    or
    ok> boot disk3
    

    (This will boot off from any Target 3/scsi id 3 internal disk). Also see INFODOC #'s 14046, 11855, 11854 for setting different boot devalias'es.

    NOTE: If the new disk encounters a problem on booting, most likely cause would be inappropriate /tech/sun/commands/devlinks.html">devlinks so, the course of action to take here is the /etc/path_to_inst, /dev, /devices fix: The following is a solution to solve problems with /dev, /devices, and/or /etc/path-to_inst. This routine extracts the defaults (with links intact) from the Solaris 2.x CD-ROM.

    ok> boot cdrom -sw
    
    # mount /dev/dsk/c0t1d0s0 /a ** This step assumes your boot disk is
    c0t1d0s0
    # cd /tmp/dev
    # tar cvfp - . | (cd /a/dev; tar xvfp - )
    # cd /tmp/devices
    # tar cvfp - . | (cd /a/devices; tar xvfp - )
    # cd /tmp/root/etc
    # /tech/sun/commands/cp.html">cp path_to_inst /a/etc/path_to_inst
    # /tech/sun/commands/reboot.html">reboot -- -rv
    

  15. If you plan to move this new disk you copied the OS on, you MUST ensure that it will be moved to a similar architecture and machine type as hardware address paths are usually different from one machine to another.

    Each hardware platform has a hardware device tree which must match the device tree information saved during installation in /devices and the /dev directories.

    Another reason is that a kernel from one architecture cannot boot on a machine of a different architecture. Customers often overlook these architecture differences (Sun 4/4c/4m/4d/4u). A boot drive moved from a SPARCstation 2 (sun4c architecture) cannot boot on a SPARCstation 5 (sun4m architecture).

    For more details on why you can't move Solaris 2.X boot disk between machines please see INFODOC 13911 and 13920.

    Also ensure that you have the correct /tech/sun/commands/hostname.html">hostname, IP address and vfstab entries for this new drive if you plan to move it to another machine.

 

Add a New Disk II

In this example, the Sun StorEdge D1000 tray is connected to a UDWIS host adapter corresponding to controller c2 and a drive was added to slot 4 on the tray. The new drive appears as /dev/dsk/c2t4d0s[0-7] and /dev/rdsk/c2t4d0s[0-7].

  1. Add the new device:

    # drvconfig (or devfsadm)
    # disks

  2. Verify the new disk has been created:

    # ls -l /dev/dsk/c1t4d0s*

  3. The new disk drive is now available for use as a block or character device. Refer to sd for more info.


 

Home