Friday, November 14, 2014

What is NetApp snapshot ?

NetApp Snapshot are awesome and instantaneous :)


Everywhere you will read this line --> "A Snapshot copy is a read-only image of the active file system at a point in time." but what is the meaning of this statement ?

Actually Snapshot copies are a copy of the volume’s root inode.
An inode is a 192-byte data structure that is used to represent file system objects, such as files and directories.

Some mathematics to understand snapshot concept :

WAFL Block Size = 4KB
4KB = 4096 Bytes

In a 4KB BLOCK:
Metadata Size = 4032 Bytes
Data Size = 4096 - 4032 = 64 Bytes
1 Pointer Size = 4 Bytes
Data Block = 64 Bytes means 64/4 = 16 Pointers

1. If file size is less than 64 Bytes, data will be written in 4 KB block (in iNode itself).

2. If file size is greater than 64 Bytes (but less than 64 KB) then data block will not contain data , instead of data it will contain pointers to data blocks (how many pointers, as mentioned above data block is of 64 Bytes, 1 pointer = 4 Bytes, means 64/4 = 16 Pointers)

Now 16 Pointers can accomodate only 64 KB of data (how ??), Let me explain
16 Pointers will point towards 16 Blocks (1 Block = 4KB), so 16 x 4 = 64 KB

Clear as of now :), Let us make it more complex now

3. If file size is more than 64KB but less than 64 MB ?
Now as I explained in above point , we have 16 Pointers , pointing towards 16 Blocks. But if data size is more than 64KB , these 16 Blocks will again contain pointers, How many pointers .. any guess ?
4 KB = 4096 Bytes (and 1 Pointer = 4 Bytes)
4096/4 = 1024 Pointers (each block will have 1024 Pointers)

Calculations (roughly)
1024 (Pointers) x 16 (Blocks) x 4 (4K size) = 65536 KB = 64 MB (approx.)

Understood :)

5. If file size is more than 64 MB but less than 64 GB
In above point , we have 64 MB , roughly 64000 KB
1 Block = 4 KB
No. of blocks = 64000/4 = 16000 Blocks

Calculations (roughly)
16000 (no. of Blocks)  x 1024 (pointers) x 4 (block size) = 65536000KB = 64 GB (approx)

6. Like wise you can calculate for file size greater than 64GB but less than 64 TB








5 comments:

  1. Marvelous explanation, I was looking for the same.

    ReplyDelete
  2. One of the koolest and easiest explanation , I have seen on Internet. Thank you.

    ReplyDelete