LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 05-22-2010, 07:53 AM   #1
aceone
Member
 
Registered: Apr 2009
Posts: 55

Rep: Reputation: 15
what is a LVM snapshot?


Hi,
i want to know what exactly a LVM snapshot is? Is it a copy of entire LV thus it will be equal in size?
or is it entire copy and then just the changes updated?

Thanks & regards
 
Old 05-22-2010, 07:58 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Google is your friend in this type of question, consult him more often. I got the following result just typing your question and the first link has a pretty good description.

What's a LVM Snapshot

Kind regards,

Eric
 
Old 05-22-2010, 09:26 AM   #3
aceone
Member
 
Registered: Apr 2009
Posts: 55

Original Poster
Rep: Reputation: 15
I did that.I have read the article you provided, I have few doubts though.

1.if snapshots can be used as backup it must (at the time of creation)backs up everything
which will make it exactly of same size as origin (LV),
but one of redhat articles lists
"Because a snapshot copies only the data areas that change after the snapshot is created, the
snapshot feature requires a minimal amount of storage. For example, with a rarely updated
origin, 3-5 % of the origin's capacity is sufficient to maintain the snapshot"

how thats done?
 
Old 05-22-2010, 09:43 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

What it does is make a sort of 'list' that identifies the original state of files/folders at the first snapshot. Since it's only a list it occupies very little space. On the next snapshot it looks at the differences since the first snapshot and saves that list.

Last week at work we put a NetApp NAS in production and the tech guy told me the same, which I refused to believe (the fact that a snapshot doesn't occupy any space). Next thing he told me is that the 'system' reserves 20% of the total volume size for its snapshots. So basically, when you create a snapshot the differences are saved which occupies little space. When however you want to restore a snapshot you'll need the same amount of space available as the original to store it into; at least that's how I understood it.

Kind regards,

Eric
 
Old 05-22-2010, 09:57 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by aceone View Post
I did that.I have read the article you provided, I have few doubts though.

1.if snapshots can be used as backup it must (at the time of creation)backs up everything
which will make it exactly of same size as origin (LV),
but one of redhat articles lists
"Because a snapshot copies only the data areas that change after the snapshot is created, the
snapshot feature requires a minimal amount of storage. For example, with a rarely updated
origin, 3-5 % of the origin's capacity is sufficient to maintain the snapshot"

how thats done?
You are thinking on the right lines and asking good questions.

Snapshots are very useful while making backups but they are not backups because they do not contain everything from the original -- they only appear to when read. They are actually empty of data at the moment they are created.

When a snapshot is created, the original volume remains in place and writeable; another virtual volume is created which, when read, has the same data as the original volume at the time the snapshot was taken. When the snapshot is read, LVM provides data from the original volume if it has not changed. When something is written to the original volume, LVM makes a copy of the original block(s) in the snapshot and changes the original volume. Now, when block which has changed on the original is read from the snapshot, LVM provides it from the snapshot's copy of the original unchanged block.

Thus the snapshot size need only be as big as the size of the changes that will be made to the original volume during the snapshot's lifetime. For a rarely updated original, 3-5 % of the original's capacity is sufficient.

Last edited by catkin; 05-22-2010 at 10:00 AM. Reason: comprehensibilibility
 
1 members found this post helpful.
Old 05-22-2010, 12:01 PM   #6
aceone
Member
 
Registered: Apr 2009
Posts: 55

Original Poster
Rep: Reputation: 15
Thanks EricTRA and catkin,its much clear now
 
Old 05-22-2010, 12:08 PM   #7
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

You're welcome. Thanks to catkin too for the very clear explanation.

If you consider your question/problem solved then please mark it as such using the Thread tools.

Kind regards,

Eric
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Backupping with LVM snapshot tao_0077 Linux - Server 8 11-25-2012 10:43 AM
LVM Snapshot eldo Linux - Server 2 11-20-2009 04:10 AM
lvm snapshot using script Ammad Linux - General 2 11-15-2009 08:35 AM
lvm snapshot Ammad Linux - General 1 02-18-2009 07:03 AM
About LVM Snapshot geethusari LinuxQuestions.org Member Intro 1 12-03-2007 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration