Backtrack:  
 
by lunarg on August 31st 2015, at 15:50

You can reclaim previously allocated but unused disk space from your virtual disks by returning unused SAUs to the disk pool.

In order to reclaim space, files must be permanently deleted from disk. Space can only be reclaimed on a per-SAU base, meaning that the entire SAU must be empty and zeroed before it can be returned. If a single byte is in use on a SAU, the entire SAU cannot be returned.

Space reclamation can be done on any type of virtual disk, but depending on the type, there are some factors to account for. In case of a mirrored or dual virtual disk, the disk cannot be in recovery mode and its sync should be "up to date".

Running reclamation simultaneously is possible if the virtual disks are in different disk pools. Only one reclamation process will run at a time per disk pool.

Reclaiming space

The reclamation process consists of two parts:

  1. First, on the host using the virtual disk, the free space will have to be zeroed in order for DataCore to know which blocks are no longer in use. Simply deleting a file usually does not zero the data blocks, which is not enough for space reclamation. In that case, you'll need to manually use tools on the host to zero free space first.
  2. Once the first step has been completed, it's only a matter of manually performing the space reclamation on the DataCore server, using SANsymphony-V Management Console.

Zeroing free space (on the host using the virtual disk)

On the host, use a host-based tool to clear out any previously allocated disk space. This means zeroing out all free space on a disk. There are a variety of methods and tools out there, depending on the OS the host is running.

Hosts running Microsoft Windows

For Windows-based systems, the most easy and straight-forward tool is probably SDelete from SysInternals.

While robust, it does only support logical drives at the moment. If you have volumes mounted on a folder (i.e. mount points), then you probably want to use another tool (or perhaps this Powershell script).

  1. Log on to the host which has the virtual disk(s) that are in need of reclamation.
  2. Download SDelete.
  3. Open an elevated command prompt and run sdelete in "zeroing mode":
    sdelete -z D:
    Replace D: with the logical drive letter of the volume to have its free space cleared out.
    Note that SDelete only supports volumes mounted on a logical drive letter. If you have mount points, consider using other tools, or use this script as an alternative.
    You should see output similar to:
    C:\>sdelete -z e:
    
    SDelete - Secure Delete v1.61
    Copyright (C) 1999-2012 Mark Russinovich
    Sysinternals - www.sysinternals.com
    
    SDelete is set for 1 pass.
    Cleaning free space on E:\: 16%
  4. Once the process has completed, sdelete will display the following:
    Free space cleaned on D:\
    1 drives zapped
    You can then proceed with space reclamation on the DataCore server.

Hosts running flavours of *NIX, linux and Solaris

Any *NIX-based host can use dd to fill up the free space of a partition with a single large file filled with zeroes, then deleting that file. All blocks that have been zeroed will then be recognized by DataCore as empty, which can be reclaimed.

While less accurate, dd is usually available as a built-in command, and is therefore, easy to use. Despite of this, using dd requires a bit more prep work in advance in order to use it correctly to zero free space on a partition.

  1. In order to fill up space, it is a good idea to determine the current free space of the partition, along with how much the used space will grow during a "zeroing" operation with dd.
    1. Determining how much free space partitions have on your host can be done with df:
      df -h
      This will output a list of all mounted partitions, along with the free and used space.
      root@svr:~# df -h
      Filesystem                                              Size  Used Avail Use% Mounted on
      /dev/sda2                                               7.8G  763M  6.6G  11% /
      /dev/sda1                                               146M   23M  116M  17% /boot
      /dev/sdb2                                               9.9G  537M  8.9G   6% /var
    2. To determine the amount of data growth on the partition, you can simply run the command above in intervals of 30 or 60 minutes, and see how much the free space of the partition has dropped.
    With these two values known, you can quickly calculate how big a file you should let dd create without running into trouble about the partition running full:
    = LowestFreeSpace — ( HighestFreeSpace — LowestFreeSpace ) — ReserveSpace
    ReserveSpace is an additional number to account for unexpected growth, and has to be set to a sane value. There are no real guidelines for this, other than common sense.
    Warning
    The formula above is merely a guideline. Always be mindful and use common sense when determining any of the values in this formula. Your needs may be very different from what is outlined here.
  2. Once you have the determined the optimal size for the "zero" file, run the following command to create it. This will effectively create a file with all zeroes:
    dd if=/dev/zero of=/MountPointOfPartition/file.dat bs=1048576 count=FileSizeInMBDeterminedEarlier
    Replace the values accordingly:
    • MountPointOfPartition = the directory where the partition is mounted.
    • FileSizeInMBDeterminedEarlier = the maximum file size in MB, which you determined in the previous step.
    Be careful when entering the size and where you create the file: entering the wrong size may risk your partition from filling up, and providing a wrong path may create the file on the wrong partition.
  3. After the file has been created, you can immediate remove it:
    rm -f /MountPointOfPartition/file.dat
  4. With the "zero" file gone, you can now run the space reclamation on the DataCore server.

Performing space reclamation (on the DataCore server)

  1. Log on to the DataCore server using SANsymphony-V Management Console.
  2. Locate the virtual disk to reclaim space from, and right-click it.
    From the menu, choose Reclamation → Start Reclamation
  3. During reclamation, the status of the Storage source of the virtual disk will change to (Online, reclaiming):
    If reclamation is started on more than one virtual disk in the same disk pool, the other virtual disks will have their status set to (Online, Reclamation pending), meaning the reclamation process was queued but is currently not active.
  4. Once the reclamation is completed, the status of Storage source will return back to (Online):

The duration of the reclamation will depend on the type of underlying storage, as well as current IOPs and load. Reclaiming disk space is an I/O intensive process and will most likely negatively impact performance on heavy-load servers. This effect is increased if virtual disks are mirrored or replicated. You can abort reclamation of a virtual disk at any time without compromising the integrity of the virtual disk:

  1. In SANsymphony-V Management Console, right-click the virtual disk, then choose Reclamation → Abort Reclamation.

More information

A more detailed explanation can be found on DataCore's Web Help: http://www.datacore.com/SSV-Webhelp/Reclaiming_Virtual_Disk_Space.htm.

 
 
« March 2024»
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      
 
Links
 
Quote
« I needed a password with eight characters so I picked Snow White and the Seven Dwarves. »