The distribution media (CD-ROM or RIS) contains file systems that are laid out just as the software would be installed on the system and provides direct access to the root, /usr, and /var directories. This format makes almost every Digital UNIX command and utility available in the UNIX shell even if your operating system is not yet fully functional. In effect, the mounted distribution media is a full operating system environment.
You should perform system management activities in the UNIX shell only if you have extensive UNIX operating system experience and a full operating system environment is not available.
The following system management activities can be performed from the UNIX shell:
Welcome to the Digital UNIX Installation Procedure This procedure installs Digital UNIX onto your system. You will be asked a series of system configuration questions. Until you answer all questions, your system is not changed in any way. During the question and answer session, you can go back to any previous question and change your answer by entering: history You can get more information about a question by entering: help There are two types of installations: o The Default Installation installs a mandatory set of software subsets on a predetermined file system layout. o The Custom Installation installs a mandatory set of software subsets plus optional software subsets that you select. You can customize the file system layout. The UNIX Shell option puts your system in single-user mode with superuser privileges. This option is provided for experienced UNIX system administrators who want to perform file system or disk maintenance tasks before the installation. The Installation Guide contains more information about installing Digital UNIX. 1) Default Installation 2) Custom Installation 3) UNIX Shell Enter your choice:Choose option 3 from the menu to access the UNIX shell option.
Use the UNIX shell to perform the following tasks:
# TERM=vt100 # export TERM
Remember to use the -t advfs or -t ufs
option with the disklabel command depending upon which
file system type is in use (AdvFS or UFS) for the root
file system. Boot blocks must match the file system type of root. Refer to the disklabel
(8) reference page for more information.
The root file system located on the CD-ROM or the RIS server is mounted with read permissions. The memory file systems (MFS) at /var and /dev are mounted with read-write permissions. However, any changes that you make on files that you create in root are volatile and will not be saved when you halt the UNIX shell. Note
Follow these steps to turn on swapping in the UNIX shell:
# cd /dev
./MAKEDEVswap_device
For example, to create a swap area on device rz0 in the h partition, enter a command similar to the following:
# ./MAKEDEV rz0h
# swapon /dev/rz0h
# swapon -s
For example, to create the device special file for a SCSI disk, unit number 0 (zero), execute the following commands:
# cd /dev
# ./MAKEDEV rz0
To mount an existing root file system located on /dev/rz0a, execute the following commands:
# cd /dev # ./MAKEDEV rz0
# mkdir /var/mnt
# mount /dev/rz0a /var/mnt
# mkdir -p /etc/fdmns/root_domain # cd /etc/fdmns/root_domain # ln -s /dev/rz0a # mount root_domain#root /var/mnt
If your system is using the Logical Storage Manager (LSM) volume rootvol for the root file system, refer to Section 7.9 for information about how to start LSM in the UNIX shell.
disklabel-r disk
If there is no disk label, a message displays.
If a disk label does not exist, use the disklabel command with the following syntax to write the default disk partition table:
disklabel-rw -t ufs disk disk_type
The -t ufs specifies that the UNIX file system bootstrap programs are installed. The disk parameter specifies the disk that includes the device mnemonic and unit number. The disk_type parameter specifies the type of disk associated with disk as described in the /etc/disktab file.
For example, to write the default disk partition tables on an RZ57 disk, unit 0, on the a partition, enter the following command:
# disklabel -rw -t ufs rz0 rz57
The disklabel command used in this procedure writes the default disk partition tables to the disk. Writing a label with customized partition table settings may affect the entire disk. If the disk you are restoring has customized partition table settings, invoke the editing option of the disklabel command after writing the default disk label. Refer to System Administration or to the Note
disklabel
(8) reference page for more information.
newfsraw_device disk_type
The raw_device parameter specifies the full raw device pathname of the disk device on your system. For example, to create a new file system on an RZ57, unit 0, enter the following command:
# newfs /dev/rrz0a rz57
# mkdir /var/mntDigital suggests creating mount points under the /var or /tmp directories.
mountblock_device /var/mnt
The block_device parameter specifies the full block device pathname of the disk device. For example, to mount the file system created in the previous step, enter the following command:
# mount /dev/rz0a /var/mnt
restore-Yrf dumpfile
The dumpfile parameter specifies the pathname of the file containing the dump data. For a tape, enter the following commands:
# cd /var/mnt # restore -Yrf /dev/rmt0h
You can use the UNIX shell to restore other file systems. Digital recommends performing file system restores from a full operating system environment. If such an environment is unavailable due to the need to restore either /var or /usr, you should boot your system to single-user mode by using your existing or restored root file system. In the single-user mode, more disk space is available, and swap space can be made available in the UNIX shell as shown in the instructions in Section 7.4.
disklabel -r disk
If the disk has no label, a message is displayed. If the disk has no label, use the disklabel command with the following syntax to write the default disk partition table:
disklabel -rw -t advfs disk disk_type
The -t advfs option must be used when creating an AdvFS root fileset to ensure that the correct boot blocks are in use in the boot partition. The disk parameter specifies the disk that includes the device mnemonic and unit number. The disk_type parameter specifies the type of disk associated with disk as described in the /etc/disktab file. For example, to write the default disk partition tables on an RZ57 disk, unit 0, enter the following command:
# disklabel -rw -t advfs rz0 rz57
The disklabel command used in this procedure writes the default disk partition tables to the disk. Writing a label with customized partition table settings may affect the entire disk. If the disk you are restoring has customized partition table settings, invoke the editing option of the disklabel command after writing the default label. Refer to System Administration or to the Note
disklabel
(8) reference page for more information.
mkfdmn -t disk_type raw_device domain
The raw_device parameter specifies the full raw device pathname of the disk device on your system. For example, to create a new file system on an RZ57, unit 0, enter the following command:
# mkfdmn -t rz57 /dev/rz0a root_domain
# mkfset domain filesetThe domain parameter specifies the name of the root file domain. For example, to create the root fileset in the root_domain file domain, enter the following command:
# mkfset root_domain root
# mkdir /var/mntDigital suggests creating mount points under the /var or /tmp directories.
mountdomain#fileset mount_point
The domain#fileset parameter specifies the root file domain and the root fileset. The block_device parameter specifies the full block device pathname of the disk exist (directories are created using the mkdir command). For example, to mount the fileset created in the previous steps, enter the following command:
# mount root_domain#root /var/mnt
vrestore -vxf dumpfile
The dumpfile parameter specifies the pathname of the file containing the dump data. Enter the following commands for a tape:
# cd /var/mnt # vrestore -vxf /dev/rmt0h
You can restore a UFS format dump tape to AdvFS (for instance if you are converting a UFS root file system to AdvFS) and you can make a vdump tape on UFS. The restore command you use depends on the format of the tape (dump or vdump). Use vrestore to restore AdvFS dumps performed with the vdump command and restore to restore dumps performed with the dump command. The corresponding restore command is used regardless of the target file system type. Note
# swapon -a
disklabel
(8) reference page for
more information.
If you have a VGA monitor and want disklabel to use the vi editor, you first have to set the following variables: Note
# TERM=vt100 # export TERM # EDITOR=vi # export EDITOR
To look at the existing disk partition layout, enter the disklabel command in the following format and replace the variable n with the unit number of the disk. For example, to look at the existing disk partition layout of an rz SCSI disk, enter the following command:
# disklabel -r /dev/rznIn the previous example, n is the unit number of the disk. The system displays the existing disk partition layout.
To change the size of the disk partition, complete the following steps. The following example uses an rz26 disk, unit number 0. In this example, the size of the b partition is decreased and the size of the g partition is increased to include the space no longer being used by the b partition.
# cd /dev
# ./MAKEDEV rz0
# disklabel -r rz0If there is no label, the following message is displayed:
Bad pack magic number (label is damaged, or pack is unlabeled)To label the disk with the default partitions with AdvFS boot blocks, enter the following command:
# disklabel -rw -t advfs rz0 rz26
The kernel device drivers do not allow the size of a disk partition to be decreased or the offset of a partition to be changed while it is open. Some device drivers create a label containing only a single large partition if a disk is unlabeled; thus the label must be written to the a or c partition of the disk while it is open. This sometimes requires the desired label to be set in two steps, the first one creating at least one other partition, and the second setting the label on the new partition while shrinking the a partition. Note
# EDITOR=ed # export EDITOR
If you have a VGA monitor and want to use the vi editor, you first have to set the following variables: Note
# TERM=vt100 # export TERM # EDITOR=vi # export EDITOR
# disklabel -e rz0
1,$p
/b:Information similar to the following is displayed:
b: 262144 131072 unused 1024 8192 # (Cyl. 164*- 492*)
s/262144/131072/pThis reduces the size of the b partition from 128 MB to 64 MB. The revised information is displayed:
b: 131072 131072 unused 1024 8192 # (Cyl. 164*- 402)There is no need to modify cylinder information; cylinder information is automatically modified when you save and exit the file.
/g:Information similar to the following is displayed:
g: 819200 393216 unused 1024 8192 # (Cyl. 492*- 1519*)
s/819200/950272/pThis increases the size of the g partition from 400 MB to 464 MB.
s/393216/262144/pThe revised information is displayed:
g: 950272 262144 unused 1024 8192 # (Cyl. 402*- 1519*)
1,$p
wqThe system prompts if you want to write the new label. If you are satisfied with your changes, press Return to accept the default answer, y.
Write new label? [y] [Return]
# disklabel -r rz0
Choose the custom installation by entering the number 2 at the prompt. If you choose the default installation option, the changes you made to the disk label will be lost because the default partitions are always used on the disk that contains the root file system.
Welcome to the Digital Installation Procedure This procedure installs Digital UNIX onto your system. You will be asked a series of system configuration questions. Until you answer all questions, your system is not changed in any way. During the question and answer session, you can go back to any previous question and change your answer by entering: history You can get more information about a question by entering: help There are two types of installations: o The Default Installation installs a mandatory set of software subsets on a predetermined file system layout. o The Custom Installation installs a mandatory set of software subsets plub optional software subsets that you select. You can customize the file system layout. The UNIX Shell option puts your system in single-user mode with superuser privileges. This option is provided for experienced UNIX system administrators who want to perform file system or disk maintenance tasks before the installation. The Installation Guide contains more information about installing Digital UNIX. 1) Default Installation 2) Custom Installation 3) UNIX Shell Enter your choice:
Use commands similar to the following to restart LSM in the UNIX shell:
# cd /dev # ./MAKEDEV rz9 rz10 # cd /
# mknod /dev/volconfig c 41 0 # mknod /dev/volevent c 41 1 # mknod /dev/voliod c 41 2 # mknod /dev/volinfo c 41 3
# voliod set 2 # mkdir /etc/vol
# vold -m disable
# voldctl init
# voldctl add disk rz9
# voldctl enable
# voldisk listMake sure that all disks have a device special files in /dev.
# volprint -htA
# volume -g diskgroup -U usetype start volume_name
If the root file system was using AdvFS as the file system type, enter commands similar to the following to mount it:
# mkdir -p /etc/fdmns/root_domain # cd /etc/fdmns/root_domain # ln -s /dev/vol/rootdg/rootvol rootvol # mount root_domain#root /mntIf the root file system was using UFS as the file system type, the LSM volume rootvol is mounted as follows:
# fsck /dev/rvol/rootdg/rootvol # mount /dev/vol/rootdg/rootvol /mnt
The following is an example of the ULTRIX partition table:
ULTRIX compatible partition data found. This data may be different than the standard partition layout information in /etc/disktab. ULTRIX partition table layout is: partition bottom top size overlap a 0 32767 32768 c b 32768 163839 131072 c c 0 2050859 2050860 a,b,d,e,f,g,h d 163840 792845 629006 c,g e 792846 1421851 629006 c,g,h f 1421852 2050859 629008 c,h g 163840 983039 819200 c,d,e h 983040 2050859 1067820 c,e,f Use the ULTRIX-style partition data? [y]: n
If you want to preserve the ULTRIX partition data, enter y at the prompt; otherwise, enter n. If you changed the partition data, the installation procedure recognizes the changes to the disk label and prompts if you want to use the customized partition layout or the default layout. To preserve your changes, choose the customized partition layout.
# cd / # restart
# cd / # restart nogui
# haltWhen the console mode prompt (>>>) displays, enter:
>>> boot system_diskReplace system_disk with the device where the current root file system is located. The system disk is usually an entry such as DKA0.