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:
Use the UNIX shell to perform the following tasks:
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
Follow these steps to turn on swapping in the UNIX shell:
./MAKEDEVswap_device
For example, to create a swap area on device rz0
in the h partition, enter a command similar to the following:
For example, to create the device special file for a SCSI disk, unit
number 0 (zero), execute the following commands:
To mount an existing root file system located on /dev/rz0a, execute the following commands:
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:
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:
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:
restore-Yrf dumpfile
The dumpfile parameter specifies
the pathname of the file containing the dump data. For a tape, enter the
following commands:
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:
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:
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:
vrestore -vxf dumpfile
The dumpfile parameter specifies
the pathname of the file containing the dump data. Enter the following commands
for a tape:
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:
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.
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.
Use commands similar to the following to restart LSM
in the UNIX shell:
If the root file system was using AdvFS as the file
system type, enter commands similar to the following to mount it:
Refer to the Logical Storage Manager guide for more information about how to
correct problems encountered while enabling LSM or starting LSM volumes.
The following is an example of the ULTRIX partition table:
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.
7.1 What Is the UNIX Shell Option?
The primary purpose of the UNIX shell option is to provide a way
to perform disk and file system maintenance before the installation and to
perform disaster recovery processes. The UNIX shell provides a way to access
all UNIX commands that help you recover from serious problems such as root file system corruption and enables you to perform general file
system and disk maintenance tasks.
7.2 Invoking the UNIX Shell
How you invoke the UNIX shell from the installation procedure depends
upon whether you are using the graphical or text-based interface. When you
invoke the UNIX shell option, the system is in a Bourne shell in single-user
mode with superuser privileges.
7.2.1 Invoking the UNIX Shell from the Text-Based Interface
After you boot your processor from the Digital UNIX distribution media,
your screen will look similar to the following:
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.
7.2.2 Invoking the UNIX Shell from the Graphical Interface
After you boot your processor from the Digital UNIX distribution media,
the Installation Setup screen displays. Invoke the UNIX
shell from the button labeled UNIX shell.
7.3 UNIX Shell Capabilities
The UNIX shell is an environment that has most of the capabilities of
a full operating system environment. This environment works without a swap
device and with very limited free disk space within the memory file system
(MFS). These two factors mean that tasks requiring large amounts of memory
that create the need to swap or tasks requiring large amounts of disk space
(such as /tmp space) are likely to encounter failures in
the UNIX shell environment.
# TERM=vt100
# export TERM
disklabel
(8) reference page for more information. Note
7.4 Creating Swap Space
If you need to
perform a task that needs swap space, you can turn swapping on in the UNIX
shell. The only suggestion for turning on swap space in the UNIX shell environment
is that you should not use an area that contains data you want to preserve
because it will be overwritten. To avoid this problem, use an area that has
previously been used for swap space.
# cd /dev
# ./MAKEDEV rz0h
# swapon /dev/rz0h
# swapon -s
7.5 Accessing Devices
Device special files must be present in the /dev
directory to access your system's disk and tape devices. Enter the ls /dev command to see if the required device special files exist.
If these files do not exist, use the MAKEDEV command to
create them.
# cd /dev
# ./MAKEDEV rz0
7.6 Mounting File Systems
The
UNIX shell is used to perform maintenance operations on existing file systems.
For instance, if the kernel (vmunix) on
your root file system becomes damaged and you have a good
backup, you can mount your root file system and replace
the damaged kernel. If you are using LSM volumes for the root
file system, refer to Section 7.9 for information about
how to start LSM.
The existing root file system is accessible
at /var/mnt and can be modified at this point.
# 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
7.7 Restoring File Systems
The UNIX shell is ideal for restoring damaged root file systems. To restore your root file
system, first create the device special files for the disk on which the root file system is to reside. Next create the device special files
for the tape device that contains the dump of the root
file system to be restored. Create these device special files using the MAKEDEV command as shown in Section 7.5.
7.7.1 Restoring UNIX File Systems (UFS)
Use the following procedure to restore a UNIX file system:
# disklabel -rw -t ufs rz0 rz57
Note
disklabel
(8) reference
page for more information.
# newfs /dev/rrz0a rz57
# mkdir /var/mnt
Digital
suggests creating mount points under the /var or /tmp directories.
# mount /dev/rz0a /var/mnt
# cd /var/mnt
# restore -Yrf /dev/rmt0h
7.7.2 Restoring Advanced File Systems (AdvFS)
Use the following procedure to restore AdvFS file systems:
# disklabel -rw -t advfs rz0 rz57
Note
disklabel
(8) reference page for
more information.
# mkfdmn -t rz57 /dev/rz0a root_domain
# mkfset domain fileset
The 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/mnt
Digital
suggests creating mount points under the /var or /tmp directories.
# mount root_domain#root /var/mnt
# cd /var/mnt
# vrestore -vxf /dev/rmt0h
Note
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 by
issuing the following command:
# swapon -a
7.8 Changing the Size of a Disk Partition
If you are using the text-based installation
interface, use the disklabel command and if you are using
the graphical installation interface, use the Disk Configuration application to change the drive identification or the disk partitions
on the drive or to replace a damaged label or bootstrap. 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). UFS boot blocks are installed by default if -t advfs is not specified. Refer to the disklabel
(8) reference page for
more information.
Note
# TERM=vt100
# export TERM
# EDITOR=vi
# export EDITOR
# disklabel -r /dev/rzn
In the
previous example, n is the unit number of the disk.
The system displays the existing disk partition layout.
# cd /dev
# ./MAKEDEV rz0
# disklabel -r rz0
If 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
Note
# EDITOR=ed
# export EDITOR
Note
# TERM=vt100
# export TERM
# EDITOR=vi
# export EDITOR
The examples shown in the remaining steps use the ed
text 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/p
This 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/p
This increases the size of the g
partition from 400 MB to 464 MB.
s/393216/262144/p
The revised information is displayed:
g: 950272 262144 unused 1024 8192 # (Cyl. 402*- 1519*)
1,$p
wq
The 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
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:
7.9 Starting the Logical Storage Manager
If the LSM daemons vold and voliod
fail to restart when your system is rebooted or the LSM configuration database
is corrupted, the LSM volume on which the root file system
exists will not be accessible. Under such circumstances your system cannot
be brought up to multiuser mode. To repair possible problems in /etc/vol/volboot or the rootdg diskgroup, use
LSM commands to rectify the problem.
# 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 list
Make sure
that all disks have a device special files in /dev.
# volprint -htA
# volume -g diskgroup -U usetype start volume_name
# mkdir -p /etc/fdmns/root_domain
# cd /etc/fdmns/root_domain
# ln -s /dev/vol/rootdg/rootvol rootvol
# mount root_domain#root /mnt
If 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
7.10 Using a Disk That Contains ULTRIX Partition Information
Any disk that was in use under Digital's ULTRIX operating system
will have a partition table. In such cases, the disklabel
command displays the ULTRIX partition information and gives you the following
options:
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
7.11 Returning to the Installation Procedure from the UNIX Shell
You must be at the root directory to restart
the installation from the UNIX shell.
# cd /
# restart
# cd /
# restart nogui
# halt
When the console mode
prompt (>>>) displays, enter:
>>> boot system_disk
Replace system_disk with the device
where the current root file system is located. The system
disk is usually an entry such as DKA0.