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 UFSBy 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:
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.
File system /usr
Disk partition /dev/rz3g
File system /usr
Disk partition /dev/rz3g
File domain usr_domain
Fileset usr
Use the following procedure as a guide for converting the file system:
Log in as root on the system containing the /usr file system.
# mt rewind
# cd /usr
# vdump -0 .
Edit the /etc/fstab file.
/dev/rz3g /usr ufs rw 1 2
usr_domain#usr /usr advfs rw 1 0
# shutdown -h now
Reboot the system in single-user mode. See the Digital UNIX Guide to System Administration for instructions on invoking single-user mode.
# mount -u /
# mkfdmn /dev/rz3g usr_domain
# mkfset usr_domain usr
# mount -t advfs usr_domain#usr /usr
# vrestore -x -D /usr
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.
File system /usr
Disk partition /dev/rz3g
Intermediate file /tmp/usr_bck
File system /usr
Disk partition /dev/rz3g
File domain usr_domain
Fileset usr
Use the following procedure as a guide for converting the /usr file system:
Log in as root on the system containing the /usr file system.
# cd /usr
# vdump -0f /tmp/usr_bck /usr
/dev/rz3g /usr ufs rw 1 2
usr_domain#usr /usr advfs rw 1 0
Shut down the system by entering the following command:
# shutdown -h now
Reboot the system in single-user mode. See the Digital UNIX Guide to System Administration for instructions on invoking single-user mode.
# mount -u /
# mkfdmn /dev/rz3g usr_domain
# mkfset usr_domain usr
# mount -t advfs usr_domain#usr /usr
# vrestore -xf /tmp/usr_bck -D /usr
You can convert the /usr (UFS) file system on one disk to the equivalent /usr (AdvFS) file system on a different target disk.
File system /usr
Disk partition /dev/rz3g
File system /usr
Disk partition /dev/rz2c
Mount directory /usr.advfs
File domain usr_domain
Fileset usr
Use the following procedure as a guide for converting the /usr file system:
Log in as root on the system containing the /usr file system.
# mkfdmn /dev/rz2c usr_domain
# mkfset usr_domain usr
# mkdir /usr.advfs
# mount -t advfs usr_domain#usr /usr.advfs
# cd /usr
# vdump -0f - -D . | vrestore -xf - -D /usr.advfs
Edit the /etc/fstab file.
/dev/rz3g /usr ufs rw 1 2
usr_domain#usr /usr advfs rw 1 0
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.
File system root
Mount directory /newroot
Disk partition /dev/rz1a
File system root
Mount directory /newroot
Disk partition /dev/rz2a
File domain root_domain
Fileset root
Use the following procedure as a guide for converting the root file system:
Log in as root on the system containing the root file system.
# mkfdmn -r -t rz26 /dev/rz2a root_domain
# mkfset root_domain root
# mkdir /newroot
# mount -t advfs root_domain#root /newroot
# vdump 0f - / | (cd /newroot; vrestore -xf -)
# disklabel -r /dev/rrz2a > /tmp/rz2label
# disklabel -t advfs -r -R /dev/rrz2a /tmp/rz2label rz26
Edit the /etc/fstab file on the AdvFS root fileset to indicate the new root entry.
/dev/rz1a / ufs rw 1 1
root_domain#root / advfs rw 1 0
# shutdown -h now
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.
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.
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:
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.
File system /staff2
Mount directory /staff2
Disk partition /dev/rz2c
File system /staff2
Disk partition /dev/rz2c
File domain staff_domain
Fileset staff2
Use the following procedure as a guide for converting the /staff2 file system:
Log in as root on the system containing the /staff2 file system.
# mt rewind
# mount /staff2
# cd /staff2
# vdump -0 .
# unmount /staff2
# 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
# mount -t advfs staff_domain#staff2 /staff2
# vrestore -x -D /staff2
Edit the /etc/fstab file.
/dev/rz2c /staff2 ufs rw 1 2
staff_domain#staff2 /staff2 advfs rw 1 0
The converted /staff2 file system is ready to use.
You can transfer an existing data file system to a new system, then you can convert the file system to AdvFS.
File system /staff4
File system /staff4
Disk partition /dev/rz2c
Mount directory /staff4
File domain staff_domain
Fileset staff4
Use the following procedure as a guide for converting the staff4 file system:
# tar c /staff4
Log in as root user on the target system.
# mkfset staff_domain staff4
# mkdir /staff4
# mount -t advfs staff_domain#staff4 /staff4
# mt rewind
# tar x /staff4
staff_domain#staff4 /staff4 advfs rw
The staff_domain file domain now includes the staff4 fileset, which is ready to use.
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.
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:
Log in as root user.
# newfs /dev/rz2a rz26
# mkdir /newroot
# mount -t ufs /dev/rz2a /newroot
# vdump -0f - / | (cd /newroot; vrestore -xf -)
# disklabel -r /dev/rrz2a > /tmp/rz21abel
# disklabel -t ufs -r -R /dev/rrz2a /tmp/rz2label rz26
Edit the /etc/fstab file on the UFS file system to refer to the new root entry.
root_domain#root / advfs rw 1 0
/dev/rz2a / ufs rw 1 1
# shutdown -h now
Reset the boot default device, BOOTDEF_DEV, to the new root disk. (Refer to your hardware manual for specific information.)
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.
# vdump -0f /dev/rmt0a /staff2
# umount /staff2
# rmfset staff_domain staff2
# rmfdmn staff_domain
# newfs /dev/rz2c rz26
Edit your /etc/fstab file.
staff_domain#staff2 /staff2 advfs rw 1 0
/dev/rz2c /staff2 ufs rw 1 2
# mount -t ufs /dev/rz2c /staff2
# 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.