Logical Volume Manager (LVM) is the native volume manager in the Linux operating system and comes with many great features and capability to extend the filesystem. But, it cannot overweigh the features of Veritas Volume Manager (VxVM), which gives you stupendous features, which you can use with your file system, like recovering data. In this article, we will tell you how to convert the LVM file system to VxFS without losing data.
Features of Veritas Volume Manager (VxVM)
If you are thinking, about why someone would like to convert the logical volume manager (LVM) file system to the Veritas file system (VxFS), then you must check some of the main features below. Check full list of notable features on Veritas website.
- Concatenation, Spanning, Striping.
- Dynamic Multi-Pathing (DMP) for Active/Passive and Active/Active devices.
- Free Space Management
- Multiple mirroring with up to 32 mirror copies of a volume’s address space.
- Hot-relocation
- Online Data Migration
- Concatenation, Spanning, Striping.
- Dynamic Multi-Pathing (DMP) for Active/Passive and Active/Active devices.
- Free Space Management
- Multiple mirroring with up to 32 mirror copies of a volume’s address space.
- Hot-relocation
- Online Data Migration
Above were some of the features of Veritas volume manager (VxVM) that you would like to consider. Now, let’s begin and see how to convert the LVM file system to VxFS.
Steps To Convert LVM File System to VxFS
1. If you are going to convert your LVM file system to Veritas Volume Manager VxFS, first of all you should have LVM filesystem. So choose your file system which you are going to convert to VxFs.
2. Once your Logical Volume Manager (LVM) file system is chosen, install the Veritas Volume Manager (VxVM), skip if you have already installed it.
3. Now, create VXVM volume of the same size as LVM filesystem. Learn here to create VXVM volume and mount it.
Now, it’s your turn to migrate your LVM file system to the VxFS file system.
4. To migrate native filesystem to VxFS, the next thing we have to do, is to check if they are compatible or not. So, we will use “fsmigadm analyze” command for this like below.
In this test, all results should pass.
[root@server ~]# fsmigadm analyze /dev/vx/rdsk/mydg/myvol /data UX:vxfs fsmigadm: INFO: V-3-26817: Source Device is: /dev/mapper/datavg-datalv -- Target Device is: /dev/vx/rdsk/mydg/myvol UX:vxfs fsmigadm: INFO: V-3-28433: check1: Checking Source File System size and Target Volume size: passed UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/grub2.cfg with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/log/vxconfigd.log with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/bin/vxrootmir with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/lib/vxcommon with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/diag.d/vxcodb with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/gen/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/swap/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/relayout/vxmend with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/root/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/raid5/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/fsgen/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/type/boot/vxinfo with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/voladm.d/help/disk.vmove.help with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/voladm.d/bin/disk.nohotuse-off with No such file or directory UX:vxfs fsmigadm: ERROR: V-3-26792: stat failed on directory /data/my/vx/voladm.d/lib/vxcds_dgconv.ksh with No such file or directory check2: Checking Source File System for Extended Attributes: passed* Check log file for warnings passed* Check log file for warnings passed* Check log file for warnings passed* check3: Checking Max file size compatibility: passed check4: Checking Max symbolic link file size compatibility: passed All checks passed, migration can be started UX:vxfs fsmigadm: INFO: V-3-26819: The migration Analysis Report is generated in: /var/log/Analyze_data file [root@server ~]#
You must be seeing some errors in the above command, but note all the check passed and that is what we want. Check for extended attributes may report some files with unsupported attributes, so don’t worry.
Now you can also check the report generated for this compatibility test at /var/log/Analyze_data file. It will look something like below.
[root@server ~]# more /var/log/Analyze_data UX:vxfs fsmigadm: INFO: V-3-27992: check1: Checking Source File System size and Target Volume size UX:vxfs fsmigadm: INFO: V-3-27995: Source File System Device: /dev/mapper/datavg-datalv UX:vxfs fsmigadm: INFO: V-3-27996: Source File System type: ext4 UX:vxfs fsmigadm: INFO: V-3-27997: Source File System size: 2046640128 bytes UX:vxfs fsmigadm: INFO: V-3-27998: Target File System Device: /dev/vx/dsk/mydg/myvol UX:vxfs fsmigadm: INFO: V-3-27999: Target device size: 2147483648 bytes UX:vxfs fsmigadm: INFO: V-3-27994: check1: passed check2: Checking Source File System for Extended Attributes VxFS file-system only supports system.posix_acl_access, system.posix_acl_default, security and system extended attributes. Other extended attributes will not be preserved. Following files have unsupported Extended attributes: File: /data/my/vx/vold_inquiry/socket -- Problem in accessing extended attribute for file: Error - 6. File: /data/my/vx/vold_request/socket -- Problem in accessing extended attribute for file: Error - 6. File: /data/my/vx/vold_diag/socket -- Problem in accessing extended attribute for file: Error - 6. check2: passed check3: Checking Max file size compatibility check3: passed check4: Checking Max symbolic link file size compatibility No symbolic link file has unsupported size check4: passed Report Summary All checks passed, migration can be started [root@server ~]#
5. Now, after verifying that all tests are passed in the above step, start your migration. It will take some time depending on your file system size.
[root@server ~]# fsmigadm start -y /dev/vx/rdsk/mydg/myvol /data passed UX:vxfs fsmigadm: INFO: V-3-27018: Source Device: /dev/mapper/datavg-datalv Target Device: /dev/vx/rdsk/mydg/myvol Continue with file system migration (y/Y/n/N)? y Continue with mkfs on target device (y/Y/n/N)? y version 12 layout 4194304 sectors, 524288 blocks of size 4096, log size 4096 blocks rcq size 256 blocks largefiles supported maxlink supported Unmounting Source File System '/dev/mapper/datavg-datalv' Mounting Target File System /dev/vx/dsk/mydg/myvol Mounting Source File System: /dev/mapper/datavg-datalv
If you see above command carefully, you will see that automatically it is un-mounting the LVM filesystem and mounting the VxFS filesystem, so take that into consideration while making your plan.
6. Now, verify that the new file system is online by using “df” command. Also, you can check the status of migration by the help of “fsmigadm status” command.
[root@server ~]# df -h [root@server ~]# fsmigadm status /data: Source Device: /dev/mapper/datavg-datalv Target Device: /dev/vx/dsk/mydg/myvol Throttle rate: 0 MB/s Copy rate: 0.00 MB/s Total files copied: 3402 Total data copied: 167.71 MB migration Status: migration completed [root@server ~]#
The beauty of this migration is that the data in the file system is available during the migration.
7. To finalize this migration, you will have to commit the changes. Use the below command for committing changes.
[root@server ~]# fsmigadm commit /data [root@server ~]# df -hP /data Filesystem Size Used Avail Use% Mounted on /dev/vx/dsk/mydg/myvol 2.0G 194M 1.8G 10% /data [root@server ~]#
8. Finally, go to the mount point and verify your data and make sure everything is in its place.
[root@server ~]# cd /data [root@server ~]# ls
After verification, you can remove your logical volume and give back the disk to storage or use it for other purpose.
These are the simple steps to convert the LVM file system to VxFS. If you have any issues in any step do let us know through your comments and will try to help you out. Hope this article was beneficial for you and you gained something new. If you want more such articles, please subscribe to Storage Tutorials today and get FREE tutorials.
Do not forget to share this article and connect with us on social media websites, like Facebook.