Disk Restoration

Disk Restoration and Dvhtool

I. Disk Restoration.

For the rare case when your system cannot boot IRIX due to the loss of the root filesystem, and conventional methods of attempting to restore individual files or directories fail to correct the problem, this procedure could be used if backup tapes were available that were written using relative pathnames.

If IRIX hangs or panic traps during the boot process, always attempt to fix the problem by repairing any corrupt or missing files, or attempt a rebuild of the kernel before you attempt a restore of the complete root.

Disk data errors will normally be corrected by adding any new bad spot block number to the bad spot table.

Also, fsck attempts to keep the filesystems in a good state of repair, but if fsck cannot correct the problem, and other methods also fail, then restoring the filesystems may be necessary.

Question: How could a filesystem be lost?


1. Terminal disk failure, and replacement of disk may be required.

2. Human error removed the filesystem.

3. The rare condition when formatting the disk is required.

4. The system lost power when IRIX was active.


This document explains how to:

A. Boot the mini-root.

B. Start a mini-root shell.

C. Restore the root and user filesystems using the special backup tape.

D. Restore critical files to the volume header using dvhtool.


Teach how to restore the root and user filesystems, and the volume directory files of sash, fx, and symmon after a terminal disk failure renders the disk useless and a new disk is added to the system or the problem of the existing disk is corrected using fx.

IV. Equipment

A. A functional Onyx or Challenge system.

B. An IRIX distribution CDROM containing the Installation Tools.

C. The root and user backup tape, written using relative.

V Procedure -  These procedures will be perform from the alternate console attached to the first serial port.

Throughout the text are comments that will explain what you are doing or what is about to happen as a result of executing a command.

  • Commands that you are required to enter, are indented, HIGHLIGHTED USING BOLD print next to the prompt that would be displayed, and will be surrounded by a double box. See example below:

# pwd

  • Occasionally you will be instructed to do something and the instructions are not indented, but they will still be in bold print and surrounded by the double box.
  • The stdout or stderr of each command, or terminal output that would result from something that you are required to do, will be beneath the command, left justified and HIGHLIGHTED USING ITALICS and surrounded by a single box. See example below:


  • The information comments (the bulk of the lab project) will be in normal print.

Software Installation Tools General Information

The IRIX operating system and all the optional software products are released as a set of CDROMs.

  • Partition 8 (volume header)

- sashARCS                The ARCS sash.

The 5.0 and 5.0.1 CDROMs contain only sashARCS, while the 5.1.1 CDROM contains the sash images for all the different CPU types.

- mr                             The mini-root.

- proml.03                  Code for I04 flash prom (Release 5.0 only).

- io4prom                   Code for I04 flash prom (Release 5.1.1).


  •  Partition 7

-  /dist                            The directory that holds:

- sa                              The standalone tools used for installing software.

- software images     The actual software images.

-  /stand                         The directory that holds:

- sashARCS                Another copy of the ARCS sash.

- fx.ARCS                   A copy of the ARCS fx.

- ide.IP19                   Copy of the CPU ide.

Copies of other sash, fx, and ide images are maintained in /stand for the other CPU types on the 5.1.1 CDROM.

- /insight                       SGI Bookshelves (5.1.1 release).

The Standalone Tools are, sash, fx, and the mini-root.

The mini-root, with it�s Install Utility (inst), is used to build a new operating system or update (add to) an existing system with additional software images.

In order to restore the filesystems from the backup tape written using relative pathnames, we need the mini-root, which is loaded into and runs out of the system disk swap partition. The mini-root, because it resides in the swap partition, and has the special directories of /root and /root/usr, which it mounts the root and user partitions to, can retrieve the files from tape, and because the pathnames are relative, the files are placed into the correct partitions as they stream off the tape.

Begin Actual Procedure.

STEP 1: Booting the Mini-Root and Starting the Install Tool (inst)

You must be in the PROM Monitor in order to boot the mini-root from the CDROM.

If fx is active, exit fx and return to the PROM monitor.

If fx is active execute the exit command


S I - WD95A SCSI controller 0

Sl - WD95A SCSI controller 1


System Maintenance Menu


1) Start System

2) Install System Software

3) Run Diagnostics

4) Recover System

5) Enter Command Monitor


Option ?

We will start the process by selecting choice #2: Install System Software.

The PROM Monitor will prompt you, asking you if the load device is a local or remote device.

The PROM Monitor will load sash from the volume header of the CDROM, and then sash will load the mini-root from partition 7 of the CDROM.

Once the mini-root is loaded, the Installation Tool (inst) is started, which you will immediately exit by starting a mini-root shell. Once in the shell, you will restore both of the filesystems.

The load from the CDROM will take several minutes, during which time dots are output to the screen to inform you that the load is progressing.

Let's load the mini-root.

Install the IRIX CDROM into the reader


Option 2


Installing System Software.


Press <Esc> to return to the menu.

1) Remote Tape 2) Remote Directory 3)[Local CD-ROM] 4) Local Tape  *a) Local SCSI CD-ROM drive 6


Enter l-4 to select source type, a to select the source, <esc> to quit, or <enter> to start


Enter l-4 to select source type, a to select the source, <esc> to quit, or <enter> to start: 3


Enter l-4 to select source type, a to select the source, <esc> to quit, or <enter> to start: return


Insert the installation CD-ROM, then press <enter>:


Insert the installation CD-ROM, then press <enter>: return


Copying installation program to disk.

. . . . . . . *. 10% . . . . . . . . . 20% . . . . . . . . . 30% . . . . . . . . . 40% . . . . . . . . . 50%

. . . . , . . . . 60% . . . . . . . . . 70% . . . . . . . . . 80% . . . . . . . . . 90% . . . . . . . . . 100%

Copy complete

IRIX Release sherwood-root IPl9 Version 09151452 System V

Copyright 1987- 1993 Silicon Graphics, Inc.

All Rights Reserved.

S 1 - WD95A SCSI controller 0 - single ended internal min xfer period loons

S 1 - WD95A SCSI controller 1 - differential internal min xfer period 1 OOns

ipg0: missing

ipg 1: missing

fxp0: missing

fxp 1: missing

Configuring EPC in 104 slot 3 padap 1 as et0

xylipi3: missing

xylipi2: missing

xylipi I : missing

xylipi0: missing

jag5: controller not installed

jag4: controller not installed

jag3: controller not installed

jag2: controller not installed

jag 1: controller not installed

jag0: controller not installed

root on dev 128,17; boot swap file on /dev/swap swplo 50000

Creating miniroot devices, please wait...

The system is coming up.

The system is ready

Current system date is <date and time> PST 1993


Dir Reorg: Mounting file systems:


Mounting file systems:


There is no valid filesystem on  /dev/dks/dks0d1s0.


Make new file system on /dev/dsWdksOdlsO?


 If you were performing a system build or update, inst assumes that a root filesystem already exists and it attempts to mount /dev/dsk/dks0d1s0 (the partition that holds the real root filesystem) onto the mini-root directory of /root.

Since format destroyed all the filesystems, inst informs you that no valid filesystem exists in the partition /dev/dsk/dks0d1s0, and it asks you if you want a filesystem created.

You must answer yes, so inst will execute the make filesystem command (mkfs) and create a blank filesystem in partition 0 (/dev/dsk/dks0d1s0).

The mini-root was itself created on a system that had all the devices that are listed as missing by this system. This is normal, just ignore the missing messages.

OK, answer yes to the prompt and let inst create the blank filesystem in partition 0 (/dev/dsk/dks0d1s0) and mount it at the mini-roots /root directory.

Make new filesystem on /dev/dsk/dks0d1s6? yes


/dev/dsk/dks0d1s6            on              /root


There is no valid filesystem on /dev/dsk/dks0d1s6


Make new filesystem on /dev/dsk/dks0d1s6?

After inst creates a filesystem in partition 0 (/dev/dsk/dks0d1s0) and mounts it at /root, it attempts to mount /dev/dsk/dks0d1s6 (partition 6) at the mini-roots /root/usr directory, but again discovers that no valid filesystem exists in partition 6, and asks you if a filesystem should be created in this partition. You will again answer with yes.

Make new filesystem on /dev/dsk/dks0d1s6? yes


/dev/dsk/dks0d1s6                on              /root/usr

Default location of new software is /CDROM/dist

If you are a first-time inst user, give the command 'help beginner'.

Inst Main Menu

1. from [source                           Specify location of software to be installed

2. list [keywords] [names]         Display information about software subsystems

3. go                                            Perform software installation and removal now

4. install [keywords] [names]    Select subsystems to be installed

5. remove [keywords] [names]   Select subsystems to be removed

6. keep [keywords] [names]       Do not install or remove these subsystems

7. step [keywords] [names]        Enter interactive mode for install/remove/keep

8. versions [args]                        Get information about installed software

9. help [topic]                             Get help in general or on a specific word

10. admin                                    Go to the Administrative Commands Menu

11. quit                                       Terminate software installation


After inst creates a filesystem in partition 6 (/dev/dsk/dksOdls6) and mounts it at /root/usr, it displays it's Main Menu.

If you were building or updating a system, you would select specific functions from this menu, but we do not want the install tool. We want to start a mini-root shell, therefore we will exit inst by executing sh.


When the mini-root is started, the system disks partition table is modified to allow the install tool to function correctly. When you quit the install tool, the partition table will be set back to its correct values by inst, therefore, while in the mini-root shell, do not forget how you got there and inadvertently attempt a reboot or shutdown. You must return to inst and select quit to insure that the partition table is returned to its normal settings.

Also, when you are normally in inst and want to quit, you would select quit and inst would ask you if you wanted to reboot the system. Since there is no root filesystem, the reboot would fail. Inst knows this and would not allow the reboot and would instead output an error message informing you that the root filesystem was not usable.

STEP 2: Starting a Mini-Root Shell.

Let's exit the install tool by starting a mini-root shell.

Inst> sh



 Now that we are in a mini-root shell, let's use the 1s command and look at the mini-root top level directory (/).

.cshrc           CDROM          dev        opt         sbin        unix.lP19

.login            bin                   etc        proc        tfnp        usr

.profile          debug              lib         root        mix        var

As you can see, the mini-root top directory (/) looks similar to the top directory of the IRIX root (/). The basic difference is the mini-root is running out of partition 1 (the swap partition) and not partition 0. Notice that the mini-root kernel is called unix.IP19 and that the special root directory exists.

The root directory is where partition 0 (/dev/dsk/dks0d1s0) was mounted after inst created a blank filesystem in it.

Let's see what filesystems are mounted.

# df -k


Filesystem                 Type          kbytes         use          avail           %use      Mounted on

/dev/root                    efs             23680         10096     13584          43%      /

/dev/dsk/dks0d1s0     efs              23994        12           23982          0%         /root

/dev/dsk/dks0d1s6     efs             1081184     12          1081172       0%         /root/usr

Your values may be different, but the same filesystems should be mounted.

Notice that the newly created filesystems are empty, 0% used.

STEP 3: Restoring the Root and User Filesystems.

All we have to do is move into the /root directory, install the backup tape, and restore the files of the root and user filesystems. The restore will take approximately 45 minutes.

# cd /root


Install the backup tape into the tape drive


Remove the distribution CDROM from the reader


# bru -xv


The files being restored will scroll up the screen.

When the prompt returns, the restore is complete.

Execute the disk free command (df) and verify that you actually restored the two filesystems. You will see that both root and usr are now quite fill.

# df -k


Remove the backup tape from the tape drive

 Now that both filesystems have been restored to their correct partitions, you are ready to restore fx, sash, and symmon to the volume directory of the volume header.

The utility dvhtool is used to copy files into the volume header.

II. Dvhtool

Dvhtool is a utility that allows the user to modify or display three of the sub-sections of a disk volume header: volume directory, parameters, and the partition table.

Both the mini-root and root filesystems have this command.

Two modes of operation exist: Interactive and Command Line.
  • Interactive

This mode is entered by executing the command without any options or arguments.

i.e. # dvhtool

When using this mode, the user will be prompted to enter commands that will instruct the program what to do.

  •  Command Line

    This mode allows experienced users of dvhtool to supply, on a single line, all the commands and data required to complete a desired operation. The operation executes without any prompts being displayed.

    i.e. # dvhtool -v c /stand/sash sash

    The lab project will guide you through interactive mode first, and then show you how individual tasks can be made much simpler using command line mode.

    STEP 1: Dvhtool Interactive Mode.

    Remember, you are still in the mini-root shell.

    Let's move to the top of the mini-root tree and start dvhtool.

    # cd /


    # dvhtool


    Volume? (/dev/rvh)

     You are being asked if you want to select the volume header of the system disk.  The default of (/dev/rvh) is linked to /dev/rdsk/dks0d1vh.  If you wanted another disk, then you would have to enter the actual device file, i.e. /dev/rdsk/dks1d1vh.

    We will accept the default device, because this is the disk that we want to restore sash and

    fx to. Later in the lab project, we will display the volume directory of the second disk drive, and to do this, the actual device file must be specified.

    Volume? (/dev/rvh) return


    Command? (read vd pt dp write bootfile or quit):


    You are now being asked to select a command or indicate what sub-section of the volume header that you want to access.

  •  Commands: read, write, and quit.

    -     read

    This command will read the volume header into a memory buffer.

    -     write

    This command will write the memory buffer back to the volume header.

    -     quit

    This terminates dvhtool and returns you to the mini-root or root.

  • Header Sub-sections: vd, pt, dp, and bootfile.

    -     vd

    This selects the volume directory.

    -     pt

    This selects the partition table.

    -     dp

    This selects the disk parameters.

    -     bootfile

    This allows the user to change the name of the bootfile variable of the bootinfo section. Since the Onyx/Challenge systems do not use this sub-section, this is not used.

    Let's select the volume directory (vd).

    Command? (read vd pt dp write bootfile or quit): vd




    Now you are being asked to select one of the functions that will affect the volume directory: a, c, d, g, or 1.

  • a Add a file to the volume directory from an IRIX filesystem.
  • c    Copy a file to the volume directory from an IRIX filesystem.

    This will over-write a file with the same name.

  • d    Delete a file from the volume directory.
  • g    Copy a file from the volume directory to an IRIX filesystem.
  • 1    List the contents of the volume directory.

Let's list the current contents of the volume directory.

When dvhtool was started, the contents of the volume header was read and placed into a memory buffer. The contents of the memory buffer is what you will be acting upon.



Current contents:

File name            Length                 Block #

sgilabel               512                       2

instinfo               512                       3



 Since you just formatted the drive (previous lab project) and are in the mini-root, two files should be present: sgilabel and instinfo.

  • S&label

    This file is created by fx when a default label is created.

  • Instinfo

The install tool (inst) creates this file and it defines the configuration of the volume header while the mini-root is running.

If you started dvhtool from IRIX, this file would not be present.

When you quit inst, this file is removed.


If this was a non-SCSI disk drive, then you would see a file called bsttab. This file is the bad spot table for non-SCSI drives, which is maintained in the volume header and not in an EPROM like it is for the SCSI drives.

Let's now copy the file sash into the volume directory.

Since dvhtool can be invoked from the mini-root (as we have done) or from IRIX, the pathname to the stand directory is different. The stand directory is where copies of sash and fx are maintained.

Stand Directorv Pathnames

From the mini-root:                   /root/stand

From IRIX:                               /stand

(d FILE, a UNIX-FILE FILE, c UNIX-FILE FILE, g FILE UNIX-FILE or l)? c /root/stand/sash sash




Let's look at the change.



Current contents:

File name                 Length            Block #

sgilabel                    512                  2

instinfo                     512                  3

sash:                         145408            4




The change was made to the image held in the memory buffer. You must now write the memory buffer back to the volume header.

To access the write command, depress return to move back to the top menu.



Command? (read, vd, pt, dp, write, bootfile, or quit):


OK, let's write the memory buffer back to the volume header.

Command? (read, vd, pt, dp, write, bootfile, or quit): write


Command? (read, vd, pt, dp, write, bootfile, or quit):


Now that we have restored sash to the system disk, let�s quit interactive mode and return to the mini-root.

Command? (read, vd, pt, dp, write, bootfile, or quit): quit




STEP 2: Dvhtool Command Line Mode.

Command line mode makes adding, deleting, copying, and listing files of the volume directory a very simple task.

We are going to perform the same task as we did in step 1, but this time, fx is the file that will be copied into the volume directory.

By specifying the -v option with the dvhtool command, we can supply all the required information necessary to complete the task.

The -v option identifies the volume directory as the sub-section of the volume header that we want to work on. A single letter will again identify the operation.
  • a    Add a file to the volume directory from an IRIX filesystem.
  • c Copy a file to the volume directory from an IRIX filesystem.

    This will over-write a file with the same name.

  • d    Delete a file from the volume directory.
  • g Copy a file from the volume directory to an IRIX filesystem.
  • 1    List the contents of the volume directory.

    Let's copy symmon and fx to the volume directory, and remember, we are still in the mini-root, therefore the pathnams are /root/stand/symmon and /root/stand/fx.

    # dvhtool -v c /root/standlsymmon symmon


    # dvhtool -v c /root/stand/fx fx


    Let�s look at the results of the above command.

    # dvhtool -v l


    Current contents:

    File name              Length             Block #

    sgilabel                       512                    2

    instinfo                       512                    3

    sash                      145408                    4

    symmon                234496                288

    fx                        275456                  746


    You can see that fx was written to the volume header as a result of the above command.

    STEP 3: Displaying the Volume Header of the Second Disk.

    This example will show you how to access disks other then the system disk.

    If you remember, when you started dvhtool, the pathname to the volume header was set to /dev/rvh. This is the pseudonym of the system disk.

    To access other disks, you must supply the actual device file of the disk that you want to access.

    You will again use command line mode.

    Let's display the volume header of the second disk.

    # dvhtool -v l /dev/rdsk/dks1d1vh


    Current contents:

    File name           Length              Block #

    sgilabel                   512                      2

    sash                  145408                       3

    fx                      275456                   287


    Notice that the inst configuration file instinfo is not present in this disks volume directory.

    STEP 4: Returning to the Install Tool.

    If you remember, we started the mini-root shell (using sh) while we were in the install tool (inst).

    I mentioned (at that time) that the install tool modifies the partition table to suit its own needs, and the current state of the partition table is not compatible with IRIX.

    You must return to inst and select quit, allowing inst to restore the volume header to the state that it was in before inst was started.

    Follow the procedure on the next page to exit the mini-root and terminate inst.

    Return to inst using exit.

    If you removed any files while you were in the shell, give the 'admin recalculate' command to update the disk space requirements.




    2. When inst is entered, execute quit.

    Inst> quit


    Please wait.. . . . .

    Ready to restart the system. Restart? [y,n]

     3. Answer yes, allowing inst to clean up the volume header.

    Ready to restart the system. Restart? [y,n] yes


    The system will now reboot into IRIX