Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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"
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.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.