Windows share, .recycle and shadow copies

Status
Not open for further replies.

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Hey

Funny story, I made my nas around 6 months ago, 25tb, 18tb usable. Everything is amazing so far but I got down to 500gb free and I was trying to get some space back... funny enough took me a while and then a hdd folder scan to see where my space went and to my surprise... boom .recycle bin is at 7.9tb :- )))

So what I would like to find out is, if I am to clean up my .recycle folder, will my shadowCopies still work? Do they relay in any way on .recycle content? I use photoshop/other programs. From what I can say they save to .tmp file and then delete old one/replace with .tmp file and rename it. Can that system somehow need the .recycle for shadow copies to work? I love shadow copies but I don't want to lose them :- )

TIA!

Regards
Dariusz
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
I think the answer to your question is "yes." Because I don't think one has to do with the other. But I'm no Windows or Samba expert.

As I understand it the .recycle folder is the trash bin for the exported samba share.

ShadowCopies is entirely different and is basically the directory and file versions present in any snapshots of the dataset. Which would include copies of the .recycle folder (I think). These versions should show up in the "Previous Versions" tab of the directory and/or file properties.

You could easily check I suppose. Assuming you have hidden folders turned on you can see if there are any previous versions of the .recycle directory.

Also, did you set up freenas to create snapshots? If not, you might not have any on the system. But then I suppose you would not have inquired about ShadowCopies. :)
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Interesting, thanks!

So its a "YES" they are not related to each other then?

I do run shadow copies which as far as I know are Snapshots...

Thanks for info ! I'll start cleaning the recycle folder, hopefully I wont break my nas :D
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Hmmm, so I deleted about 600gb of data but my freenas did not gain any extra space... what should I do? I use shadowCopies and they all take around 500-600mb each. With some exceptions. How can I release the space?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
The data is probably still present in your snapshots on the freenas system. You will have to remove (some of) the snapshots to reclaim the space.
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Oh dear, I have 2 weeks worth of snapshots shot every 1h... looks like it will be a while before the data clears up... lets hope I can manage with what remaining space I got left! :- )
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Alternatively, you could manually go look at which snapshots are taking up space and delete a few if you don't want to wait that long.
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Humh, none of them take 7.9tb, all snapshots that I got sums up to around 160gb. The remaining 7.7TB are mystery o_O I deleted 600gb of recycle folder. But that did not expanded the available hdd space.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
In short, you can start with zfs list -t all -o space -r [poolname] | more and look at the USEDSNAP column to see what datasets have large amounts of data in their snapshots. Then trim down from there.

For example, I have a dataset I use for VM storage. Using the above command I can see it uses 621G. The snapshots use 218G and the live dataset uses 403G.

From there I can run zfs list -t all -r pool0 | more and see the snapshot breakdown as below:

Code:
NAME													 USED  AVAIL  REFER  MOUNTPOINT
...
pool0/ds_hdd											 620G   621G   403G  /mnt/pool0/ds_hdd
pool0/ds_hdd@auto-20180401.0500-1y					   119G	  -   333G  -
pool0/ds_hdd@auto-20180416.0500-1y					  13.5G	  -   397G  -
pool0/ds_hdd@auto-20180418.0500-1y					  7.23G	  -   397G  -
pool0/ds_hdd@auto-20180419.0500-1y					  6.34G	  -   397G  -
pool0/ds_hdd@auto-20180420.0500-1y					  6.07G	  -   397G  -
pool0/ds_hdd@auto-20180421.0500-1y					  4.02G	  -   397G  -
pool0/ds_hdd@auto-20180422.0500-1y					  6.59G	  -   397G  -
pool0/ds_hdd@auto-20180423.0500-1y					  6.27G	  -   402G  -
pool0/ds_hdd@auto-20180424.0500-1y					  4.20G	  -   402G  -
pool0/ds_hdd@auto-20180425.0500-1y					  1.52G	  -   402G  -
...
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Hmm pretty much everything looks like this :


root@freenas:~ # zfs list -t all -r vol_CGI
NAME USED AVAIL REFER MOUNTPOINT
~~~~~
vol_CGI/d_CGI@manual-20170909 12.3M - 13.2M -
vol_CGI/d_CGI@FullCopy-Rough 6.37G - 5.46T -
vol_CGI/d_CGI@auto-20180411.2000-2w 512M - 14.3T -
vol_CGI/d_CGI@auto-20180411.2100-2w 509M - 14.3T -
vol_CGI/d_CGI@auto-20180411.2200-2w 331M - 14.3T -
vol_CGI/d_CGI@auto-20180411.2300-2w 336M - 14.3T -
vol_CGI/d_CGI@auto-20180412.0000-2w 518M - 14.3T -
vol_CGI/d_CGI@auto-20180412.0100-2w 517M - 14.3T -
vol_CGI/d_CGI@auto-20180412.0200-2w 518M - 14.3T -
vol_CGI/d_CGI@auto-20180412.0800-2w 518M - 14.3T -
vol_CGI/d_CGI@auto-20180412.0900-2w 517M - 14.3T -
vol_CGI/d_CGI@auto-20180412.1000-2w 516M - 14.3T -
vol_CGI/d_CGI@auto-20180412.1100-2w 516M - 14.3T -
vol_CGI/d_CGI@auto-20180412.1200-2w 520M - 14.3T -
vol_CGI/d_CGI@auto-20180412.1300-2w 519M - 14.3T -
vol_CGI/d_CGI@auto-20180412.1400-2w 517M - 14.4T -
vol_CGI/d_CGI@auto-20180412.1500-2w 518M - 14.4T -
vol_CGI/d_CGI@auto-20180412.1600-2w 518M - 14.4T -
vol_CGI/d_CGI@auto-20180412.1700-2w 518M - 14.4T -
vol_CGI/d_CGI@auto-20180412.1800-2w 516M - 14.4T -
vol_CGI/d_CGI@auto-20180412.1900-2w 514M - 14.4T -
~~~~~


I take I would have to clean up all 2 weeks worth of my snapshots to release that space...?
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Post the output of zfs list -t all -o space -r pool0 | sed '/auto/d'

Something doesn't add up. Because if each snap has 0.5G that's no where near 7 TB. (Which is your point.)
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Post the output of zfs list -t all -o space -r pool0 | sed '/auto/d'

Something doesn't add up. Because if each snap has 0.5G that's no where near 7 TB. (Which is your point.)

I must be doing something wrong here :

root@freenas:~ # zfs list -t all -o space -r pool0 | sed'/auto/d'
sed/auto/d: Command not found.
cannot open 'pool0': dataset does not exist
root@freenas:~ # zfs list -t all -o space -r vol_CGI | sed'/auto/d'
sed/auto/d: Command not found.
root@freenas:~ # zfs list -t all -o space -r d_cgi | sed'/auto/d'
sed/auto/d: Command not found.
cannot open 'd_cgi': dataset does not exist


Also the .recycle is 7.9tb, I deleted around 700gb from that folder, waited a few hours but nothing got updated in snapshots/other areas... I expected snapshot to hit 700gb to reflect that space.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Yes, replace "pool0" (my pool) with "vol_CGI" (your pool). And put a SPACE after "sed" and before the '/auto/d' part. So it should be: zfs list -t all -o space -r vol_CGI | sed '/auto/d'
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Yes, replace "pool0" (my pool) with "vol_CGI" (your pool). And put a SPACE after "sed" and before the '/auto/d' part. So it should be: zfs list -t all -o space -r vol_CGI | sed '/auto/d'
Oh snap so precise... whh sorry missed that space.

here ist he code:

vol_CGI 355G 15.3T 213K 298K 0 15.3T
vol_CGI/.system 355G 186M 227K 220K 0 185M
vol_CGI/.system/configs-a7c4a4a3d45a4720a1e6b8ad799731fd 355G 30.3M 99.4K 30.2M 0 0
vol_CGI/.system/cores 355G 3.16M 199K 2.97M 0 0
vol_CGI/.system/rrd-a7c4a4a3d45a4720a1e6b8ad799731fd 355G 148M 34.6M 114M 0 0
vol_CGI/.system/samba4 355G 1.23M 447K 817K 0 0
vol_CGI/.system/syslog-a7c4a4a3d45a4720a1e6b8ad799731fd 355G 2.25M 653K 1.62M 0 0
vol_CGI/d_CGI 355G 15.2T 1002G 14.2T 0 0
vol_CGI/d_CGI@manual-20170909 - 12.3M - - - -
vol_CGI/d_CGI@FullCopy-Rough - 6.37G - - - -
vol_CGI/jails 355G 649M 99.4K 170K 0 649M
vol_CGI/jails/.warden-template-pluginjail 355G 649M 170K 649M 0 0
vol_CGI/jails/.warden-template-pluginjail@clean - 170K - - - -
vol_CGI/win_licenseServer 355G 6.34G 0 6.34G 0 0
vol_CGI/win_zVolLicenseServer 447G 102G 0 9.92G 91.6G 0
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Ok, so yea, you have a serious issue. According to this the pool "vol_CGI" is 97.7% full. You may seize up the pool.

The dataset "d_CGI" has 1 TB in snapshots and 14.2 TB in the active dataset. I'm guessing this is where the .recycle directory is located? Can you just empty that entire directory? It's the trash bin right? You mentioned you "deleted about 600gb of data". So there is 7.1 TB left in there?

Also, are you able to delete the snapshots for "win_zVolLicenseServer"? Those are taking up 102G. Might give you a bit of breathing room.
 

toadman

Guru
Joined
Jun 4, 2013
Messages
619
Or just turn off the recycle bin. On the SMB share just uncheck "Export Recycle Bin".
 

Dariusz1989

Contributor
Joined
Aug 22, 2017
Messages
185
Hey

Oh dear, I'll clean up recycle bin. But I did remove 600gb from it today and 150 yesterday. Did not release any memory as far as I can tell...

I did not make any snapshots for the license Server, just OS as far as I'm aware.

I have one snapshot which I think I did for test... not sure.

Its named dataset vol_CGI/d_CGI name FullCopy-Rough - it has Used 6.4gb and Refer 5.5tb. Can I delete this? I take its a snapshot so I should be able to? Or is that some kind of ZFS Rough snapshot... I cant remember if I did it myself for test no idea.

A very silly question, but deleting snapshots does not delete the current files, right? It's only theirs history that gets deleted?

I just run properties on my folders, the .recycle is taking around Size. 7.2tb, Size on disk 5.85t so the recycle folder is now properly smaller but no extra space showed up on zfs.

Removed another 500gb from recycle. Still no change. Something tells me I'm snapshoting my recycle bin folder as well...

Yea looks like I snapshot history of recycle bin... weird that recycle bin is not excluded from snapshots... - so I take to save my pool I need to remove all snapshots and then keep an close eye to bin folder to always clear it up ?
 
Last edited:

toadman

Guru
Joined
Jun 4, 2013
Messages
619
I did not make any snapshots for the license Server, just OS as far as I'm aware.

Yep, you are right, I misread the column.


Its named dataset vol_CGI/d_CGI name FullCopy-Rough - it has Used 6.4gb and Refer 5.5tb. Can I delete this? I take its a snapshot so I should be able to? Or is that some kind of ZFS Rough snapshot... I can't remember if I did it myself for test no idea.

Yes, you can delete it.

A very silly question, but deleting snapshots does not delete the current files, right? It's only theirs history that gets deleted?

Correct. Deleting a snapshot only deletes data exclusive to that snapshot. For example, let's say you have 100 files. You take a snapshot. The snapshot (a read only version of the filesystem) has 100 files in it. It takes up no space because those files are the same as the active dataset. Now you add a file. The current dataset now has 101 files. You delete the snapshot. You still have those 101 files.

Let's say you have 100 files. You take a snapshot. The snapshot has 100 files in it. (And again takes up no space.) Now you delete a file on the active dataset. You don't recover any space. Why? The snapshot still has that deleted file in it. So that space cannot be freed by the system. However, the current dataset only has 99 files now. So now you delete the snapshot. You still have those 99 files in the active dataset, but you free up the space from the file you deleted because the snapshot that contained that file has been deleted.

Make sense?
 
Status
Not open for further replies.
Top