ONTAP Discussions

Space reclaim for lun




I have some iscsi lun configured on a 9.1P10 cluster.

space-allocation option is disabled, so I'm guessing I'm wasting disk space without reclaiming space.

Ontap 9 documentation says

"If you set the space-allocation option to enabled, Data ONTAP notifies the host when the volume has run out of space and the LUN in the volume cannot accept writes. This option also enables Data ONTAP to reclaim space automatically when your host deletes data."

Can I use snapdrive to reclaim space one shot?

Can I use a windows host to reclaim space on lun mapped for both windows and linux clients?

Do will be a disruptive operation?

Thank you 



Re: Space reclaim for lun




Please refer https://library.netapp.com/ecmdocs/ECMM1278932/html/admin/provisioning/concept/c_sdw_prov_space-reclaim-about.html

If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.

Re: Space reclaim for lun


Hello Sahana,

thanks for your reply.

I found some discussion where it seems snapdrive for linux is not capable of space reclaim, for instance


I'll try with fstrim on linux, I'll then post about the results.


Re: Space reclaim for lun



with linux client i did the following:

1) Obtain the device id of the lun

For instance

# ls -l /dev/mapper/netapp-lunp1
lrwxrwxrwx 1 root root 7 Feb 26 11:47 /dev/mapper/netapp-lunp1 -> ../dm-1

2) Check /sys/block/dm-1/queue/discard_max_bytes value: it should be not zero. If zero, maybe the option space-allocation must be set to enabled


(I tried simply modifying the option without putting the lun offline, and it worked without disruption)

3) Rescan the lun (in our case we rebooted the client)

4) Check again /sys/block/dm-1/queue/discard_max_bytes, in our case we have 33554432 

5) fstrim <mountpoint>

We checked with red-hat like and debian linux, ext4 filesystem. It works.

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums