Subscribe

Is it possible to delete a single file from a snapshot?

I have searched the archives and I can't find a solution to my problem.

The issue is that I often want to remove just one file, or maybe a few files, from a snapshot in order to save space.

Very often a user will create several extremely large (many 10s of gigabytes) intermediate files in a filesystem that's

maybe 200GB and accidentally leave them overnight. When he deletes the file it moves into the snapshot, which we don't

really want. It's a useless file now. We have played a lot of games like creating some volumes that have snapshots turned on

and some volumes that don't in order to work around this limitation, but I'd really like to use some equivalent of clri to just

blow away a file and all references to that file when a user makes a mistake and leaves a large temporary file lying around.

Add those blocks back to the free list immediately. I don't want to delete the entire snapshot, because there are many

thousands of (small) files I want to keep there. I just want to remove specially selected files as the superuser. This limitation is

really killing us and is possibly my biggest complaint with ONTAP. I know snapshots are read-only blah blah blah. This

could be done if Netapp wanted to do it and it could be done easily.

I know this was not possible many versions of ONTAP ago, but is this possible now? I would like this added as a feature if not.

Any suggestions on how to solve this problem would be appreciated.

Dimitri

Re: Is it possible to delete a single file from a snapshot?

hello,

you cannot remove the single file from the snapshot. even i faced this issue last week so we decided to take the snapshot to tape & delete the snapshots.

Thanks

Re: Is it possible to delete a single file from a snapshot?

Don't you think that's a little bit ridiculous? We should lean on Netapp to give us a little bit more power over the filesystem. Make it a privileged command if you want just to be really, really safe. I should not have to kill 800,000 files I'd like to retain snapshots of just because there is 1 (large) file in the snapshot I don't need which I'd like to remove. I am not fully aware if there are technical reasons why this isn't implemented, but it seems like it would be a simple matter of adding the blocks to the free list and updating the master blocks which contain snapshot info. I would *really* like to see this.

Re: Is it possible to delete a single file from a snapshot?

I agree with you dmitri. last time when i tried to take the snapshot to tape it tokk me 15 hrs for dumping the snapshot to tape which is very tough for us to do this for all snapshots & re-claim the space back.

NetApp should find a solution for this .

Re: Is it possible to delete a single file from a snapshot?

Is it possible to restructure your data into separate volumes so that the data you don't want to be included in a snapshot is stored on a volume without a snapshot schedule or data protection policy?

If you add the ability to delete files out of a snapshot how do you guarantee the consistency of the snapshot contents?

Re: Is it possible to delete a single file from a snapshot?

last time when i tried to take the snapshot to tape it tokk me 15 hrs for dumping the snapshot to tape

Check your volume fragmentation & possibly defrag by using reallocate command:

http://now.netapp.com/NOW/knowledge/docs/ontap/rel7311/html/ontap/sysadmin/tuning/concept/c_oc_tun_reallocate-what-a-scan-is.html#c_oc_tun_reallocate-...

Re: Is it possible to delete a single file from a snapshot?

>Is it possible to restructure your data into separate volumes so that the data you don't want to be included in a snapshot is stored on a volume without a snapshot schedule or data >protection policy?

I mentioned in my original post that we play these games now. I find the status quo unacceptable. There's still the chance that someone accidentally creates a large file where they shouldn't have and the admin has no way to deal with that problem.

>If you add the ability to delete files out of a snapshot how do you guarantee the consistency of the snapshot contents?

How do you guarantee the consistency of any filesystem? There's a whole branch of OS theory to deal with these issues.

Re: Is it possible to delete a single file from a snapshot?

Hi Dimitri,

I'm having the same problems you face on my Netapp Filers. Have you any progress since end 2009 ?

I was wondering if you ever tried to remove the file from the filer using its command "rm" (rather than from NFS or CIFS mounts). I recently saw this command in "priv set advanced" mode and wonder if it could REALLY remove the file and not go into the snap.

Anyway i'll test it asap and tell you my results.

Cheers.

Re: Is it possible to delete a single file from a snapshot?

The rm command in advanced mode of ONTAP will not remove files in snapshots.

Re: Is it possible to delete a single file from a snapshot?

No the rm command won't delete the file in a snap, says its RO !

What I suggested is to remove the file from the qtree/volume with this command and not from a NFS/CIFS mount! Maybe the file won't get in the snap... Did anyone tried that ?