Skip to contentSkip to conversation

Backup of ROOT Partition.

linux-lvm Jean-Philippe Villeneuve 4 participants 8 messages Jun 30, 2008 – Jul 16, 2008

lore
Share & tools
lore
#0 lore raw

Hi,
I would like to know if I can backup all my system partitions(ROOT included) using a snapshot? I searched the internet for this information and found nobody that said that this was possible or not. if someone has a link to a page that describes this I would really appreciate this information. Thank You.

Jean-Philippe Villeneuve
Programmeur R&D/Programmer R&D
MULTI-�LECTRONIQUE (MTE) INC.
www.multi-electronique.com
T�l. : (418) 724-5835

#1 lore raw

Hi Jean-Philippe,

yes, I make backup of my ROOT partition every day using snapshot functionality!

Alessandro

----- Original Message ----- From: "Jean-Philippe Villeneuve" <[email protected]>
To: <[email protected]>
Sent: Monday, June 30, 2008 11:06 PM
Subject: [linux-lvm] Backup of ROOT Partition.

Quoted 16 lines

Hi,
I would like to know if I can backup all my system partitions(ROOT included) using a snapshot? I searched the internet for this information and found nobody that said that this was possible or not. if someone has a link to a page that describes this I would really appreciate this information. Thank You.

Jean-Philippe Villeneuve
Programmeur R&D/Programmer R&D
MULTI-�LECTRONIQUE (MTE) INC.
www.multi-electronique.com
T�l. : (418) 724-5835

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#2 lore raw
In reply to Jean-Philippe Villeneuve

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Quoted 2 lines · Jean-Philippe Villeneuve

I would like to know if I can backup all my system partitions(ROOT included) using a snapshot?

Depends on what you mean by "backup [...] using a snapshot".

If you mean taking a snapshot, then mounting it somewhere and pointing your backup software to that mount point, then unmounting and deleting the snapshot after the backup is done, then yes, it should work fine.

If you mean taking a snapshot and leaving it around forever *as* the backup, then that will work -- but the more backups you have, the slower LVM gets (currently). This is because of the copy-on-write code: every time the root logical volume changes, all of the snapshots need to be updated. If you only have one or two snapshots, this isn't so bad, but if you had (say) 20, writing to your real root LV would slow to a crawl.

There is some code hanging around somewhere that I *think* is supposed to handle this better, but I don't know the status... -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIag79S5vET1Wea5wRA6aRAKCuFkT9BXlmtiyke1bFPw5CJYGtRQCeI27D ++3wT6+y0d3oYjmxEVA2NmY=
=1UlT
-----END PGP SIGNATURE-----

#3 lore raw
Quoted 9 lines · Bryan Kadzban

If you mean taking a snapshot and leaving it around forever *as* the backup, then that will work -- but the more backups you have, the slower LVM gets (currently). This is because of the copy-on-write code: every time the root logical volume changes, all of the snapshots need to be updated. If you only have one or two snapshots, this isn't so bad, but if you had (say) 20, writing to your real root LV would slow to a crawl.

There is some code hanging around somewhere that I *think* is supposed to handle this better, but I don't know the status...

You may be referring to ddsnap, go to
http://code.google.com/p/zumastor/source/browse and look at svn/trunk/ddsnap. And you can check out and build from google code too of course.

I find it difficult to tell where this is going though, there doesn't seem to be disagreement between the people who maintain ddsnap and the people who maintain lvm2, but I haven't found any statements about what the way forward is.

Any comments from lvm2 maintainers?

Signature · 2 lines
Dan Shearer
[email protected]
#4 lore raw
Quoted 1 line · Dan Shearer

http://code.google.com/p/zumastor/source/browse

The "zumastor" name rings a few bells, so I do believe that's what I was thinking of, yes.

Quoted 3 lines

there doesn't seem to be disagreement between the people who maintain ddsnap and the people who maintain lvm2, but I haven't found any statements about what the way forward is.

As a user, I'm just waiting to see what happens, and using the plain old LVM code in the meantime. That works out well enough, as long as I'm aware of its limitations, which is the only reason I mentioned the poor write performance with large numbers of snapshots. :-)

So we'll see.

#5 lore raw
In reply to Bryan Kadzban
Quoted 5 lines · Bryan Kadzban

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Jean-Philippe Villeneuve wrote:

Quoted 9 lines
Quoted 2 lines

I would like to know if I can backup all my system partitions(ROOT included) using a snapshot?

Depends on what you mean by "backup [...] using a snapshot".

If you mean taking a snapshot, then mounting it somewhere and pointing your backup software to that mount point, then unmounting and deleting the snapshot after the backup is done, then yes, it should work fine.

This is exactly what I want to do. I just want the latest configuration, users files etc. I realy don't need files at a specific date with tons of backups.

Than you all for the fast and acurate answers.

Jean-Philippe

#6 lore raw

I tried the folowing recipe: http://tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html with the folowing script:

/****************************/

#!/bin/sh
BAKLVMNAME=sysbackup
lvcreate -L592M -s -n $BAKLVMNAME /dev/VolGroup00/LogVol00 mount /dev/VolGroup00/$BAKLVMNAME /mnt/sysbackup/ -o ro cd /mnt/sysbackup
time tar -cjvpf /mnt/serveur/backSysVol.bz2 *
cd ..
umount /mnt/sysbackup
lvremove -f /dev/VolGroup00/$BAKLVMNAME

/****************************/

I get the folowing error:
Rounding up size to full physical extent 608.00 MB Insufficient free extents (1) in volume group VolGroup00: 19 required

It works find if I do it with -L20M.
How do I change the LogicalVolumeSize?

according to 'df' I have plenty of space for data.

# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      35G  6.0G   27G  19% /
/dev/md0              677G  270G  373G  42% /mnt/serveur
/dev/sda1             190M   26M  155M  15% /boot
tmpfs                 374M     0  374M   0% /dev/shm

Am I missing something?

Quoted 29 lines · Jean-Philippe Villeneuve
Quoted 5 lines · Bryan Kadzban

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Jean-Philippe Villeneuve wrote:

Quoted 9 lines
Quoted 2 lines

I would like to know if I can backup all my system partitions(ROOT included) using a snapshot?

Depends on what you mean by "backup [...] using a snapshot".

If you mean taking a snapshot, then mounting it somewhere and pointing your backup software to that mount point, then unmounting and deleting the snapshot after the backup is done, then yes, it should work fine.

This is exactly what I want to do. I just want the latest configuration, users files etc. I realy don't need files at a specific date with tons of backups.

Than you all for the fast and acurate answers.

Jean-Philippe

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#7 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Quoted 5 lines · Jean-Philippe Villeneuve

I get the folowing error:

Insufficient free extents (1) in volume group VolGroup00: 19 required

It works find if I do it with -L20M.

You need to either grow the physical volume if possible, add extra physical volumes to the volume group (and therefore grow the volume group), or shrink the existing logical volume.

Quoted 1 line

according to 'df' I have plenty of space for data.

Yeah, but that's not the space that logical volumes use.

LVs are allocated from inside the group-of-physical-volumes in a VG. Think of LVs like partitions: if you have tons of space available on the FS that's inside a partition, that doesn't necessarily mean you can add a new partition to the disk. You'll have to either shrink the existing LV, or add more physical volumes to the group.

I believe either can be done while the FS is mounted. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIfnS4S5vET1Wea5wRA2bLAKDbIXtd9c56WFCWM8hf2Au5t7D/TgCgoV0k BPTR74O1ES4C1bFJKdfhESI=
=p+QB
-----END PGP SIGNATURE-----