Administration Supplement for Solaris Platforms
只搜寻这本书
以 PDF 格式下载本书

Managing File Systems on a SPARC System

4

This chapter describes how to install a boot block on a ufs file system and format diskettes for use with both ufs and DOS file systems.
Use this table to proceed directly to the task-oriented sections.
How to Install a Boot Block on a ufs File Systempage 26
How to Format a Diskette for Use With a ufs File Systempage 26
How to Format a Diskette That Can Be Read on a DOS Systempage 27
How to Restore the root and /usr File Systemspage 28

SPARC Creating File Systems

SPARC Installing a Boot Block on a ufs File System
When the system is booted, the primary boot program, bootblk, executes and loads the /ufsboot program into memory. The boot block is normally installed during system installation. However, you may need to use this procedure if the root file system becomes damaged because you cannot restore the boot block from tape.
SPARC How to Install a Boot Block on a ufs File System
  1. Choose the slice you want to use as the bootable file system.

  2. If necessary, create the ufs file system.

    See File System Administration for instructions on creating a new file system.

  3. Type installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/devicename and press Return.

    The contents of the file /usr/lib/fs/ufs/bootblk (the boot block) are installed in sectors 1-15 of the slice you specify. Sector 0 contains the disk label.

    If you install the boot block on an alternate file system that you want to use for booting, specify the corresponding disk or slice when booting:


  ok boot disk1  

SPARC Creating a File System on a Diskette
SPARC How to Format a Diskette for Use With a ufs File System
Use double-sided high-density 3.5-inch diskettes (diskettes are marked "DS, HD").

CAUTION Caution - Reformatting destroys any files already on the diskette.

  1. Insert a 3.5-inch DS, HD diskette in the diskette drive.

  2. Type fdformat and press Return.

    The following messages are displayed:


  Press return to start formatting floppy in  
  /vol/dev/rdiskette0/unlabeled.  


SPARC - If there is a file system on the diskette and the diskette is mounted, you will get an error from fdformat. You must unmount the diskette by using umount and run fdformat again.

  1. Press Return.

    While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed.


  pluto% fdformat  
  Press return to start formatting floppy in  
  /vol/dev/rdiskette0/unlabeled.  
  ...............................................................  
  .................  
  pluto%  

  1. Run the newfs command to create a ufs file system on the diskette.

SPARC How to Format a Diskette That Can Be Read on a DOS System

CAUTION Caution - Reformatting destroys any files already on the diskette.

  1. Insert a 3.5-inch DS, HD diskette in the diskette drive.

  2. Type fdformat -d and press Return.

    The following message is displayed.


  Press return to start formatting floppy in  
  /vol/dev/rdiskette0/unlabeled.  

  1. Press Return.

    While the diskette is being formatted, a series of dots (...) is displayed. When formatting is complete, the prompt is redisplayed.


  pluto% fdformat -d  
  Press return to start formatting floppy in  
  /vol/dev/rdiskette0/unlabeled.  
  ...............................................................  
  .................  
  pluto%  

SPARC Restoring File Systems

Restoring a damaged root or /usr file system from a backup tape is not like other types of restore operations because the programs you need to run are in the damaged file system. You must boot the system from the installation CD and reload the file system, or you must connect the drive to another system and reload the file system from there.
Substitute the device name of the file systems to be repaired for the devicename variable identified in the procedures below. Refer to Chapter 1, "Accessing Devices on a SPARC System," if you need help identifying your device names.
SPARC How to Restore the root and /usr File Systems
  1. Boot from the Solaris 2.x installation CD.

    a. Insert the Solaris 2.x installation CD into the CD caddy. b. Insert the CD caddy into the CD-ROM drive.

    c. Use the following command to boot from the installation CD in single-user mode. Press Return.


  ok boot cdrom -sw  

  1. Use the format utility to repair and reallocate slices on the disk from the single-user mode # prompt.

    a. Locate and fix any bad blocks.

See the Peripherals Administration guide for information on using format to repair a disk.
b. Divide the disk into slices with the format command.
  1. Make a new file system with the newfs command and check the file system with the fsck command for each slice except swap.


  # newfs /dev/rdsk/devicename  
  # fsck /dev/rdsk/devicename  

  1. Run the installboot command to install a boot block for the file system.


  # installboot /usr/lib/fs/ufs/bootblk /dev/rdsk/devicename  

The root slice must have a boot block. See "Installing a Boot Block on a ufs File System" on page 26 for more information on installboot.
  1. Type mount /dev/dsk/devicename /mnt and press Return. The file system is mounted on a temporary mount point.


SPARC - To mount the file system, you specify the block device directory (/dev/dsk), not the raw device directory.

  1. Type cd /mnt and press Return.

    You have changed to the mount-point directory.

  2. Type tapes and press Return.

    This command creates the tape device entries.

  3. Write-protect the tapes for safety.

  4. Type ufsrestore rvf /dev/rmt/unit and press Return. The level 0 tape is restored.

  1. Remove the tape and load the next level tape in the drive.

    Always restore tapes starting with 0 and continuing from lowest to highest until you reach the highest level.

  1. Type ufsrestore rvf /dev/rmt/unit and press Return. The next level tape is restored.

  2. Repeat steps 9 and 10 for each additional tape.

  3. Type rm restoresymtable and press Return. Removes the restoresymtable file that is created and used by ufsrestore to check point the restore.

  4. Type cd / and press Return.

  5. Type umount /mnt and press Return.

    The root file system is unmounted.

  6. Type fsck /dev/rdsk/devicename and press Return. The restored file system is checked for consistency.

  7. Insert a new tape in the tape drive.

  8. Type ufsdump 0uf /dev/rmt/unit /dev/rdsk/devicename and press Return.

    A level 0 backup is performed. Always do an immediate backup of a newly created file system because ufsrestore repositions the files and changes the inode allocation.

  9. Repeat steps 5 through 19 for the /usr file system, if necessary.

  10. Type init 6 and press Return.

    The system is rebooted.