Monday, May 24, 2010

How to copy files in Ontap

As soon as someone asks this question we all say ‘use ndmpcoyp’ but what if you don’t have any network adapters configured, will ndmpcoyp work?

No; ndmpcopy is very useful if you want to copy a file or a whole volume however one thing very few people know that it doesn’t work if you don’t have loopback adapter configured because ndmpcopy passes all the data through lo adapter so it’s not only dependent on lo’s availability, its speed also. So how do you copy the data if lo is not available?

The answer is simple, use dd, just an old fashioned unix command which does lot of thing, not only it can copy the file with full pathname you can even use block number and disk number and the best part, syntax is simple ‘if’ for from and ‘of’ for to.

It can be used not only for copying file around the system, in fact you can use it for testing I/O and copying file from snapshot also and this command can be used regardless of permission.

A little note, if you are afraid of going in advanced or diagnostic mode better keep use rdfile and wrfile because this command is not available in admin mode so you have to go in advanced mode to use this.

Here’s the syntax of this command.

dd [ [if= file ] | [ din= disknum bin= blocknum ] ] [ [of= file ] | [ dout= disknum bout= blocknum ] ] count= number_of_blocks

Another note, if you are using count make sure you are using in multiply of 4 because a WAFL block size is 4k.


sim1> priv set advanced
sim1*> dd if=/vol/vol0/.snapshot/hourly.2/etc/snapmirror.conf of=/vol/vol0/etc/snapmirror.conf1


chantigadu said...

Hi Mohit,

I have gone through you Blog, it is really help full .... can I post my queries in netapp as iam a very fresh baby to storage

Mohit said...

Hi Chantigadu,

Sure, drop me a mail and I will try to help you by answering your question.


Rashid Iqbal said...

Hi Mohit

I want to move in NetApp Storage so could you please provide me NetApp Structure details.

Rashid Iqbal said...

Hi Mohit

It is really a happy moment for me to see you here. I want to move in NetApp Storage. Currently I am working in IBM Storage. So could you please provide me NetApp basic structure details so that I could understand about the NetApp Storage easily.

Mohit Agarwal said...


I would suggest you to attend ONTAP fundamentals course as it is what you need, however if you prefer to learn it on your own, there are few PPTs and other materials floating on internet and you can get your hands on them.

best of luck.