Converting a File System
Use the fscdsconv command to convert the byte order of a file system.
To convert the byte order of a file system
-
Determine if you must convert the file system (see When to Convert a File System).
-
Determine the disk layout version of the file system that you must convert.
# fstyp -v /dev/vx/dsk/filesystem | grep version
magic a501fcf5 version 6 ctime Tue Jul 22 16:16:53 2003
Only file systems with Version 6 disk layout can be converted. If the file system has an earlier disk layout version, convert the file system to Version 6 disk layout before proceeding (see the vxfsconvert(1M) and vxupgrade(1M) manual pages).
-
Perform a full file system back up. Failure to do so could result in data loss or data corruption under some failure scenarios in which restoring from the backup is required.
-
Designate a file system with free space where fscdsconv may create a file that will contain recovery information for usage in the event of a failed conversion. Depending on the nature of the file system to be converted, for example if it is mirrored, you may wish to designate the recovery file to reside in a file system with the same level of failure tolerance so as to reduce the number of failure scenarios that would require the use of the backup created in step 3.
-
Unmount the file system to be converted.
# umount mount_point
-
Use the fscdsconv command to convert the file system.
# fscdsconv -f recovery_file special
recovery_file is the name of the recovery file to be created by the fscdsconv command. special is the raw device or volume that contains the file system to be converted. Include the file system chosen in step 4 when designating the recovery file. For example, if the file system chosen to contain the recovery file is mounted on /data/fs3, the recovery file could be specified as /data/fs3/jan04recovery. If there is not enough disk space on the chosen file system for the recovery file to be created, the conversion aborts and the file system to be converted is left intact.
Note
The recovery file is not only used for recovery purposes after a failure, but is also used to perform the conversion. The directory that will contain the recovery file should not allow non-system administrator users to remove or replace the file, as this could lead to data loss or security breaches. The file should be located in a directory that is not subject to system or local scripts that might cause the file's removal after a system reboot, such as that which occurs with the /tmp and /var/tmp directories on the Solaris OS.
The recovery file is almost always a sparse file. The disk utilization of this file can best be determined by using the following command: du -sk filename
If you are converting multiple file systems at the same time, which requires the use of one recovery file per file system, record the names of the recovery files and their corresponding file systems being converted in the event that recovery from failures is required at a later time.
-
After some time, fscdsconv creates the recovery file and prompts for confirmation to proceed with the conversion.
Do you wish to commit to conversion? (y/n)
- Inputting n causes fscdsconv to remove the recovery file and leave the file system intact.
- Inputting y causes fscdsconv to proceed with the conversion. No other interactions are required. The recovery file is not removed after the conversion completes. The recovery file can be used to restore the file system to its orginal state. Some situations in which the recovery file can be used are if the conversion is done accidentally or if no conversion is necessary. For example, migrating a file system from the Solaris operating system to the AIX operating system does not require a conversion because both operating systems use the big endian format.
-
If a failure occurs during the conversion, the failure could be one of the following cases:
- System failure.
- fscdsconv failure due to program defect or abnormal termination resulting from user actions.
In either case, the file system being converted is no longer in a state in which it can be mounted or accessed by normal means through other VxFS utilities. To recover the file system, invoke the fscdsconv command with the recovery flag, -r:
# fscdsconv -r -f recovery_file special
When the -r flag is specified, fscdsconv expects the recovery file to exist and that the file system being converted is the same file system specified in this second invocation of fscdsconv.
-
After invoking fscdsconv with the -r flag, the conversion process will restart and complete, given no subsequent failures. In the event of another failure, repeat step 8.
Under some circumstances, you will be required to restore the file system from the backup created in step 3, such as if the disk fails that contains the recovery file. Failure to have created a backup would then result in total data loss in the file system. I/O errors on the device that holds the file system would also require a backup to be restored after the physical device problems are addressed. There may be other causes of failure that would require the use of the backup.
|