How to Remove Veritas File System

How-to-Remove-Veritas-File-Systems

File System expansion and reduction and removal is a kind of routine task for system administrators. So let’s see the entire process of how to remove veritas file system and reclaim storage.

SCENARIO

There are many scenarios when you need to remove the existing veritas file systems to reclaim storage for cost-saving to firms. For instance, the database refresh team requested additional storage and once their work data refresh completed they want to get the file system removed and storage released.

Maybe another scenario like the server is running many databases and one of them is getting decommissioned from the server while other is keep running or any other scenario.

First of all, I would like to divide this exercise spanned to two weeks. In the first week, we target to remove the file system and find out the device name which is going to be removed. Once have the device names then submit the request for the storage team to reclaim the required devices.

The device tree can be cleaned but it is recommended to reboot the server after taking downtime after the reclaim is done to make sure all stale devices get cleaned up.

How to Remove Veritas File Systems

This is not mandatory but it is advised to have a healthy system or to avoid any malfunctioning of stale devices which may contribute to performance issues or having healthy system to work smoothly during the business duration.

As a standard procedure of system administrator save some configuration before change like below. You can save other outputs if you think of any other output.

Below is enough as per my understanding for this kind of work. The consideration here is you must have a request related to work and data has been already removed from the file system and you have the go-ahead to work on this request.

If the server belongs to PRODUCTION it is advised to do this work during off business hours. All this depends upon your organization’s work culture, follow your environment procedure.

Backup Before The Removal of Veritas File Systems 

# df –h > /var/tmp/df-h.before
# cp –p /etc/fstab /etc/fstab.$date                           >>> for RHEL
# cp –p /etc/vfstab /etc/vfstab.$date                        >>> for Solaris
# vxdisk list > /var/tmp/vxdisklist.$date
# vxdg list > /var/tmp/vxdglist.$date
# vxdisk –eo alldgs list > /var/tmp/vxdisk-alldgslist.$date
# vxprint –hrtg <DG> > /var/tmp/vxprint-hrtg.$date

So let’s start the actual process of how to remove veritas file system and reclaim storage done.

How to Remove VxFS File Systems

1.(a) First take the status of file systems status using df command as below which will also provide disk group name and volume name.
# df -h /u001

1.(b) Please check volume status using vxprint command like below.
# vxprint -ht | grep u001

1.(c) Run fuser command to see no one using this file system. We need no one using the file systems otherwise it will show volume in use and not allowing to stop the volume.
# fuser -u /u001

1.(d) In case of anyone using it can be killed as well. But make sure if any root PID is using file system do not kill the process if you are doing it online else it will place the system in a funky state in worse case system may crash as well. So be careful.
# fuser –uc /u001

2. How to Unmount File System in Linux
# umount /u001

3. How to Stop the Volume 
# vxvol –g <DG> stop <VOL=u001>

4. Remove the volume from Disk Group – How to Remove Volume in VxVM ?

# vxedit -g <DG> -rf rm u001

5. Validate volume removal. It should not show this volume in vxprint.
# vxprint -ht | grep u001

6. Update File System Table and Remove Mount Point
Remove the file system entry in fstab or vfstab based on RHEL or Solaris. Remove the mount point as well.

7. How to find which disk is free in DG under VxVM?.
# vxdg –g <DG> free

This will show the entire disk configuration in a disk group with details of the free block. Match OFFSET carefully to avoid any data corruption.

You can use vxdisk list <DISKNAME> to cross-check the length of the disk and compare that with the above output. The sample output is as below.

# vxdg -g oracledg free 
GROUP           DISK                DEVICE           TAG                 OFFSET    LENGTH    FLAGS 
oracledg          disk01              sda                                          10246400        1536      - 
oracledg          disk02              sdk                                          10246400        1536      -

8. Remove Disk from Disk Group – How to Remove Disk from DG in VxVM?

# vxdg -g <DG> rmdisk <DANAME>

9. Validate Disk Removal
# vxdisk  list |grep <DG> 

The disk will not show in the above output if it is removed. Even you can validate using vxdisk list and see the particular disk it will not show associated with any disk group. disk format cdsdisk shows that disk is initialized. You can uninitialized before reclaim.
Sample disk configuration
c4t9d0s2     auto:cdsdisk    –            (oracledg)     online
c4t10d0s2    auto:cdsdisk    –            (oracledg)     online

10. Run vxdiskunsetup to uninitialized the disk – How to Unsetup Disk in VxVM?

# vxdiskunsetup -C c4t9d0 c4t10d0

11. Note down disk details and submit requests to the storage team to reclaim disk: Provide disk details using tools or request system in your organization. Take downtime for server reboot after disk reclaimed during off business hour or weekend as per your organization policy.

12: Get Apps/DB down for server reboot
Once the storage team confirms reclaim, get DB/Apps shutdown, and reboot the server. Perform health check and release to Apps/DB to start and validate DB and application.

This is the entire process of how to remove VxFS file systems and reclaim storage. I hope you will find this helpful. If you like it requests you to show your favor and like and share this with needed people so that they can be also benefited from this process.

If you are interested in other file system related how too,s to familiarize yourself. You can use below given related posts.

Linux Change Password

Extend VxFS in Solaris

How to Increase File System in VXVM

How to add disk to LDOM

Solaris 11 LDOM Recovery

How to fix failover service group in VCS

VxFS mount failure in RHEL 7

How to unencapsulate the rootdisk in VxVM

How to Activate Volume Group in Linux