VxVM : Convert a UFS filesystem to VxFS filesystem ( prior to VxVM 3.4 )

For VxFS versions previous to version 3.4, the only real conversion method involves a backup of the UFS data and a restore of the data to a new VxFS filesystem.  It is impossible to “convert” a filesystem without some downtime.

One way to convert is to simply backup & restore.  This example assumes that ‘vol01’ contains a UFS filesystem and you want to “convert” it to be a VxFS filesystem.  This example shows the backup being done to a tape.  You could, of course, backup to a datafile if you so desire.

1.  Unmount the UFS filesystem and backup the filesystem.

# umount /data

# ufsdump 0f /dev/rmt/0c /dev/vx/rdsk/vol01

2.  Create a VxFS on the disk or volume.

# mkfs -F vxfs /dev/vx/rdsk/vol01

3.  Mount the new/empty VxFS filesystem

# mount -F vxfs /dev/vx/dsk/vol01 /data

4.  Restore the data from tape

# cd /data

# ufsrestore xf /dev/rmt/0c

5.  Change the /etc/vfstab file appropriately:

from: /dev/vx/dsk/vol01 /dev/vx/rdsk/vol01 /data ufs  1 yes –

to:   /dev/vx/dsk/vol01 /dev/vx/rdsk/vol01 /data vxfs 1 yes –

If you have enough storage on your system to have two copies of the data simultaneously, you could follow the following generic example. This example assumes that ‘vol01’ contains a UFS filesystem and ‘vol02’ will contain the new VxFS filesystem.

1.  Create a VxFS filesystem on the new disk or volume.

# mkfs -F vxfs /dev/vx/rdsk/vol02

2.  Unmount the original UFS filesystem.

# umount /data

3.  Mount this empty VxFS filesystem on the mount point.

# mount -F vxfs /dev/vx/dsk/vol02 /data

4.  Run the ‘ufsdump’ command and pipe the output to ‘ufsrestore’ to “copy” the data from the UFS filesystem to the VxFS filesystem.

# ufsdump 0f – /dev/vx/rdsk/vol01 | (cd /data; ufsrestore xf -)

5.  Change the /etc/vfstab file appropriately:

from: /dev/vx/dsk/vol01 /dev/vx/rdsk/vol01 /data ufs  1 yes –

to:   /dev/vx/dsk/vol02 /dev/vx/rdsk/vol02 /data vxfs 1 yes –

6.  You can now safely remove the “old” (vol01) volume now.

NOTE: Many people get confused that they are using ‘ufsrestore’ to restore data to a VxFS filesystem.  Realize that the backup was created with ‘ufsdump’, so you must use ‘ufsrestore’ to read that backup.  ‘ufsrestore’ will restore data not filesystem structure. Please don’t let this confuse you… it works, and it’s supported.



I have started unixadminschool.com ( aka gurkulindia.com) in 2009 as my own personal reference blog, and later sometime i have realized that my leanings might be helpful for other unixadmins if I manage my knowledge-base in more user friendly format. And the result is today's' unixadminschool.com. You can connect me at - https://www.linkedin.com/in/unixadminschool/

What is in your mind, about this post ? Leave a Reply

  Our next learning article is ready, subscribe it in your email

What is your Learning Goal for Next Six Months ? Talk to us