ONTAP Discussions

restoring a file from within a LUN

goof1427
8,659 Views

appreciate the time.  so i am a bit confused here.  I am trying to restore a file that is on lun which is presented to our windows file server.  the lun is on a separate vfiler.  i thought i could do a snap restore -t file /vol/filserver_vol/departments/IT/test.xls.  i get the prompts but when i say yes to restore i get the following error:  snap restore: File does not exist in snapshot..  so where is it then?

I did some searching and it was said that i should do a lun create -b?  thats where my confusion comes in.  CLI says to use LUN clone create. I just dont understand the parameters.  And will i need to reserve some space on the volume for these types of restores?  is there a difference between lun create -b and lun clone create?

https://communities.netapp.com/thread/1982

thanks.

1 ACCEPTED SOLUTION

kumaraysun
8,657 Views

Hi,

As aborzncov siad you cannot restore a single file from a LUN using snapretore command. what you could do is clone the LUN using the required SnapShot and present it the same host and then recover the file and then destroy the LUN. Cloning the LUN doesnot require any space also once the file is restored you could deleted the cloned LUN. Follwoing syntax will help u create clone LUN.

lun clone create <clone_lunpath> [-o noreserve] -b <parent_lunpath> <parent_snap>

Clone Lun path -- This is path of new clone Lun

Parent LUN  - This is path of the original LUN

Parent_snap - Is the snapshot using which u want to restore the LUN

Kumaresan

View solution in original post

7 REPLIES 7

goof1427
8,657 Views

I tried the following example… but it is not correct. 

lun create -b /vol/fileserver_vol/IT/.snapshot/hourly.1 -o noreserve /vol/fileserver_vol

lun create: /vol/fileserver_vol already exists and is a directory

filer2@netapp> lun create -b /vol/fileserver_vol/IT/.snapshot/hourly.1 -o noreserve /vol/IT_volsnap

lun create: No such volume

I am not understanding on whether should the volume be already created or will this command create it?  taking the other guys example (https://communities.netapp.com/thread/1982)…I don’t see what snaplun37 is?  … I am guessing that he wants to create a lun with the snapshot of vol3 with it created on snaplun37. 

lun create -b /vol/vol3/.snapshot/mysnap1/snaplun33 /vol/vol3/snaplun37

aborzenkov
8,658 Views

You can’t restore file from host filesystem on NetApp. NetApp is not aware how host is using LUN nor about filesystem format. You can create LUn clone from previous snapshot (using lun create -b), mount it on host and restore needed files using host’s tools.

snap restore -t file will restore file on NetApp; but the whole LUN is single file from NetApp point of view.

goof1427
8,658 Views

thats what im not understanding.  how do i create the lun from the a previous snapshot?  I get the first path of the command.

lun create -b [location and name of snapshot] -o noreserve

lun create -b snapshot_lun_path [ -o noreserve ] lun_path

it's the lun_path that I am not following.  Is that where the new lun clone should go? or do I to create a separate volume and host these clone luns?

kumaraysun
8,658 Views

Hi,

As aborzncov siad you cannot restore a single file from a LUN using snapretore command. what you could do is clone the LUN using the required SnapShot and present it the same host and then recover the file and then destroy the LUN. Cloning the LUN doesnot require any space also once the file is restored you could deleted the cloned LUN. Follwoing syntax will help u create clone LUN.

lun clone create <clone_lunpath> [-o noreserve] -b <parent_lunpath> <parent_snap>

Clone Lun path -- This is path of new clone Lun

Parent LUN  - This is path of the original LUN

Parent_snap - Is the snapshot using which u want to restore the LUN

Kumaresan

goof1427
8,657 Views

I got the syntax right finally. Thanks. I used:

lun clone create /vol/fileserver_vol/lunrecover -o noreserve -b /vol/fileserver_vol/IT hourly.1

I then added the lun to the proper igroup.  I can see the volume now in disk management but I am not able to browse it because it is offline.  It says 'the disk is offline because of a policy set by administrator.'

goof1427
8,657 Views

I went into diskpart and to bring it online but it fails to clear the readonly attributes....still searching.  some more information.  the clone is being seen by both nodes of a windows cluster but as offline and reserved.  no drive letter is assigned to it.  and the cluster services are running on both.  Do I need to assign it to another server where there is no cluster? hmmm..

kumaraysun
8,657 Views

Hi,

As far as i am aware this issue happens when this LUN is a part of clustered storage . I was able to do this in one of my environemnts on windows 2003 . If this is clusteded storage then try poresenting this LUN to any standalone server and then retrive the files.

Kumaresan

Public