To selectively sanitize data contained in FlexVol volumes, you need to migrate any data that you want to preserve in the entire aggregate, because every disk used by that aggregate must be sanitized.
Before you begin
- You must have the licensed_feature.disk_sanitization.enable
option set to
Attention: After disk sanitization is enabled on a storage system, it is permanent.
- You need enough free space to duplicate the data that you want to preserve, plus extra space for overhead.
If you have a limited amount of free space, you can decrease the size of the FlexVol volumes after you delete the data that you do not want to preserve and before migrating the volume.
- Stop any applications that write to the aggregate that you plan to sanitize.
- From a Windows or UNIX client, delete the directories or files whose data you want to selectively sanitize from the active file system.
Use the appropriate Windows or UNIX command, for example, rm /nixdir/nixfile.doc
- Remove NFS and CIFS access to all volumes in the aggregate.
- From the Data ONTAP command line, enter the following command to delete all volume Snapshot copies of the FlexVol volumes that contained the files and directories you just deleted: snap delete -V -a vol_name
vol_name is the FlexVol volume that contains the files or directories that you just deleted.
- Note the names of the volumes that contain data you want to preserve.
- Enter the following command for each volume that you want to preserve, noting the total size and space used: df -g vol_name
- If you do not have sufficient free space to create an aggregate to contain the migrated volumes at their current size and the volumes have free space, enter the following command for each volume to decrease its size: vol size vol_name new_size
Note: The new size must be larger than the used space in the volume.
- Create an aggregate to which you will migrate the data you did not delete by entering the following command: aggr create dest_vol disks
aggr create nixdestaggr 8@72G
This new aggregate provides a migration destination that is free of the data that you want to sanitize.
- For each FlexVol volume that contains data you want to preserve, enter the following command to create a corresponding FlexVol volume in the new aggregate: vol create dest_vol dest_aggr size
is the name of the new FlexVol volume. Use a different name for the new FlexVol volume.
dest_aggr is the aggregate you just created.
size must be at least as large as the current size of the FlexVol volume in the aggregate you will sanitize.
To create a FlexVol volume to preserve the data in the nixsrcvol volume, which is a little more than 19 GB, you could use the following command: vol create nixsrcvol_1 nixdestaggr 20G
You now have the volumes into which you will copy the data that you want to preserve.
- For each FlexVol volume that contains data you want to preserve, enter the following command to copy the data to the new aggregate: ndmpcopy /vol/src_vol /vol/dest_vol
is the FlexVol volume in the aggregate that you want to sanitize.
dest_vol is the new FlexVol volume that you just created that corresponded to the src_vol volume.
ndmpcopy /vol/nixsrcvol /vol/nixsrcvol_1
For information about the ndmpcopy command, see the Data ONTAP Data Protection Tape Backup and Recovery Guide for 7-Mode.
All of the data that you want to preserve is now contained in the new aggregate.
- List the disk IDs used by the source aggregate by entering the following command: aggr status src_aggr -r
aggr status nixsrcaggr -r
The disks that you will sanitize are listed in the Device column of the aggr status -r output.
- Record the disk IDs that you listed in the previous step.
- For each FlexVol volume in the aggregate that you are sanitizing, enter the following commands to take the volume offline and destroy it: vol offline src_volvol destroy src_vol
- Enter the following commands to take the source aggregate offline and destroy it: aggr offline src_aggraggr destroy src_aggr
The volumes and aggregate that housed the data you want to sanitize have been destroyed. The disks used in this aggregate are now hot spares.
- Enter the following command to rename the new aggregate, giving it the name of the aggregate that you just destroyed: aggr rename dest_aggr old_src_aggr_name
aggr rename nixdestaggr nixsrcaggr
- For each FlexVol volume in the new aggregate, enter the following command to rename the FlexVol volume to the name of the original FlexVol volume: vol rename dest_vol old_src_vol_name
vol rename nixsrcvol_1 nixsrcvol
- Reestablish your CIFS or NFS services.
- If the original volume supported CIFS services, restart the CIFS services on the volumes in the destination aggregate after migration is complete.
- If the original volume supported NFS services, enter the following command: exportfs -a
Users who were accessing files in the original volume continue to access those files in the renamed destination volume with no remapping of their connections required.
- Follow the procedure for sanitizing disks on the disks that belonged to the source aggregate.