Converting the byte order of a file system

Use the fscdsconv command to migrate a file system from one system to another.

To convert the byte order of a file system

  1. Determine the disk layout version of the file system that you will migrate:

    # fstyp -v /dev/vx/dsk/filesystem | grep version
    
    magic a501fcf5 version 7 ctime Thu Jun 1 16:16:53 2006

    Only file systems with Version 6 or later disk layout can be converted. If the file system has an earlier disk layout version, convert the file system to Version 6 or Version 7 disk layout before proceeding.

    See the vxfsconvert(1M) manual page.

    See the vxupgrade(1M) manual page.

  2. 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.

  3. 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. Having the same level of failure tolerance reduces the number of failure scenarios that would require trestoration from the backup.

  4. Unmount the file system to be converted:

    # umount mount_point
  5. Use the fscdsconv command to export the file system to the required target:

    # fscdsconv -f recovery_file -t target -e special_device

    target specifies the system to which you are migrating the file system.

    recovery_file is the name of the recovery file to be created by the fscdsconv command. special_device is the raw device or volume that contains the file system to be converted.

    Include the file system that you chose in 3 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.

    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 will remove the file after a system reboot, such as that which occurs with the /tmp and /var/tmp directories on the Solaris operating system.

    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

    The recovery file is used only when the byte order of the file system must be converted to suit the specified migration target.

  6. 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.

  7. Based on the information provided regarding the migration target, fscdsconv constructs and displays the complete migration target and prompts the use to verify all details of the target. If the migration target must be changed, enter n to exit fscdsconv without modifying the file system. At this point in the process, fscdsconv has not used the specified recovery file.

  8. If the byte order of the file system must be converted to migrate the file system to the specified target, fscdsconv prompts you to confirm the migration. Enter y to convert the byte order of the file system. If the byte order does not need to be converted, a message displays indicating this fact.

  9. The fscdsconv command indicates if any files are violating the maximum file size, maximum UID, or maximum GID limits on the specified target and prompts you if it should continue. If you must take corrective action to ensure that no files violate the limits on the migration target, enter n to exit fscdsconv. At this point in the process, fscdsconv has not used the specified recovery file.

    If the migration converted the byte order of the file system, fscdsconv created a recovery file. The recovery file is not removed after the migration completes, and can be used to restore the file system to its original state if required at a later time.

  10. 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 such cases, 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_device
    

    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.

  11. 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 10.

    Under some circumstances, you will be required to restore the file system from the backup, 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.

More Information

Specifying the migration target