Subscribe
Accepted Solution

How space-allocation option works

[ Edited ]

Hi everyone,

 

I have a question in the "space-allocation" option in cDOT.

 

As we know, enable "space-allocation" can reclaim space automatically when the host delete data. And the customers have the test in both linux and windows.

 

The test hosts are RHEL6.5 and Windows Server 2012R2. Both of them support the auto-space-reclaim. In the windows test, when deleting data, "lun show -field size-used" and "df -h -vol volname" from the filer side will automatically update the free space. But in the Linux test, after deleting data, the filer always report the original space usage. Not sure whether the space-reclaim works in the linux host.


Here are some outputs in test, test scenario is cDOT831 iscsi. (space-reserve is disable, space-allocation is enable, and there is no snapshot in the volume).

 

###########linux test
[root@RHEL1 lun1]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@RHEL1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/mpathbp1 1007M 518M 438M 55% /lun1
/dev/mapper/mpathap1 2.0G 1.1G 853M 56% /lun2

 

####delete data in lun1 and lun2
[root@RHEL1 lun1]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/mpathbp1 1007M 18M 939M 2% /lun1
/dev/mapper/mpathap1 2.0G 36M 1.9G 2% /lun2


#####After deletion, filer still report the original size.
cluster1::*> lun show -vserver svm_linux -fields size,size-used,space-reserve,space-allocation
vserver path size space-reserve space-allocation size-used
--------- ------------------- ---- ------------- ---------------- ---------
svm_linux /vol/vol_linux/lun1 1GB disabled enabled 599.3MB                                 -> still report the original space, that means space-reclaim didn't work out?
svm_linux /vol/vol_linux/lun2 2GB disabled enabled 1.08GB

luster1::*> df -h -vserver svm_linux -volume vol_linux
Filesystem total used avail capacity Mounted on
/vol/vol_linux/ 9728MB 1708MB 8019MB 18% ---
/vol/vol_linux/.snapshot 512MB 0B 512MB 0% ---

 

 

------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------

 

#In the windows test, after deleting data from the host, the free space did update in the filer

 

######when LUN2 has 2G data, the filer side can display the space usage.

cluster1::*> lun show -vserver svm_win -fields size,size-used,space-reserve,space-allocation
vserver path size space-reserve space-allocation size-used
------- -------------- ------ ------------- ---------------- ---------
svm_win /vol/vol1/lun2 2.01GB disabled enabled 1.92GB

cluster1::*> df -h -vserver svm_win -volume vol1
Filesystem total used avail capacity Mounted on
/vol/vol1/ 4864MB 2089MB 2774MB 43% ---
/vol/vol1/.snapshot 256MB 0B 256MB 0% ---

 

######after deleting data in LUN2
cluster1::*> lun show -vserver svm_win -fields size,size-used,space-reserve,space-allocation
vserver path size space-reserve space-allocation size-used
------- -------------- ------ ------------- ---------------- ---------
svm_win /vol/vol1/lun2 2.01GB disabled enabled 11.82MB                                   -> filer has update the free space

cluster1::*> df -h -vserver svm_win -volume vol1
Filesystem total used avail capacity Mounted on
/vol/vol1/ 4864MB 51MB 4812MB 1% ---
/vol/vol1/.snapshot 256MB 0B 256MB 0% ---

Re: How space-allocation option works

In Linux you need to mount filesystem with "discard" option. Not every filesystem supports it and it must be supported by storage stack as well.

Re: How space-allocation option works

Thanks, that works with discard options!