Appendix B: Converting File Systems


Home - Table of Contents - Appendix A - Next Chapter

This appendix contains procedures to convert a /usr file system, the root file system, and a data file system to AdvFS. Also included are instructions for converting your entire system from AdvFS to UFS.

The methods provided here are guidelines; that is, they are suggestions that illustrate the process of conversion. Specific file names, tape drives, and disk partitions depend on your system.

This appendix includes the following sections:

Converting a /usr File System Converting the Root File System Converting a Data File System Converting from AdvFS to UFS

Converting a /usr File System


Top of Page - Next Section

By converting the /usr file system to AdvFS, you can reduce the amount of time your system is down after a system failure. During the initial installation of AdvFS, you can install /usr on AdvFS. If you do not, you can use one of the following methods:


Using a Backup Tape


Top of Page - Previous Section - Next Section

You can convert the /usr (UFS) file system to an equivalent AdvFS file system by backing up the existing file system to tape and restoring it to an AdvFS environment.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the file system:

  1. Log in as root on the system containing the /usr file system.

  2. Use the AdvFS vdump command to back up the /usr file system to /dev/rmt0h, the default tape drive. Enter the following sequence of commands:
    # mt rewind
    
    # cd /usr
    # vdump -0 .
  3. Edit the /etc/fstab file.

    1. Search for the entry that mounts /usr as a UFS file system, such as:
      /dev/rz3g /usr ufs rw 1 2
      
    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr /usr advfs rw 1 0
      
  4. Shut down the system by entering the following command:
    # shutdown -h now
    
  5. Reboot the system in single-user mode. See the Digital UNIX Guide to System Administration for instructions on invoking single-user mode.

  6. In single-user mode, mount the root file system as rw , create the usr_domain file domain, and create the usr fileset by entering the following sequence of commands:
    # mount -u /
    
    # mkfdmn /dev/rz3g usr_domain
    # mkfset usr_domain usr
  7. Mount the usr fileset on the /usr directory by entering the following command:
    # mount -t advfs usr_domain#usr /usr
    
  8. While there is no activity on the system, restore the /usr file system from tape to the usr fileset by entering the vrestore command:
    # vrestore -x -D /usr
    
  9. Boot the system to multiuser mode. Once the system prompt returns, the converted /usr file system is ready to use.

Using an Intermediate File


Top of Page - Previous Section - Next Section

You can convert the /usr (UFS) file system to the equivalent AdvFS file system by backing up the existing file system to a file and restoring it to an AdvFS environment.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the /usr file system:

  1. Log in as root on the system containing the /usr file system.

  2. Use the AdvFS vdump command to back up the /usr file system to /tmp/usr_bck, the intermediate file. Enter the following sequence of commands:
    # cd /usr
    
    # vdump -0f /tmp/usr_bck /usr
  3. Edit the /etc/fstab file.
    1. Search for the entry that mounts /usr as a UFS file system:
      /dev/rz3g /usr ufs rw 1 2
      
    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr /usr advfs rw 1 0
      
  4. Shut down the system by entering the following command:

    # shutdown -h now
    
  5. Reboot the system in single-user mode. See the Digital UNIX Guide to System Administration for instructions on invoking single-user mode.

  6. In single-user mode, mount the root file system as rw, create the usr_domain file domain, and create the usr fileset by entering the following sequence of commands:
    # mount -u /
    
    # mkfdmn /dev/rz3g usr_domain
    # mkfset usr_domain usr
  7. Mount the usr fileset on the /usr directory by entering the following command:
    # mount -t advfs usr_domain#usr /usr
    
  8. While there is no activity on the system, restore the /usr file system from the intermediate file to the usr fileset by entering the following command:
    # vrestore -xf /tmp/usr_bck -D /usr
    
  9. Boot the system to multiuser mode. Once the system prompt returns, the converted /usr file system is ready to use.

Using a Second Disk


Top of Page - Previous Section - Next Section

You can convert the /usr (UFS) file system on one disk to the equivalent /usr (AdvFS) file system on a different target disk.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the /usr file system:

  1. Log in as root on the system containing the /usr file system.

  2. Create a file domain and fileset by entering the following sequence of commands:
    # mkfdmn /dev/rz2c usr_domain
    
    # mkfset usr_domain usr
  3. Create a mount-point directory and mount the new fileset on the directory by entering the following sequence of commands:
    # mkdir /usr.advfs
    
    # mount -t advfs usr_domain#usr /usr.advfs
  4. Change to the /usr directory:
    # cd /usr
    
  5. While there is no activity on the system, copy the contents of the UFS file system to the AdvFS file system by entering the following command:
    # vdump -0f - -D . | vrestore -xf - -D /usr.advfs
    
  6. Edit the /etc/fstab file.

    1. Search for the entry that mounts /usr as a UFS file system, such as:
      /dev/rz3g /usr ufs rw 1 2
      
    2. Replace the previous line with the following entry, which mounts /usr as an AdvFS file system:
      usr_domain#usr /usr advfs rw 1 0
      
  7. Shut down and reboot the system. Once the system prompt returns, the converted /usr file system is ready to use.

Converting the Root File System


Top of Page - Previous Section - Next Section

By converting the root file system to AdvFS you can boot your system from an AdvFS file domain and use AdvFS as the root (/) file system. The AdvFS root file domain must reside on a single disk. During initial installation of Digital UNIX, you can install root on AdvFS. If you do not, you can use the following method.

Note Before you begin the conversion, check the size of the existing UFS root partition. The target AdvFS root file domain can contain only one volume and must be large enough to accommodate the converted root file system.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the root file system:

  1. Log in as root on the system containing the root file system.

  2. Create a file domain and fileset by entering the following commands:
    # mkfdmn -r -t rz26 /dev/rz2a root_domain
    
    # mkfset root_domain root
  3. Create a mount-point directory and mount the new fileset on the directory by entering the following commands:
    # mkdir /newroot
    
    # mount -t advfs root_domain#root /newroot
  4. Restore the UFS root file system to the root fileset by entering the following command:
    # vdump 0f - / | (cd /newroot; vrestore -xf -)
    
  5. Make the disk with the root file domain a bootable disk using the following commands:
    # disklabel -r /dev/rrz2a > /tmp/rz2label
    
    # disklabel -t advfs -r -R /dev/rrz2a /tmp/rz2label rz26
  6. Edit the /etc/fstab file on the AdvFS root fileset to indicate the new root entry.

    1. Search /newroot/etc/fstab for the entry that previously mounted root as a UFS file system, such as:
      /dev/rz1a / ufs rw 1 1
      
    2. Replace the previous line with the following entry, which mounts root as an AdvFS file system:
      root_domain#root / advfs rw 1 0
      
  7. After editing is complete, shut down the system using the following command:
    # shutdown -h now
    
  8. Reset the boot default device, BOOTDEF_DEV, to point to the disk with the new root file domain. This procedure is hardware-specific. Refer to your hardware manual for instructions.

  9. Reboot the system to enable the AdvFS root file system.

The converted root file system is ready to use.

Because the AdvFS root file domain is limited to one disk, you cannot use the addvol command to extend the root file domain.


Converting a Data File System


Top of Page - Previous Section - Next Section

By converting your data file systems to AdvFS, you can eliminate lengthy reboots. Moreover, you can easily modify your file-system configurations to meet changing system requirements.

There are two different methods for converting data file systems from UFS to AdvFS:


Using a Backup Tape


Top of Page - Previous Section - Next Section

You can convert a data (UFS) file system to the equivalent data (AdvFS) file system by backing up the existing file system to tape with the vdump command and restoring it with the vrestore command to an AdvFS environment.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the /staff2 file system:

  1. Log in as root on the system containing the /staff2 file system.

  2. Use the AdvFS vdump command to back up the /staff2 file system to /dev/rmt0h, the default tape drive. Enter the following sequence of commands:
    # mt rewind
    
    # mount /staff2
    # cd /staff2
    # vdump -0 .
    # unmount /staff2
  3. Create a file domain and fileset by entering the following sequence of commands. After creating the file domain, you need to confirm that you want to write over the UFS file system.
    # mkfdmn /dev/rz2c staff_domain
    
    Partition(s) which overlap /dev/rz2c are marked in use.
    If you continue with the operation you can possibly destroy existing data.
    CONTINUE? [Y/n]y
    # mkfset staff_domain staff2
  4. Create a mount-point directory and mount the new fileset on the directory by entering the following sequence of commands:
    # mount -t advfs staff_domain#staff2 /staff2
    
  5. Restore the /staff2 file system from tape to the staff2 fileset by entering the following command:
    # vrestore -x -D /staff2
    
  6. Edit the /etc/fstab file.

    1. Search for the entry that previously mounted /staff2 as a UFS file system:
      /dev/rz2c /staff2 ufs rw 1 2
      
    2. Replace the previous line with the following entry, which mounts /staff2 as an AdvFS file system:
      staff_domain#staff2 /staff2 advfs rw 1 0
      

The converted /staff2 file system is ready to use.


Using a Second System


Top of Page - Previous Section - Next Section

You can transfer an existing data file system to a new system, then you can convert the file system to AdvFS.

Requirements

Assumptions

Procedure

Use the following procedure as a guide for converting the staff4 file system:

  1. Log in to the system containing the /staff4 file system and back up the file system using the following command:
    # tar c /staff4
    
  2. Log in as root user on the target system.

  3. Create a fileset in the staff_domain file domain by entering the following command:
    # mkfset staff_domain staff4
    
  4. Create a mount-point directory and mount the new fileset on the directory by entering the following sequence of commands:
    # mkdir /staff4
    
    # mount -t advfs staff_domain#staff4 /staff4
  5. Restore the /staff4 file system from the default tape drive, /dev/rmt0h, by entering the following sequence of commands:
    # mt rewind
    
    # tar x /staff4
  6. Edit the /etc/fstab file. Add the following line, which mounts /staff4 as an AdvFS file system:
    staff_domain#staff4 /staff4 advfs rw
    

The staff_domain file domain now includes the staff4 fileset, which is ready to use.


Converting from AdvFS to UFS


Top of Page - Previous Section - Next Section

Converting your entire system from AdvFS to UFS is a multistep process. You first convert the AdvFS root file system to UFS. Then you convert each AdvFS fileset to a UFS file system.


Converting the Root to UFS


Top of Page - Previous Section - Next Section

To convert the root file system, you must mount a UFS disk while your AdvFS root fileset is mounted. Use the following procedure as a guideline for converting your file system:

  1. Log in as root user.

  2. Create a UFS file system:
    # newfs /dev/rz2a rz26
    
  3. Create a mount-point directory and mount the UFS file system:
    # mkdir /newroot
    
    # mount -t ufs /dev/rz2a /newroot
  4. Restore the AdvFS root file system to the /dev/rz2a UFS file system:
    # vdump -0f - / | (cd /newroot; vrestore -xf -)
    
  5. Make the disk containing the UFS file system a bootable disk:
    # disklabel -r /dev/rrz2a > /tmp/rz21abel
    
    # disklabel -t ufs -r -R /dev/rrz2a /tmp/rz2label rz26
  6. Edit the /etc/fstab file on the UFS file system to refer to the new root entry.

    1. Search /newroot/etc/fstab for the entry previously mounted as root for the AdvFS file system:
      root_domain#root / advfs rw 1 0
      
    2. Replace the previous line with the following entry which mounts root as a UFS file system:
      /dev/rz2a / ufs rw 1 1
      
  7. Shut down the system by entering the following command:
    # shutdown -h now
    
  8. Reset the boot default device, BOOTDEF_DEV, to the new root disk. (Refer to your hardware manual for specific information.)

  9. Reboot the system to enable the UFS root file system.

Converting a Fileset to UFS


Top of Page - Previous Section

Once the root file system is converted to UFS, you can convert your filesets. The following example assumes your AdvFS file domain contains one volume and only one fileset. If the AdvFS file domain contains multiple filesets, then you must create a separate UFS file system for each fileset.

Caution Be sure you perform a full backup on all AdvFS filesets before you start the conversion.

  1. Make a backup of the AdvFS fileset to your backup device:
    # vdump -0f /dev/rmt0a /staff2
    
  2. Unmount the fileset:
    # umount /staff2
    
  3. Delete the fileset:
    # rmfset staff_domain staff2
    
  4. Remove the file domain using the rmfdmn command:
    # rmfdmn staff_domain
    
  5. Create the UFS file system for the specified disk type:
    # newfs /dev/rz2c rz26
    
  6. Edit your /etc/fstab file.

    1. Search for the entry that mounts /staff2 as an AdvFS fileset, such as:
      staff_domain#staff2 /staff2 advfs rw 1 0
      
    2. Replace the previous line with the following entry, which mounts /staff2 as a UFS file system:
      /dev/rz2c /staff2 ufs rw 1 2
      
  7. Mount the UFS file system:
    # mount -t ufs /dev/rz2c /staff2
    
  8. Use the vrestore command to load the files from the backup into the UFS file system:
    # vrestore -xvf /dev/rmt0a -D /staff2
    

If your file domain contains multiple volumes, you must verify that the disk space allocated to a fileset will not exceed the limit of the UFS file system disk partition. You may need to create multiple UFS file systems to hold the filesets in the file domain.


Home - - Appendix A - Next Chapter - Top of Page
© Copyright Digital Equipment Corporation 1996
All rights reserved