Network and Storage Protocols

How space-allocation option works

Dong_Chen
10,515 Views

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% ---

1 ACCEPTED SOLUTION

aborzenkov
10,364 Views
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.

View solution in original post

4 REPLIES 4

aborzenkov
10,365 Views
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.

Dong_Chen
10,348 Views
Thanks, that works with discard options!

Ratnakar96
8,578 Views

 

 

Hi , I need help wth space allcation enabled.

 

I've enabled space allcation from my cdot 9.1p8 storage and mapped the LUN to windows 2012 r2 server, .

Here I created a test lun and deleted the data from windows however the space  is unable to reclaim automatically

Do i need to change any options at at windows /storage level.

below is the lun details.

Note: This LUn provided through ESX host 5.5  to windows 2012 r2 

 

 

LUN Name: lun_ratnakartest1
LUN Size: 150GB
OS Type: vmware
Space Reservation: disabled
Serial Number: 804oa$Fz82Xp
Serial Number (Hex): 3830346f6124467a38325870
Comment:
Space Reservations Honored: true
Space Allocation: enabled
State: online
LUN UUID: 85b40fb2-6470-41f4-8840-798ff7903b38
Mapped: mapped
Block Size: 512
Device Legacy ID: -
Device Binary ID: -
Device Text ID: -
Read Only: false
Fenced Due to Restore: false


@aborzenkov wrote:
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.



Ratnakar96
8,566 Views

 

Hi , I need help wth space allcation enabled.

 

I've enabled space allcation from my cdot 9.1p8 storage and mapped the LUN to windows 2012 r2 server, .

Here I created a test lun and deleted the data from windows however the space  is unable to reclaim automatically

Do i need to change any options at at windows /storage level.

below is the lun details.

Note: This LUn provided through ESX host 5.5  to windows 2012 r2 

 

 

LUN Name: lun_ratnakartest1
LUN Size: 150GB
OS Type: vmware
Space Reservation: disabled
Serial Number: 804oa$Fz82Xp
Serial Number (Hex): 3830346f6124467a38325870
Comment:
Space Reservations Honored: true
Space Allocation: enabled
State: online
LUN UUID: 85b40fb2-6470-41f4-8840-798ff7903b38
Mapped: mapped
Block Size: 512
Device Legacy ID: -
Device Binary ID: -
Device Text ID: -
Read Only: false

Public