Page 1 of 1

Missing free disk space after removing iSCSI Targets

Posted: Tue Sep 23, 2014 12:13 am
by elpatron.68
After removing two iSCSI targets the corresponding disk space was not freed:

Image

The system protocol:
Image

How can I delete the lost iSCSI target files?

Regards,
Markus

Re: Missing freed after removing iSCSI Targets

Posted: Tue Sep 23, 2014 12:14 am
by doktornotor
Kindly post the output of

Code: Select all

df -h

Re: Missing freed after removing iSCSI Targets

Posted: Tue Sep 23, 2014 12:24 am
by pwilson
doktornotor wrote:Kindly post the output of

Code: Select all

df -h
Or check it again in 24 hours? :roll: :roll: :roll: :-0

If QNAP can't make that work in real time, they might as well remove it from Firmware. Useless "pretty" screen anyway. Your advice to check it from the command line is indeed the correct approach.

Code: Select all

df -h
People seem to expect that output to be "real-time", so that screen is useless in any language because it is historical.... :mrgreen:

Re: Missing freed after removing iSCSI Targets

Posted: Tue Sep 23, 2014 3:44 pm
by elpatron.68
doktornotor wrote:Kindly post the output of

Code: Select all

df -h
df says:

Code: Select all

[~] # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/ramdisk             32.9M     16.7M     16.2M  51% /
tmpfs                    64.0M    276.0k     63.7M   0% /tmp
/dev/sda4               371.0M    333.9M     37.1M  90% /mnt/ext
/dev/md9                509.5M    141.6M    367.9M  28% /mnt/HDA_ROOT
/dev/md0                  5.4T      4.1T      1.3T  76% /share/MD0_DATA
tmpfs                    32.0M         0     32.0M   0% /.eaccelerator.tmp
Thanks,
Markus

Re: Missing free disk space after removing iSCSI Targets

Posted: Tue Sep 23, 2014 3:50 pm
by elpatron.68
Okay, thanks, I found the lost files:

Code: Select all

[/share/MD0_DATA/.@iscsi.img] # ls -la
drwxrwxrwx    2 admin    administ      4096 Sep  8  2012 ./
drwxrwxrwx   29 admin    administ      4096 Sep 22 13:54 ../
-rw-------    1 admin    administ 1099511627776 Sep  3  2012 iSCSI-lun0-5044b2ca.000
-rw-------    1 admin    administ 1047972020224 Sep  3  2012 iSCSI-lun0-5044b2ca.001
-rw-------    1 admin    administ 536870912000 Sep  8  2012 iSCSI-lun0-5044b2ca.002
-rw-------    1 admin    administ 1099511627776 Sep  3  2012 iSCSI-lun1-5044b2ed.000
-rw-------    1 admin    administ 1047972020224 Sep  3  2012 iSCSI-lun1-5044b2ed.001

Re: Missing free disk space after removing iSCSI Targets

Posted: Tue Sep 23, 2014 4:01 pm
by doktornotor
Yeah, there's a wonderfully hidden GUI to remove those, behind the "Un-mapped iSCSI LUN List" button :roll:

Image

Re: Missing free disk space after removing iSCSI Targets

Posted: Tue Sep 23, 2014 6:01 pm
by elpatron.68
Hi doktornotor,

that was exactly what I did before removing my LUNs. Nevertheless: the disk space wasn´t freed. I assume it´s a GUI issue.
I had to manually delete the files in /share/MD0_DATA/.@iscsi.img.
Unfortunately I have no time and no second device to reproduce this problem.

Regards,
Markus

Re: Missing free disk space after removing iSCSI Targets

Posted: Wed Sep 24, 2014 5:12 am
by schumaku
Have a similar case - however the file space is freed up, but the usage is still shown in the Disk Usage list and the graph. The ubiquitous vs_refresh did not help...
Screen Shot 2014-09-21 at 20.36.25.png
...removed the LUN container file... note the 100 GB free'ed space - however it's still listed as a LUN and the pie does include it, too...
Screen Shot 2014-09-22 at 10.36.10.png
Something QNAP there...

Re: Missing free disk space after removing iSCSI Targets

Posted: Wed Sep 24, 2014 9:10 pm
by storageman
I presume this was a thin provisioned LUN.

Has anyone tested if the volume, actions, reclaim option have any effect on the space reporting?

Re: Missing free disk space after removing iSCSI Targets

Posted: Fri Jun 19, 2015 5:58 pm
by conandrum
I also removed everything one-by-one in the web admin interface... starting with the virtual disk pointing to the target, and the target and the LUN.
However, I noticed that the space on the raid was not freed.
So I emptied the network recycle bin and again nothing.
I checked the disk usage in resource monitor and sure enough it is still listed there.

I can see it in /share/MD0_DATA/.@iscsi.img
iSCSI-MUSIC_LUN-4e19ea97.000 512,000Mib
virtual_lun0 1,024Kib

I was thinking to just delete these two files...
What shoudl I do?

Re: Missing free disk space after removing iSCSI Targets

Posted: Sat Jun 20, 2015 2:55 am
by conandrum
Please any ideas? Some of you had this problem before. Thanks

Re: Missing free disk space after removing iSCSI Targets

Posted: Sat Jun 20, 2015 3:06 am
by conandrum
I just noticed something very strange.
In control panel>storage manager>iscsi>Advanced ACl
I noticed there is a 'default policy'.
I can only add or edit this policy.
When I edit this policy, I see the name of the LUN which I deleted earlier today (which still physically exists on my QNAP).
The policy entry 'MUSIC_LUN' can be edited but cannot be removed.
This is also a bug IMHO because the LUN has been deleted.

Anyway I am going to upgrade to the latest firmware tonight and see if there have been any changes (4.1.3 atm).

Re: Missing free disk space after removing iSCSI Targets

Posted: Sat Jun 20, 2015 6:02 am
by conandrum
Ok I think I fixed it.

>>>MAKE BACKUPS BEFORE YOU START MODIFYING FILES!!!!

--------------------------------------------------------------------------
THE CONFIG FILES
-------------------------------------------------------------------------
I found the BOGUS still lingering OBSOLETE data in the following files.
/mnt/HDA_ROOT/.config/iscsi.conf
/mnt/HDA_ROOT/.config/iscsi_trgt.conf

QNAP OS should have cleaned these files when I deleted the LUNs.
Unfortunately the LUNs were still in there. Even LUNs which I deleted years ago were in there! The strange thing is that a very old LUN which was mentioned in these files, does not exist as a physical file and I am wondering if the file was correctly removed from the machine with an older version of the firmware. Maybe the newer firmwares have been broken a bit? IDK.

>>>>Finally, this file I left untouched as it had no mention of my particular LUNs. /mnt/HDA_ROOT/.config/iscsi-init.conf

Below is what I left in my /mnt/HDA_ROOT/.config/iscsi.conf (yours MAY DIFFER be careful)
[iSCSISetting]
Enable = TRUE
iSCSIPort = 3260
[iSNS]
biSNSEnable = FALSE
iSNSServer =

Below is what I left in my /mnt/HDA_ROOT/.config/iscsi_trgt.conf (yours MAY DIFFER be careful)
[iSCSIPortal]
bServiceEnable=FALSE
servicePort = 3260
initiatorBitmap00 = 00000001
bISNSEnable = FALSE
ISNSIP =
targetIQNPrefix = iqn.2004-04.com.qnap:ts-509:iscsi.
targetBitmap00=00000000
LUNBitmap00 = 00000008

[init0Info]
initiatorIndex = 0
initiatorIQN = iqn.2004-04.com.qnap:all:iscsi.default.ffffff
initiatorAlias = Default Policy
initiatorTargetBitmap00=00000000
initiatorLUNBitmap00 = 00000008

[InitiatorKey]
iqn.2004-04.com.qnap:all:iscsi.default.ffffff = 0

[TargetKey]

[LUNKey]

Now, when I go to In control panel>storage manager>iscsi>Advanced ACl the 'default policy' is empty as it should be since I have 0 Luns configured. GOOD!

--------------------------------------------------------------------------
THE LUN FILES
-------------------------------------------------------------------------
My LUN is in here /share/MD0_DATA/.@iscsi.img
the name of the 500MB file is /share/MD0_DATA/.@iscsi.img/iSCSI-MUSIC_LUN-4e19ea97.000
After the above mods, I deleted the file which no longer shows as a LUN in disk usage. GOOD!
>>>>I did not delete the file /share/MD0_DATA/.@iscsi.img/virtual_lun0 (maybe it is necessary for the system)

I will empty the recycle bin, reboot and check the disk usage again to see if the free space is returned.

Re: Missing free disk space after removing iSCSI Targets

Posted: Sat Jun 20, 2015 6:34 am
by conandrum
Sure enough, after the reboot, the space was RETURNED ! )))
It will be noticed as an increase in free space in the web interface resource monitor/disk usage.
So earlier when I deleted the LUN and fixed the conf files, the LUN was removed from disk usage, but not reported elsewhere in another category. essentially taking up space out of the 'free space' category without reporting it.
Now the space is redeemed.

The above operations were done when running TS509 firmware v4.1.3

Re: Missing free disk space after removing iSCSI Targets

Posted: Tue Apr 02, 2019 2:33 pm
by primator
Hi All,

Although this thread is old, the solution is (now) simple.

In the iSCSI settings, under "Target Management" I now have the option "Un-mapped iSCSI LUN list" at the bottem.
When selected, I had the deleted iSCSI LUN visible.
After deleting the LUN from the "Un-mapped iSCSI LUN list" I have the missing storage reclaimed.

This is in version 4.3.3 on a TS-212.