NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
BaJohn
May 04, 2015Virtuoso
Deleting a file or folder from ALL snapshots.
I have just moved most of my collection of photos from one folder to another on my PC, as part of my recent 'tidy' project.
The PC is backed up regularly to the ReadyNAS system, which does snapshots every night and once a week. I also manually do snapshots after significant changes to the data.
So there are many snapshots of the original source for those photos on the NAS, which with the COW switched on will change these to 1 real copy plus any changes there might be, on this evenings snapshot. Since I will have the new source for the photos backed up, ALL the photos in the old snapshots, which take up at least as much space as the original and maybe more are superfluous, and will under normal circumstances never be removed until all snapshots related to them are deleted. This MAY be years away, possibly never.
Hence my question: Is there an easy way of deleting the contents of a folder throughout ALL snapshots that contain it?
Equally could this be done for 1 file as well? I am thinking here of some enormous files that reside on my system, like disc and system dumps etc.
I have a feeling the answer is NO, but I will pose the question anyway.
Thanks in advance.
The PC is backed up regularly to the ReadyNAS system, which does snapshots every night and once a week. I also manually do snapshots after significant changes to the data.
So there are many snapshots of the original source for those photos on the NAS, which with the COW switched on will change these to 1 real copy plus any changes there might be, on this evenings snapshot. Since I will have the new source for the photos backed up, ALL the photos in the old snapshots, which take up at least as much space as the original and maybe more are superfluous, and will under normal circumstances never be removed until all snapshots related to them are deleted. This MAY be years away, possibly never.
Hence my question: Is there an easy way of deleting the contents of a folder throughout ALL snapshots that contain it?
Equally could this be done for 1 file as well? I am thinking here of some enormous files that reside on my system, like disc and system dumps etc.
I have a feeling the answer is NO, but I will pose the question anyway.
Thanks in advance.
Certainly I confirmed this on the NAS today (see below).readysecure1985 wrote: Snapshots are read-only, not read-write. Therefore, once a snapshot is taken, it's read-only from that point on.
btrfs has a way to turn snapshots read-write, but doing so will not be supported by NETGEAR and is at your own risk.
http://unix.stackexchange.com/questions ... t-writable
What I find interesting is that you say that is what we should NOT be doing, and then show us how to do it :o.
I'm not a Linux expert, so would not be going down that route anyway.
It's nice to know that someone else might find the facility I am suggesting useful.btaroli wrote:
But on another Linux box, I find all my snapshots are by default read-write. Need to see if I can default that the other way. Given how these are created, they really shouldn't be modifiable. Though it might be handy if some were.
I double checked today and No the snapshots are NOT deletable from the PC, they only appear to be deleted.btaroli wrote: So, BaJohn, I suspect that whatever you are seeing is not coming from the NAS... perhaps something running on the PC is creating those folders you see?
When viewing on the PC, the properties are 'full access' to everyone and if you highlight and delete, it asks "do you want to permanently delete this file - Yes or No"?. When I click yes, the screen refreshes with the file shown as deleted from the snapshot folder. No other messages about it did not happen, or about needing authority or anything.
It seems to me that the PC (Windows 7 Ultimate 64bit) and the NAS (RN516) are NOT talking to each other in the same language, as the NAS knows I cannot delete the snapshot file, BUT the PC thinks it can.
Wierd ay, perhaps it's a case of "Can't see the wood for the B... Trees."
24 Replies
Replies have been turned off for this discussion
- RXLuminary
BaJohn wrote: Hence my question: Is there an easy way of deleting the contents of a folder throughout ALL snapshots that contain it? Equally could this be done for 1 file as well? I am thinking here of some enormous files that reside on my system, like disc and system dumps etc.
I have a feeling the answer is NO, but I will pose the question anyway.
About snapshots, you will need to manually delete it one-at-a-time:
http://kb.netgear.com/app/answers/detai ... -system%3F - BaJohnVirtuoso
Unless I am mistaken, the link provided talks about deleting snapshots. Not folders or single files selectively from snapshots.Ixa wrote: BaJohn wrote: Hence my question: Is there an easy way of deleting the contents of a folder throughout ALL snapshots that contain it? Equally could this be done for 1 file as well? I am thinking here of some enormous files that reside on my system, like disc and system dumps etc.
I have a feeling the answer is NO, but I will pose the question anyway.
About snapshots, you will need to manually delete it one-at-a-time:
http://kb.netgear.com/app/answers/detai ... -system%3F - RXLuminaryYes, the link I have provided is about deleting snapshots because there is no option to delete folders or single files selectively from snapshots.
- BaJohnVirtuoso
So the answer is NO then :( .Ixa wrote: Yes, the link I have provided is about deleting snapshots because there is no option to delete folders or single files selectively from snapshots. - BaJohnVirtuosoOn the NAS box, individual files or folders can be deleted.
The system knows what snapshots are linked to that file or folder.
Why can't the system give an option on deletion to delete all associated snapshots?
Doesn't seem that difficult to do. Perhaps this could be a new functionality request.
I can't be the only one that thinks this might be a good idea, especially for those who's system is getting tight on space.
Any comments? - StephenBGuru - Experienced UserIt sounds like you are wanting to delete all previous versions of the file/folder?
It would be reasonable, though it seems hard to do when the file is deleted with windows explorer or finder (or nfs). - mdgm-ntgrNETGEAR Employee RetiredCurrently the method to do that is quite cumbersome. Firstly our snapshots are read-only (this makes a lot of sense for security purposes and maintaining the integrity of the snapshots). So you would need to make a read/write clone of each snapshot and delete the files from there. Then clone the snapshots back to read-only ones. Even then it may not free up the space unless you delete the entire oldest snapshot that contained the file.
Cloning snapshots to read/write ones could potentially be dangerous if things are messed up doing this procedure. You would want to take a new snapshot before doing this and then stop automatically taking/deleting new snapshots till finished.
If you want to free up space from deleted files I would suggest deleting the snapshots that contain the file or let the oldest automatic ones be automatically purged when the free space falls below 5% - BaJohnVirtuoso
Correct.StephenB wrote: It sounds like you are wanting to delete all previous versions of the file/folder?
I WAS suggesting it be done from the NAS box. At the <Shares><Browse> pages, for each folder right clicking shows options 'Browse', 'Rename', 'Cut', 'Copy' or 'Delete', and for each file right clicking shows options 'Download',' 'Rename', 'Versions', 'Cut', 'Copy' or 'Delete'.StephenB wrote: It would be reasonable, though it seems hard to do when the file is deleted with windows explorer or finder (or nfs).
If the 'Delete' key is used the NAS system knows exactly which file is required to be deleted and is in control.
I was suggesting that an option could be 'Delete all versions' as well as the 'yes', 'no' options currently available.
The NAS system has all the information (somewhere) to action what I am suggesting.
Obviously the technicalities of doing it may be problematical. - BaJohnVirtuoso
Up to now, I have carried out what I wanted to do by deleting files from snapshots remotely. i.e. Deleting from snapshots as a remote windows user on a shared drive.mdgm wrote: Firstly our snapshots are read-only (this makes a lot of sense for security purposes and maintaining the integrity of the snapshots).
Since I am able to delete from snapshots (not read only to the windows user), I assumed (incorrectly) that I would be able to delete from the snapshots when logged into the NAS as admin. Slightly quirky, as the admin user should have more authority than the remote user.
This seems to be the crux of the problem and the major sticking point.
Obviously this looks like an extremely difficult (probably impossible) to achieve. Thanks for the explanation.mdgm wrote: So you would need to make a read/write clone of each snapshot and delete the files from there. Then clone the snapshots back to read-only ones. Even then it may not free up the space unless you delete the entire oldest snapshot that contained the file.
Cloning snapshots to read/write ones could potentially be dangerous if things are messed up doing this procedure. You would want to take a new snapshot before doing this and then stop automatically taking/deleting new snapshots till finished.
This would defeat my objective (delete file/folder from ALL snapshots), as the snapshots contain other data that I want to retain.mdgm wrote: If you want to free up space from deleted files I would suggest deleting the snapshots that contain the file or let the oldest automatic ones be automatically purged when the free space falls below 5%
My last question then, is "Do you see any problems with my current way of deleting files/folders from snapshots one by one, by using a shared drive on my PC?". - StephenBGuru - Experienced Userfwiw, what I am doing is using the automatic snapshot pruning, and then manually deleting snapshots older then 3 months about once a month. That gives me 3 months of previous versions, and (so far) a good amount of free space. With the automatic algorithm, this only requires deleting one or two monthly snapshots from each share.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!