LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-11-2017, 06:09 AM   #1
PrideOfUsingLinux
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Rep: Reputation: Disabled
LVM Snapshots


hi,

I am unclear on which do I backup. Do I backup the lvm logical filesystem or the mounted snapshot directory? signed confused...
 
Old 04-11-2017, 06:14 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
What do you mean by which do you back-up? What are you using to do the back-ups.

How are you looking at backing up the lvm logical filesystem? backing up the entire filesystem would be better from a bare metal restore perspective but you need to make sure you back-up everything and not just the COW file/data. doing it from a mounted directory maybe easier however and would mean you are doing file level back-ups instead, it'd make doing a bare metal restore a much longer process but restoring individual files maybe easier, based on what you are using to do the back-ups.
 
Old 04-11-2017, 07:49 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,481

Rep: Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096
The reason for taking a snap is to get a point-in-time consistent image of the filesystem. Back that up.
In all likelihood the base filesystem will be changing continually, so is inappropriate as a backup source.
 
Old 04-11-2017, 08:08 PM   #4
PrideOfUsingLinux
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I found the answer too doing more searches. It is the mounted snapshot that I make the backup from.
 
Old 04-11-2017, 08:21 PM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Maybe I misunderstood, I thought you were talking about actually just copying the logical volume of the snapshot itself.

Anyways, depending on what you are doing, a snapshot alone might not be enough. For example, if you are using mysql/mariadb, then you'd also have to take the step of read-locking the entire thing prior to creating the snapshot, once the snapshot is created you can kill the global read-lock. In short, always make sure your back-up method is appropriate to the task you are doing.
 
Old 04-11-2017, 10:03 PM   #6
PrideOfUsingLinux
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
Isn't the purpose of a snapshot is to make a backup of the system while users are still doing their usual business on the system. Also from what I read, backing up from the snapshot allows mysql or other services to remain active as users read and write to it. Also, I read the snapshot is just to hold changes that are being made in the filesystem you made a snapshot of.
 
Old 04-11-2017, 11:06 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,481

Rep: Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096Reputation: 3096
Quote:
Originally Posted by r3sistance View Post
In short, always make sure your back-up method is appropriate to the task you are doing.
Keep that in mind, after which you can do whatever is appropriate.
Do you require referential integrity, can you withstand the time delay of trans roll-back during restore ... ? All sorts of issues pop up.

For non-DB filesystems, the system handles freezing the I/O - snaps are a no-brainer in that case. As for only holding "changes", the snap actually holds the unchanged (initial) version of any data that changes subsequent to the snap being taken. Hence they can grow over time. However it has reference to the entire filesystem, so you can take a full backup using the snap.

Snaps are in themselves not a robust backup - but they are excellent sources for backups.
 
Old 04-12-2017, 12:03 AM   #8
PrideOfUsingLinux
LQ Newbie
 
Registered: Apr 2017
Posts: 4

Original Poster
Rep: Reputation: Disabled
I am new to LVM so I can't debate on the proper usage or any prerequisite to be done before doing the snapshots. You both can be right. There are tons of info on LVMs and some are dated too. Maybe I'll practice LVM snapshots on a spare desktop.

Last edited by PrideOfUsingLinux; 04-12-2017 at 12:05 AM.
 
  


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
LVM and snapshots sagar666 Linux - Server 8 05-14-2015 09:02 PM
Periodic LVM snapshots hydraMax Linux - Server 4 11-27-2010 05:14 PM
LVM Snapshots, can they be disabled? Stiken Linux - Newbie 2 01-29-2010 03:57 PM
LVM snapshots: How to use? gargamel Linux - Server 12 02-24-2008 03:57 PM
LXer: Back Up (And Restore) LVM Partitions With LVM Snapshots LXer Syndicated Linux News 0 04-17-2007 12:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration