LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-23-2018, 07:13 AM   #1
SedAwk
LQ Newbie
 
Registered: Jun 2018
Posts: 4

Rep: Reputation: Disabled
Once Off Point in time snapshot


Hi,

https://www.centos.org/docs/5/html/C...t_command.html

Only shows how to create a lvm snapshot that continues to grow. How can I create a once-off kind of point-in-time snapshot that I can save as a backup?

Thanks in advance
 
Old 06-24-2018, 03:36 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
A snapshot *IS* point-in-time.
The reason it keeps growing is that as the source is updated, the "pre-update" blocks are copied to the snap to ensure the P-i-T consistency. Snaps are not a good backup in themselves, but they are a superb source for a backup. What I do is take a snap then copy that off at my leisure to some permanent backup media. Then the snap can be deleted to stop it continually consuming (more) space.
Snaps have to be managed, but they are the best thing for data consistency.
 
Old 06-24-2018, 12:05 PM   #3
SedAwk
LQ Newbie
 
Registered: Jun 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
A snapshot *IS* point-in-time.
The reason it keeps growing is that as the source is updated, the "pre-update" blocks are copied to the snap to ensure the P-i-T consistency. Snaps are not a good backup in themselves, but they are a superb source for a backup. What I do is take a snap then copy that off at my leisure to some permanent backup media. Then the snap can be deleted to stop it continually consuming (more) space.
Snaps have to be managed, but they are the best thing for data consistency.
Thank you very much, I am well aware of the reason why it is growing. I was just hoping I can get an exact copy of what it looked like at a specific time, like just before I made a change to.
I found the following:
lvcreate -L 1GB -s -n My-ROOT_snap /dev/vg_root/root

I will see if this one is the growing type too.

TIA
 
Old 06-24-2018, 06:15 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,103

Rep: Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117Reputation: 4117
Quote:
Originally Posted by SedAwk View Post
I was just hoping I can get an exact copy of what it looked like at a specific time, like just before I made a change to.
That is exactly what a snap does. Maybe you need to read up on how copy-on-write works - perhaps think of it as a de-dup for your original data and any snaps.
When you reference the data in a snap, unchanged blocks are retrieved from the original data, while changed blocks are read from the snap itself. All the data are as they were at the time of the snap. This is why I can use a snap as a source for a backup - and it doesn't when I actually do the backup.
I don't use LVM snaps but btrfs, but conceptually they are similar in effect. I regularly take a snap before I work on my photos - if I screw up I revert to the snap and all my (bad) changes are gone. Else if I'm happy with the work, I simply delete the snap. Maybe you are hoping to do similar.
 
Old 06-25-2018, 12:59 PM   #5
SedAwk
LQ Newbie
 
Registered: Jun 2018
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
That is exactly what a snap does. Maybe you need to read up on how copy-on-write works - perhaps think of it as a de-dup for your original data and any snaps.
When you reference the data in a snap, unchanged blocks are retrieved from the original data, while changed blocks are read from the snap itself. All the data are as they were at the time of the snap. This is why I can use a snap as a source for a backup - and it doesn't when I actually do the backup.
I don't use LVM snaps but btrfs, but conceptually they are similar in effect. I regularly take a snap before I work on my photos - if I screw up I revert to the snap and all my (bad) changes are gone. Else if I'm happy with the work, I simply delete the snap. Maybe you are hoping to do similar.
Thank you for that, Syg00 & 5871519 ?

I have a few more questions on this, if you all don't mind...
Linux snapshot scenarios

====================




1) On 1 Jan, create a snapshot of /etc

2) On 2 Jan, change /etc/hosts

3) On 3 Jan, make another change to /etc/hosts

4) On 4 Jan, make a change to /etc/sysconfig/network




Q1) Is it still possible on 6 Jan, to restore /etc/hosts from the lvm snapshot to what it looked like on 1 Jan?

Q2) Which copy of /etc/hosts will be on the system if the snapshot is rolled back on 7 Jan?

Q3) If I send the snapshot across to a different system using dd or scp, what which of the /etc/host versions will arrive on the other system?

TIA
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Time-efficient LVM snapshot migration davidcH Linux - Server 7 02-16-2012 10:28 AM
Getting a snapshot of server activity at freeze time Vanyel Linux - Server 1 12-04-2009 11:15 PM
LVM snapshot(configuring backup time) abhishekrahel Linux - General 1 10-07-2008 10:28 PM
snapshot in time of rpm's installed proteus2 Red Hat 4 07-04-2008 05:22 PM
First time installing, mount point? smagee12 Linux - General 1 10-23-2005 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:25 AM.

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