ONTAP Discussions

Copy LUN to LUN

sureshgsk
12,147 Views

How do we copy a LUN to another LUN?

15 REPLIES 15

aborzenkov
12,074 Views

ndmpcopy?

sureshgsk
12,075 Views

Does it applicable for LUN copy? Or only volume level? I saw the manual for ndmpcopy and looks like it used to copy from different storage. What about vol copy? And if ndmp copy works, what is the correct step would be?

aborzenkov
12,075 Views

Yes, ndmpcopy can copy single file. It can be used within the same system or between two different systems. Vol copy copies the whole volume with all content. It can be used to copy single file.

ndmpcopy /vol/vol1/lun1 /vol/vol2/lun2

sureshgsk
12,075 Views

thanks 🙂

pascalduk
12,074 Views

What are you actually trying to achieve?

ndmpcopy is only one way to copy a LUN, but snapmirror or even lun cloning for temporary copies might be better in your case.

sureshgsk
12,074 Views

Need to copy to a new LUN as previous LUN has been created in incorrect volume. So need to create a new volume, and then copy the LUN.

pascalduk
12,074 Views

Clear. Then ndmpcopy or qtree snapmirror, if you have the license, is the way to go.

sureshgsk
12,074 Views

Question on ndmpcopy..

Do I need to create a new LUN before I perform ndmpcopy or will ndmpcopy will create a new LUN when I perform ndmpcopy?

aborzenkov
12,074 Views

it will create destination

paulstringfellow
8,689 Views

Yep, its copying the data from the volume…the lun is actually a file on the volume call ****.lun (with **** been the LUN name you created) the .lun file will sit on the new volume..you’ll just need to remap the server to the new LUN on the volume… so you can see it…

If there is only the LUN on that volume and nothing else a vol copy would also work…or vol snapmirror…depends where you’re sending it…

SANJEEVROHILA
8,689 Views

i am copying a volume ...like below

XNApp2> ndmpcopy /vol/testVolume /vol/testVol1

Ndmpcopy: Starting copy [ 5 ] ...

Ndmpcopy: XNApp2: Notify: Connection established

Ndmpcopy: XNApp2: Notify: Connection established

Ndmpcopy: XNApp2: Connect: Authentication successful

Ndmpcopy: XNApp2: Connect: Authentication successful

Ndmpcopy: XNApp2: Log: DUMP: creating "/vol/testVolume/../snapshot_for_backup.3352" snapshot.

Ndmpcopy: XNApp2: Log: DUMP: Using Full Volume Dump

Ndmpcopy: XNApp2: Log: DUMP: Date of this level 0 dump: Mon Aug  6 15:16:01 2012.

Ndmpcopy: XNApp2: Log: DUMP: Date of last level 0 dump: the epoch.

Ndmpcopy: XNApp2: Log: DUMP: Dumping /vol/testVolume to NDMP connection

Ndmpcopy: XNApp2: Log: DUMP: mapping (Pass I)[regular files]

Ndmpcopy: XNApp2: Log: DUMP: mapping (Pass II)[directories]

Ndmpcopy: XNApp2: Log: DUMP: estimated 0 KB.

Ndmpcopy: XNApp2: Log: DUMP: dumping (Pass III) [directories]

Ndmpcopy: XNApp2: Log: DUMP: dumping (Pass IV) [regular files]

Ndmpcopy: XNApp2: Log: DUMP: dumping (Pass V) [ACLs]

Ndmpcopy: XNApp2: Log: RESTORE: Mon Aug  6 15:16:02 2012: Begin level 0 restore

Ndmpcopy: XNApp2: Log: RESTORE: Mon Aug  6 15:16:02 2012: Reading directories from the backup

Ndmpcopy: XNApp2: Log: RESTORE: Mon Aug  6 15:16:03 2012: Creating files and directories.

Ndmpcopy: XNApp2: Log: RESTORE: Mon Aug  6 15:16:03 2012: Writing data to files.

Ndmpcopy: XNApp2: Log: RESTORE: Mon Aug  6 15:16:03 2012: Restoring NT ACLs.

Ndmpcopy: XNApp2: Log: RESTORE: RESTORE IS DONE

Ndmpcopy: XNApp2: Log: RESTORE: The destination path is /vol/vol0/vol/testVol1/

Ndmpcopy: XNApp2: Notify: restore successful

Ndmpcopy: XNApp2: Log: DUMP: 11 KB

Ndmpcopy: XNApp2: Log: DUMP: DUMP IS DONE

Ndmpcopy: XNApp2: Log: DUMP: Deleting "/vol/testVolume/../snapshot_for_backup.3352" snapshot.

Ndmpcopy: XNApp2: Notify: dump successful

Ndmpcopy: Transfer successful [ 2 seconds ]

Ndmpcopy: Done

XNApp2> vol status /vol/testVol

vol status: No volume named 'testVol' exists.

XNApp2> vol status /vol/testVol1

vol status: No volume named 'testVol1' exists.

XNApp2> vol status /vol/vol0/vol/testVol1

vol status: Illegal volume name '/vol/vol0/vol/testVol1'.

usage:

vol status [<vol-name>] [-d | -r | -v | -l | -c | -b | -s | -f | -m | -w | -?]

  - print the status of volume <vol-name> (or all volumes)

  (Only -v, -l, -b, and -? are available in a vfiler context)

how can i see the volume now ???

aborzenkov
8,689 Views

ndmpcopy does not create target volume - it must exist before command is executed. You have to create it manually. What you did, is to copy content /vol/testVolume into directory on volume /vol/vol0.

gdefevere
8,688 Views

I used the same ndmpcopy method lik described above to copy LUN from one storage system to another.

Why ndmpcoyp : volume/qtree contained other files that I don't need to copy !

Now that everything is copied to the destination, I see the file, but the filer doesn't recognize it as a LUN (not listed under LUNS). When I looked for a solution, I discovered this discussion.

What now ?

ETZION_BARNOY
8,688 Views

I have encountered the same problem, and had to take a short while thinking about it. Using NDMPCOPY, when the target LUN is not identified (seen it when copying a file/LUN and not a volume), you can go by this little blog post I have written:

http://run.tournament.org.il/netapp-copy-lun-between-filers-using-ndmp/

gdefevere
8,689 Views

Thanks for the feedback (very detailed explanation). I will try it on next opportunity.

Public