WRONGSEL
YOUR SELECTION IS NOT IN THE 0 - #SELIMIT RANGE Please try again
AANVANG
Copyright CourseWare Technologies Inc. 1985-1988
Lesson - 6
PERFORMING VARIOUS ADMINISTRATIVE TASKS
P0
Administrative Tasks|Topics to Learn|6-0|10,50
# Topic
--- -------
1 - Setting the System Clock
2 - Duplicating Magnetic Media
3 - Running System Diagnostics
4 - Hard Disk Partitioning
5 - Reloading the Operating System
6 - System Reconfiguration
7 - Lesson Review
0 - Return to the Main Menu
P1
Administrative Tasks|Setting the System Clock|6-1.1|13,55
The system clock can always be set by a superuser
with the date command.
On the other hand, most of the new hardware has a
battery-powered system clock, which keeps running even
when the system power is off. On such a system,
software setting of the system clock is rarely required.
The battery-powered clock is usually set through a
diagnostic program during the hardware configuration
phase and is independent of the operating system.
P2
Administrative Tasks|Duplicating Magnetic Media|6-2.1|16,54
There are legal ways under UNIX to duplicate
floppy disks, although your $95 DOS hardware card
may be the most dependable one.
The easiest way to duplicate disks or tapes
is with two identical disk or tape drives, then you
can copy directly from one onto the other.
If you have only one disk or tape drive, then
you must first copy the files from the source media
onto the hard disk (if there is enough space), remove
the source media and mount a new disk or tape, then
copy these files from the hard disk onto the destination
media using the tar program.
media using the cpio program.
Administrative Tasks|Duplicating Magnetic Media|6-2.1|11,57
The easiest way to duplicate disks or tapes is with
two identical disk or tape drives, then you can copy
directly from one onto the other.
If you have only one disk or tape drive then you
must first copy the files from the source media onto the
hard disk (if there is enough space), remove the source
media and mount a new disk or tape, then copy these files
from the hard disk onto the destination media. This is
usually done using the tar or cpio program.
P3
Administrative Tasks|Duplicating Magnetic Media|6-2.2|5,54
For media with a fixed record length (like dump
tapes), the recommended method for disk or tape
duplication is with dd - the disk dump utility.
This utility copies the data byte by byte without
regard for format unless a conversion is specified.
P4
Administrative Tasks|Duplicating Magnetic Media|6-2.3|10,54
When you have two drives, all data may be
dumped (copied) directly from the source media
onto the destination media as long as there is
enough space on the destination media.
When you have only one drive, use dd to copy
the whole tape or disk to a single file on your
hard disk, then use dd again to copy it back onto
a removable destination media.
P5
Administrative Tasks|Running System Diagnostics|6-3.1|13,54
Most computers in use today will automatically
run various diagnostic programs during the start-up
phase to verify the proper functioning of system
components, such as the system disk(s), memory, various
controllers, etc. If any errors are found, then a
diagnostic message is printed on the operator's console.
The same and more detailed diagnostic programs
are usually available with your system. Normally such
programs are provided on a disk or another booting
media to be used when a fully functioning UNIX system
is not available.
P6
Administrative Tasks|Running System Diagnostics|6-3.2|3,54
The diag program is used for setting up the
disk partition table, labelling the disk, and doing
read/write tests as well as for disk formatting.
P7
Administrative Tasks|Hard Disk Partitioning|6-4.1|7,54
One of the most useful and most powerful
features of the UNIX system is hard disk partitioning.
Partitioning divides the disk into partitions,
or regions on the disk, each of which corresponds to
one of the device entries in the /dev directory.
P8
Administrative Tasks|Hard Disk Partitioning|6-4.2|10,56
Hard-disk partitioning is the process of making
file systems. It is a function of:
1. the size of the hard disk(s),
2. the disk space required for project development,
3. the size of your operating system,
4. the size of the swap space, and
5. the normal virtual memory requirements of your
user environment, i.e., many people using a big
program require large amounts of virtual memory.
P9
Administrative Tasks|Hard Disk Partitioning|6-4.3|6,54
Your UNIX system is delivered with a set of possible
devices and their parameters. These parameters include
some hard disk information. The parameters are kept in
the file:
/usr/sys/conf/master
/etc/master
Administrative Tasks|Hard Disk Partitioning|6-4.3|6,54
Your UNIX system is delivered with a set of possible
devices and their parameters. These parameters include
some hard disk information. A template for the parameters
is in the file:
/sys/conf/GENERIC
P10
Administrative Tasks|Hard Disk Partitioning|6-4.4|16,54
Every functional UNIX system has at least two
file systems:
1. root - the root file system, and
2. swap - The swap file system - the secondary or
virtual memory. Waiting or sleeping processes can
be moved out to the swap space on the disk to make
room for active processes.
Usually, the system will have additional file
systems, or at least the capability to make them.
The file /etc/diskinfo holds the partition
parameters for various drives that have been approved for
your system.
Your UNIX system can support up to two hard disks,
and up to 7 file systems per hard disk.
Administrative Tasks|Hard Disk Partitioning|6-4.4|18,60
Every UNIX system has at least two file systems:
1. root - the root file system, and
2. swap - The swap file system - the secondary or
virtual memory. Waiting or sleeping processes can
be moved out to the swap space on the disk to make
room for active processes.
Usually, the system will have additional file systems,
or at least the capability to make them.
* On Berkeley systems, the file /etc/disktab holds the
default partition parameters for various drives that can
be used to create the disk partitions on your system.
New entries can be created with the diskpart command.
* Sun systems do not use either of these files; the
necessary information is kept on the disk itself.
P11
Administrative Tasks|Hard Disk Partitioning|6-4.5|17,61
The procedure for creating file systems on a hard disk
may be summarized as follows:
1. Format the disk with the disk formatting utility on
your system. This subdivides the disk, initializes
sectors by writing header and trailer information
(sector numbers and error correction codes) and locates
bad blocks, thus providing an empty but usable disk.
2. On the disk, create the file system or partition table
that specifies the starting blocks and the sizes of the
possible file systems.
3. In the /dev directory, make a special device file for
each intended file system.
4. Make the required file systems.
P12
Administrative Tasks|Hard Disk Partitioning|6-4.6|15,54
If the disk on which you intend to make the file
system is not formatted, be sure you have made all
the specified hardware connections, then format the
disk using the UNIX disk formatting utility unique to
your system, e.g.:
/etc/hdinit
After disk formatting, you may be able to separate
the disk into more than one partition for housing
additional operating systems (like Macintosh or DOS).
The UNIX utility for accomplishing this task is:
/etc/fdisk
Administrative Tasks|Hard Disk Partitioning|6-4.6|13,54
If the disk on which you intend to make the file
system is not formatted, be sure you've made all
the specified hardware connections, then format the
disk using the disk formatting utility unique to
your system, e.g.:
/etc/dkfmt, on the NCR Tower.
After disk formatting, you may be able to separate
the disk into more than one partition for housing
additional operating systems (like Macintosh or DOS).
Consult your System Administration Guide for details.
Administrative Tasks|Hard Disk Partitioning|6-4.6|16,54
If the disk on which you intend to make the file
system is not formatted, be sure you've made all the
specified hardware connections, then format the disk
using the disk formatting utility unique to your system.
(Remember, formatting will erase everything on the disk.)
On Berkeley systems, the format program is used
to format the disk; however, many systems offer dialog
utilities rather than a specific formatting command. On
Sun systems, the diag utility both formats and partitions
the disk.
The use of format on a Sun is not recommended because it
may erase valuable mapping information on the disk.
P13
Administrative Tasks|Hard Disk Partitioning|6-4.7|14,54
Once the hard disk is formatted, you can create
the partition or File System Table (FST). This table
resides on the disk itself and specifies the starting
blocks or cylinders for all the possible file systems.
The command for creating the FST will
be unique for your version of Unix, so consult your
System Administrator's Guide for details. On the NCR
Tower, commands that serve this function are:
/etc/dkpart and /etc/dkmaint
/etc/divvy
whose syntax is:
/etc/divvy -b block-device -c character-device]
[-p physical_drive [-i[proto][-m]
Administrative Tasks|Hard Disk Partitioning|6-4.7|4,54
Once the hard disk is formatted, you can create
the partition or file system table (FST). This table
resides on the disk itself and specifies the starting
blocks or cylinders for all the possible file systems.
P14
Administrative Tasks|Hard Disk Partitioning|6-4.8|13,54
Typically, the utility that divides the disk into
file systems also has provisions for:
* creating new file systems,
* changing the device names of file systems,
* changing boundaries of file systems, and
* removing file systems.
Since this utility uses the mkfs command you
must be aware of the fact that whenever a new file
system is made over an existing one, the existing
file system will be destroyed!
Administrative Tasks|Hard Disk Partitioning|6-4.8|15,62
Sun Systems: The utility for creating the table on
a Sun system is the stand-alone program diag. To use it,
you boot it stand-alone (without UNIX) from the system monitor.
diag asks you for information about your disk drive. diag
provides two different types of formatting; which type you
use depends on your disk interface technology. The label
command within the diag utility writes the file system
table on the disk. See your System Administrator Manual
for specific instructions.
Berkeley Systems: On pure Berkeley systems, the file
system table is built into the operating system. To change
it, you must change the operating system source code and
recompile the it. We don't recommend doing this unless
you are a very experienced user.
P15
Administrative Tasks|Hard Disk Partitioning|6-4.9|10,54
Once the file system table exists on the disk, the
special device files are made with the mknod
command, whose syntax is:
/etc/mknod name [c] [b] major minor
where as you recall c and b represent character and
and block special devices, and major and minor represent
major and minor device numbers for the special file
(which is the file system in this case).
Administrative Tasks|Hard Disk Partitioning|6-4.9|7,54
Once the partition table exists on the disk, the
special device files can be installed with the shell
script /dev/MAKEDEV, whose syntax is:
/dev/MAKEDEV device name
This script uses the mknod command.
P16
Administrative Tasks|Hard Disk Partitioning|6-4.10|5,52
The major and minor device numbers are not
random, they are entries in your UNIX kernel. Your
System Administration manuals will contain this
information.
The major device number for hard disks is 1;
the minor device numbers for the 1st disk are 40-47,
and for the second: 104-110, that is, one for each
possible file system. NOTE: the last file system
uses the entire disk.
Administrative Tasks|Hard Disk Partitioning|6-4.10|14,54
Use the newfs command when you want to make a
new file system or change some characteristics of
file system, such as the number of inodes.
For example, to make a new file system on /dev/hp02,
you would first enter:
newfs /dev/hp02
to make the partition of the disk that is associated
with /dev/hp02 available as a file system. Then you
can mount the new file system, e.g.:
mount /dev/hp02 /usr
P17
Administrative Tasks|Hard Disk Partitioning|6-4.11|16,54
Once the special device files exist along with
the FST, the file systems may be made; however, it
is recommended that you let your disk partitioning
utility do this task.
Use the mkfs command when you want to change
the number of inodes on the file system, or when
you want to make a file system on a removable
media such as a floppy disk. Type, for example:
mkfs /dev/rfd096ds15 1200 500 3 18
and then you can mount the new file system with:
mount /dev/rfd096ds15 /mnt
mkfs /dev/rsave 1404 550 7 18
and then you can mount the new file system, e.g.:
mount /dev/rsave /mnt
P18
Administrative Tasks|Hard Disk Partitioning|6-4.12|12,54
If indeed, you decide to make a new file system
on top of an existing one, then back up all the data
from the existing file system first and then make the
new file system. You should always run fsck on the
new file system.
Be especially careful with the root file system
and block 0 of a disk since it contains the boot program.
You should never destroy the root file system and the
old boot program before you have tested the new boot
block and the alternate root file system.
P19
Administrative Tasks|Hard Disk Partitioning|6-4.13|3,54
Your UNIX system resources include the primary
memory, the hard disks, cartridge and/or tape drives,
floppy disk drives, etc.
P20
Administrative Tasks|Hard Disk Partitioning|6-4.14|10,54
Optimum partitioning and division of resources is
a critical task of a system administrator. The larger
the UNIX System, the more options you are given to
control the resource partitioning and CPU priority
control.
P21
Administrative Tasks|Reloading the Operating System|6-5.1|12,54
You may need to reload the UNIX operating system
for several reasons:
* to install a new UNIX release,
* for system reconfiguration,
* to restore the system after a crash,
* for practice, etc.
Although UNIX reloading is performed very seldom,
a clear understanding of the procedure is essential for
a system administrator.
P22
Administrative Tasks|Reloading the Operating System|6-5.2|11,58
The biggest difficulty in the UNIX system installation
procedure is properly configuring all of the system
hardware. You may have additional disks, tape drives,
and terminal controllers which are not automatically
configured with your distribution software.
Your installation guide, your site management guide,
your system configuration guide, and most of all your
system's manufacturer's hardware and software support are
your initial sources for additional help.
P23
Administrative Tasks|Reloading the Operating System|6-5.3|13,54
With most current UNIX releases and versions, UNIX
reloading (reinstallation) is a cookbook operation.
On most systems, the procedure consists of:
1. Loading the UNIX kernel to be used for future
system boots from the hard disk.
2. Loading the essential UNIX utilities.
3. Loading the development and the communication
packages.
4. Loading the text processing system.
5. Loading any 3rd party software.
Administrative Tasks|Reloading the Operating System|6-5.3|12,54
With most current UNIX releases and versions, UNIX
reloading (reinstallation) is a cookbook operation.
If it is a non-root partition on your disk that is
corrupted, then you can:
1. reboot the system,
2. come up single-user,
3. make a new file system for the corrupted
partition with newfs, and
4. restore that partition from backup tapes.
P24
Administrative Tasks|Reloading the Operating System|6-5.4|15,60
If it is the root partition on your disk that is
corrupted, then you cannot boot in order to restore from
backup tapes so you must:
1. boot from your distribution media (cartridge or tape),
2. load a mini-root with a small kernel and utilities
in the swap partition (this makes the root a free
partition so you can make a new file system on it),
3. make a new file system for the corrupted root with
newfs, and
4. restore that partion from backup tapes.
NOTE: This is why you should always have an up to
date copy of the root partition. Remember that files like
/etc/passwd and /etc/ttys change rather often.