Aqua Phoenix
     >>  References >>  Operating Systems  


1.4 Disks and File Systems

1.4.1 Disk Copy

Create a directory to mount the empty disk partition, e.g. /disk2, and mount the empty partition at that point. If you are copying several partitions, e.g. root partition and usr partitions, then the mount and diskcopy procedure has to be followed separately for each partition.

For example, if you would like to copy the entire partition /dev/dsk/c0t0d0s0 (which usually is the boot disk with the root directory) to a second disk /dev/dsk/c0t1d0s0, then:

mount /dev/dsk/c0t1d0s0 /disk2 To copy the root directory to a disk mounted on /disk2:

ufsdump 0f - /dev/dsk/c0t0d0s0 | ( cd /disk2 ; ufsrestore xf -) To copy the usr partition 7 to a disk mounted on /disk2:

ufsdump 0f - /dev/dsk/c0t0d0s7 | ( cd /disk2 ; ufsrestore xf -) The following command must be run in order to prepare the root partition for booting. This tends to be done on the 0'th slice. In this example, the target disk is /dev/rdsk/c0t1d0s0:

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t1d0s0 The single quotes (accent grave) surrounding uname -i are the quotes found on the tilde (~) key.

All commands can be found under /usr/sbin. FC-AL (Fibre Channel Arbitrated Loop) Drives

This section only applies to bootable root slices of FC-AL drives. User slices do not require the additional steps listed here.

Root slices on FC-AL drives can be duplicated using ufsdump/ufsrestore/installboot; however, the architecture of FC-AL drives requires additional steps before the copied counterparts can be used as bootable slices. FC-AL drives contain a unique WWN (World Wide Name), which is used in fibre channel networks. The device directory of a bootable FC-AL slice needs to be rebuilt and the boot device setting in the system's EEPROM must be updated before the copied slice can be used as a bootable entity.

The WWN of an FC-AL drive can be found in the /dev/dsk device directory. SCSI disk slices are linked to device names such as c1t3d0s0 -> ../../devices/pci@8,700000/scsi@6,1/sd@3,0:a , whereas FC-AL slices are linked to the physical disk including the WWN, e.g.: c2t1d0s0 -> ../../devices/pci@8,600000/SUNW,qlc@4/fp@0,0/ssd@w2100002037a52c7c,0:a . In this example, 2100002037a52c7c is the 64-bit WWN. For a bootable FC-AL slice, this device name including the WWN appears under boot-device.

Depending on whether (1) the copied disk is used to replace an existing disk in the same slot (physical location in the FC chain) or (2) is used as a bootable entity in a new slot, different preparation is required.

  1. The copied disk replaces an existing disk in its slot.
    1. Duplicate the root and usr slices using the above steps.
    2. Remove the original disk and replace it with the copied disk.
    3. Boot from CD-ROM and obtain a Shell, and if not done automatically, mount the root slice of the new system disk. (Assume it is now mounted on /a)
    4. Remove all contents (device links) in /a/dev/dsk and /a/dev/rdsk.
    5. Re-create the device tree using:

      /usr/sbin/devfsadm -c disk -r /a -p /a/etc/path_to_inst

    6. Update EEPROM using:

      luxadm set_boot_dev /dev/dsk/SLICE where SLICE is the root slice of the boot drive, e.g. c2t1d0s0

    7. Reboot

    Note that device-tree recreation is necessary, because the physical location of the drive has changed, and the new device configuration no longer refers to the correct WWNs.

  2. The copied disk replaces an existing disk, but is not physically moved to a new slot after duplication
    1. Duplicate the root and usr slices using the above steps.
    2. Update EEPROM using:

      luxadm set_boot_dev /dev/dsk/SLICE where SLICE is the root slice of the boot drive, e.g. c2t1d0s0

    3. Update /etc/vfstab to reflect the new root partition. For example, if the original root partition was c2t1d0s0, and the new root partition is c2t2d0s0, then /etc/vfstab must reflect this change.
    4. Reboot

    Note that device-tree recreation is not necessary, because the device names (e.g. c2t1d0s0) already point to the correct physical drive with unique WWN.

1.4.2 NFS - Network File System

NFS is used to share a directory between an NFS server, where the directory is physically located on a connected disk drive, and a client that may use the directory for read-only or read-write purposes. Server Setup

Edit /etc/dfs/dfstab and add one line for each directory shared with one or more clients:

share -F nfs -o rw=eiffel:telford -d "home dir" /usr/local/home
share -F nfs -o ro=eiffel -d "src dir" /usr/local/src
-F specifies the type/version of the network file system, e.g. nfs or nfs2.

rw and ro specify whether the file system is read/write or read-only for the clients.

Hostnames that are allowed to mount the directory are enumerated after rw= and ro=. Hostnames are separated by : (colons).

-d "..." is used to describe the file system. It is not a required option.

The absolute path name to be shared on the network is specified as the last argument to the command share.

To start NFS on the server:

/etc/init.d/nfs.server start
After changing the file /etc/dfs/dfstab, the following command registers changes in shared directories:

exportfs -va Client Setup

Edit /etc/vfstab and add one line for each nfs mounted directory:

mach:/usr/local/home          -                      /usr/local/home        nfs    -      yes    -
mach:/usr/local/src          -                      /usr/local/src          nfs    -      yes    -
where mach is the name of the NFS server that is sharing the NFS directory.

Network File Systems tend to be used in conjunction with NIS in order to preserve user and group information.