This appendix contains procedures you can use to convert a
/usr
file system, the root file system, and a data file system to
AdvFS.
It also includes 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.
The
vdump
and
vrestore
file formats
are compatible for Version 4 and Version 5.0 of the operating system software.
If you upgrade your system, recreate the domains, and restore the data from
backup (see
Chapter 3), your AdvFS filesets and domains
have the updated structure (see
Section 1.6.3).
C.1 Converting a /usr File System to AdvFS
During the initial installation of AdvFS, you can use AdvFS for the
/usr
file system.
Converting the
/usr
(UFS) file
system to AdvFS reduces the amount of time your system is down after a system
failure.
If you have not installed
/usr
on AdvFS, you can
do so with a backup tape, an intermediate file, or from a second disk.
C.1.1 Using a Backup Tape
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.
The following are required:
Root user privilege
Backup device and media
Five percent more disk space for the converted file system
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk3g
New AdvFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk3g
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.
Use the AdvFS
vdump
command to back up
the
/usr
file system to
/dev/tape/tape0
:
# mt rewind # cd /usr # vdump -0 .
Edit the
/etc/fstab
file:
Search for the entry that mounts
/usr
as
a UFS file system, such as:
/dev/disk/dsk3g /usr ufs rw 1 2
Replace it with one that mounts
/usr
as
an AdvFS file system:
usr_domain#usr /usr advfs rw 1 0
Shut down the system:
# shutdown -h now
Reboot the system in single-user mode. See System Administration for instructions on invoking single-user mode.
In single-user mode, mount the root file system as
rw
.
Create the
usr_domain
domain, and create
the
usr
fileset.
Use the
mkfdmn -F
command
to force the partition label to change from UFS to AdvFS and to avoid a warning
message.
# mount -u / # mkfdmn -F /dev/disk/dsk3g usr_domain # mkfset usr_domain usr
Mount the
usr
fileset on the
/usr
directory:
# mount -t advfs usr_domain#usr /usr
Restore the
/usr
file system from tape
to the
usr
fileset:
# vrestore -x -D /usr
Boot the system to multiuser mode.
When the system prompt
returns, the converted
/usr
file system is ready to use.
C.1.2 Using an Intermediate File
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.
The following are required:
Root user privilege
Disk space (on a different file system) for an intermediate file. (The file system containing the intermediate file can be on the same disk or a different disk.)
Five percent more disk space for the converted file system
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk3g
Intermediate file
/tmp/usr_bck
New AdvFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk3g
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.
Use the AdvFS
vdump
command to back up
the
/usr
file system to
/tmp/usr_bck
,
the intermediate file:
# cd /usr # vdump -0f /tmp/usr_bck /usr
Edit the
/etc/fstab
file:
Search for the entry that mounts
/usr
as
a UFS file system:
/dev/disk/dsk3g /usr ufs rw 1 2
Replace it with one that mounts
/usr
as
an AdvFS file system:
usr_domain#usr /usr advfs rw 1 0
Shut down the system:
# shutdown -h now
Reboot the system in single-user mode. See System Administration for instructions on invoking single-user mode.
In single-user mode, mount the root file system as
rw
, create the
usr_domain
domain, and create
the
usr
fileset.
Use the
mkfdmn -F
command to force the partition label to change from UFS to AdvFS and to avoid
a warning message.
# mount -u / # mkfdmn -F /dev/disk/dsk3g usr_domain # mkfset usr_domain usr
Mount the
usr
fileset on the
/usr
directory:
# mount -t advfs usr_domain#usr /usr
Restore the
/usr
file system from the intermediate
file to the
usr
fileset:
# vrestore -xf /tmp/usr_bck -D /usr
Boot the system to multiuser mode.
When the system prompt
returns, the converted
/usr
file system is ready to use.
You can convert the
/usr
(UFS) file system on one
disk to the equivalent
/usr
(AdvFS) file system on a different
target disk.
The following are required:
Root user privilege
A second disk labeled
unused
with 5% more
disk space for the converted file system
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk3g
New AdvFS configuration:
File system
/usr
Disk partition
/dev/disk/dsk2c
Mount directory
/usr.advfs
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.
Create a domain and fileset:
# mkfdmn /dev/disk/dsk2c usr_domain # mkfset usr_domain usr
Create a mount-point directory and mount the new fileset on the directory:
# mkdir /usr.advfs # mount -t advfs usr_domain#usr /usr.advfs
Change to the
/usr
directory:
# cd /usr
Be certain there is no activity on the system. (You can do this by bringing the system to single-user mode.) Copy the contents of the UFS file system to the AdvFS file system:
# vdump -0f - -D . | vrestore -xf - -D /usr.advfs
Edit the
/etc/fstab
file:
Search for the entry that mounts
/usr
as
a UFS file system, such as:
/dev/disk/dsk3g /usr ufs rw 1 2
Replace it with one that mounts
/usr
as
an AdvFS file system:
usr_domain#usr /usr advfs rw 1 0
Remove the temporary directory:
# umount /usr.advfs # rmdir /usr.advfs
Shut down and reboot the system.
When the system prompt returns,
the converted
/usr
file system is ready to use.
C.2 Converting the root File System to AdvFS
By converting the root file system to AdvFS, you can boot your system from an AdvFS domain and use AdvFS as the root (/) file system. The AdvFS root domain must reside on a single disk. During initial installation you can install root on the AdvFS file system. 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 domain can contain only one volume and must be large enough to accommodate the converted root file system.
You must have root user privilege, a second bootable disk (use partition
a
or
c
) and the AdvFS file system installed on
your system.
Assumed system configurations are as follows:
Existing UFS configuration:
File system
root
Mount directory /newroot
Disk partition
/dev/disk/dsk1a
New AdvFS configuration:
File system
root
Mount directory
/newroot
Disk partition
/dev/disk/dsk2a
Domain
root_domain
Fileset
root
Use the following procedure as a guide for converting the root file system. This example assumes a device called <disk>.
Log in as root on the system containing the root file system.
Create a domain and fileset:
# mkfdmn -r /dev/disk/dsk2a root_domain # mkfset root_domain root
Create a mount-point directory and mount the new fileset on the directory:
# mkdir /newroot # mount -t advfs root_domain#root /newroot
Be certain there is no activity on the system. (You can do this by bringing the system to single-user mode.) Restore the UFS root file system to the root fileset:
# vdump 0f - / | (cd /newroot; vrestore -xf -)
Make the disk with the root domain a bootable disk:
# disklabel -r /dev/rdisk/dsk2a > /tmp/dsk2label # disklabel -t advfs -r -R /dev/rdisk/dsk2a \ /tmp/dsk2label <disk>
Edit the
/etc/fstab
file on the AdvFS root
fileset to indicate the new root entry.
Search
/newroot/etc/fstab
for the entry
that mounts root as a UFS file system, such as:
/dev/disk/dsk1a / ufs rw 1 1
Replace it with one that mounts root as an AdvFS file system:
root_domain#root / advfs rw 1 0
After editing is complete, shut down the system:
# shutdown -h now
Reset the boot default device,
BOOTDEF_DEV
,
to point to the disk with the new root domain.
This procedure is hardware-specific.
Refer to your hardware manual for instructions.
Reboot the system to enable the AdvFS root file system.
The converted root file system is ready to use.
Because the AdvFS root domain is limited to one disk, you cannot use
the
addvol
command to extend the root domain.
C.3 Converting a Data File System to AdvFS
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.
To convert data file systems from UFS to AdvFS, you need a backup tape,
an intermediate file, a second disk, or a second system.
C.3.1 Using a Backup Tape
You can convert a data (UFS) file system to the equivalent data (AdvFS)
file system by backing up the existing file system to tape by using the
vdump
command and restoring it with the
vrestore
command to an AdvFS environment.
The following are required:
Root user privilege
Backup device and media
Five percent more disk space for the converted file system
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/staff2
Mount directory
/staff2
Disk partition
/dev/disk/dsk2c
New AdvFS configuration:
File system
/staff2
Disk partition
/dev/disk/dsk2c
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.
Use the AdvFS
vdump
command to back up
the
/staff2
file system to
/dev/tape/tape0
,
the default tape drive:
# mt rewind # mount /staff2 # vdump -0f /dev/tape/tape0 /staff2 # umount /staff2
Create the
staff_domain
domain and the
staff2
fileset.
Use the
mkfdmn -F
command to
force the partition label to change from UFS to AdvFS and to avoid a warning
message.
# mkfdmn -F /dev/disk/dsk2c staff_domain # mkfset staff_domain staff2
Mount the new fileset on the directory:
# mount -t advfs staff_domain#staff2 /staff2
Restore the
/staff2
file system from tape
to the
staff2
fileset:
# vrestore -xvf /dev/tape/tape0 -D /staff2
Edit the
/etc/fstab
file:
Search for the entry that mounted
/staff2
as a UFS file system:
/dev/disk/dsk2c /staff2 ufs rw 1 2
Replace it with one that mounts
/staff2
as an AdvFS file system:
staff_domain#staff2 /staff2 advfs rw 1 0
The converted
/staff2
file system is ready to use.
C.3.2 Using an Intermediate File
You can convert a data (UFS) file system to the equivalent data (AdvFS) file system by backing up the existing file system to a file and restoring it to an AdvFS environment.
The following are required:
Root user privilege.
Disk space (on a different file system) for an intermediate file. (The file system containing the intermediate file can be on the same disk or a different disk.)
Five percent more disk space for the converted file system.
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/staff2
Disk partition
/dev/disk/dsk3g
Intermediate file
/tmp/staff_bck
New AdvFS configuration:
File system
/staff2
Disk partition
/dev/disk/dsk3g
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
/usr
file system.
Use the AdvFS
vdump
command to back up
the
/staff2
file system to
/tmp/staff_bck
,
the intermediate file:
# vdump -0f /tmp/staff_bck /staff2
Create the
staff_domain
domain and the
staff2
fileset.
Use the
mkfdmn -F
command to
force the partition label to change from UFS to AdvFS and to avoid a warning
message.
# mkfdmn -F /dev/disk/dsk3g staff_domain # mkfset staff2
Edit the
/etc/fstab
file:
Search for the entry that mounts
/staff2
as a UFS file system:
/dev/disk/dsk3g /staff2 ufs rw 1 2
Replace it with one that mounts
/staff2
as an AdvFS file system:
/staff_domain#staff2 /staff2 advfs rw 1 0
Mount the
staff2
fileset on the
/staff2
directory by entering the following command:
# mount -t advfs staff_domain#staff2 /staff2
Restore the
/staff2
file system from the
intermediate file to the
staff2
fileset:
# vrestore -xf /tmp/staff_bck -D /staff2
The converted
/staff2
file system is ready to use.
C.3.3 Using a Second Disk
You can convert a data (UFS) file system on one disk to the equivalent data (AdvFS) file system on a different target disk.
The following are required:
Root user privilege
A second disk with 5% more disk space for the converted file system
AdvFS installed on your system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/staff2
Disk partition
/dev/disk/dsk3g
New AdvFS configuration:
File system
/staff2
Disk partition
/dev/disk/dsk2c
Mount directory
/staff2
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.
Create the
staff_domain
domain and
staff2
fileset:
# mkfdmn /dev/disk/dsk2c staff_domain # mkfset staff_domain staff2
Create a mount-point directory and mount the new fileset on the directory:
# mkdir /new_staff2 # mount -t advfs staff_domain#staff2 /new_staff2
Be certain there is no activity on the system. Copy the contents of the UFS file system to the AdvFS file system:
# vdump -0f - -D /staff2 | vrestore -xf - -D /new_staff2
Edit the
/etc/fstab
file:
Search for the entry that mounts
/staff2
as a UFS file system, such as:
/dev/disk/dsk3g /staff2 ufs rw 1 2
Replace it with one that mounts
/staff2
as an AdvFS file system:
staff_domain#staff2 /staff2 advfs rw 1 0
Unmount
/new_staff2
:
# umount /new_staff2
Unmount
/staff2
:
# umount /staff2
Remove the old directory:
# rmdir /staff2
Mount the new fileset:
# mount /staff2
You can transfer an existing data file system to a new system, then you can convert the file system to AdvFS.
The following are required:
Two systems and a common facility for transferring the files
such as the
tar
utility (see
tar
(1))
Root user privilege on the target system
Five percent more disk space for the converted file system
AdvFS installed on the target system
Assumed system configurations are as follows:
Existing UFS configuration:
File system
/staff4
New AdvFS configuration:
File system
/staff4
Disk partition
/dev/disk/dsk2c
Mount directory
/staff4
Domain
staff_domain
Fileset
staff4
Use the following procedure as a guide for converting the
staff4
file system:
Log in to the system containing the /staff4
file system and back up the file system to tape:
# tar c /staff4
Log in as root user on the target system.
Create the
staff_domain
domain and the
staff4
fileset:
# mkfdmn /dev/disk/dsk2c staff_domain # mkfset staff_domain staff4
Create a mount-point directory and mount the new fileset on the directory:
# mkdir /staff4 # mount -t advfs staff_domain#staff4 /staff4
Restore the
/staff4
file system from the
default tape drive,
/dev/tape/tape0
:
# mt rewind # tar x /staff4
Edit the
/etc/fstab
file to add an entry
that mounts
/staff4
as a UFS file system:
staff_domain#staff4 /staff4 advfs rw 1 0
The
staff_domain
domain now includes the
staff4
fileset, which is ready to use.
C.4 Converting from AdvFS to UFS
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.
C.4.1 Converting the root File System to UFS
To convert the root file system, you must mount a UFS disk while your AdvFS root fileset is mounted.
The following are required:
Root user privilege
A second bootable disk (You must use partition
a
.)
Assumed system configurations are as follows:
Existing AdvFS configuration:
File system
root
Disk partition
/dev/disk/dsk1a
Domain
root_domain
Fileset
root
New UFS configuration:
File system
root
Disk partition
/dev/disk/dsk2a
Use the following procedure as a guideline for converting your file system:
Log in as root user.
Create a UFS file system (on a device here called <disk>):
# newfs /dev/disk/dsk2a <disk>
Create a mount-point directory and mount the UFS file system:
# mkdir /newroot # mount -t ufs /dev/disk/dsk2a /newroot
Restore the AdvFS root file system to the
/dev/disk/dsk2a
UFS file system:
# vdump -0f - / | (cd /newroot; vrestore -xf -)
Make the disk containing the UFS file system a bootable disk:
# disklabel -r /dev/rdisk/dsk2a > /tmp/dsk21abel # disklabel -t ufs -r -R /dev/rdisk/dsk2a \ /tmp/dsk2label <disk>
Edit the
/etc/fstab
file on the UFS file
system to refer to the new root entry.
Search
/newroot/etc/fstab
for the entry
previously mounted as root for the AdvFS file system:
root_domain#root / advfs rw 1 0
Replace the entry with one that mounts root as a UFS file system:
/dev/disk/dsk2a / ufs rw 1 1
Shut down the system by entering the following command:
# shutdown -h now
Reset the boot default device,
BOOTDEF_DEV
,
to the new root disk.
(Refer to your hardware manual for specific information.)
Reboot the system to enable the UFS root file system.
C.4.2 Converting a Fileset to UFS
After the root file system is converted to UFS, you can convert your filesets.
The following are required:
Root user privilege
A tape or disk for back up
Assumed system configurations are as follows:
Existing AdvFS configuration:
Mount directory
/staff2
Domain
staff_domain
Fileset
staff2
New UFS configuration:
Mount directory
/staff2
Disk partition
/dev/disk/dsk2c
The following example assumes your AdvFS domain contains one volume and only one fileset. If the AdvFS domain contains multiple filesets, then you must create a separate UFS file system for each fileset.
Caution
Be sure to perform a full backup on all AdvFS filesets before you start the conversion.
Make a backup of the AdvFS fileset:
# vdump -0f /dev/tape/tape0 /staff2
Unmount the fileset:
# umount /staff2
Delete the fileset:
# rmfset staff_domain staff2
Remove the domain:
# rmfdmn staff_domain
Create the UFS file system for the specified disk type (on
a device here called <disk>).
(If the partition you are creating is currently
labeled AdvFS, you get a warning message.
Respond
yes
to override the AdvFS designation.)
# newfs /dev/disk/dsk2c <disk>
Edit your
/etc/fstab
file:
Search for the entry that mounts
/staff2
as an AdvFS fileset, such as:
staff_domain#staff2 /staff2 advfs rw 1 0
Replace it with one that mounts
/staff2
as a UFS file system:
/dev/disk/dsk2c /staff2 ufs rw 1 2
Mount the UFS file system:
# mount -t ufs /dev/disk/dsk2c /staff2
Use the
vrestore
command to load the files
from the backup into the UFS file system:
# vrestore -xvf /dev/tape/tape0 -D /staff2
If your domain contains multiple volumes, you must verify that the disk space allocated to a fileset does not exceed the limit of the UFS file system disk partition. You might need to create multiple UFS file systems to hold the filesets in the domain.