I have a fileserver that I just setup lvm on. I have two LVM partitions /dev/fileserverLVM/home /dev/fileserverLVM/backup
I'd like to take and store the snapshots in /dev/fileserverLVM/backup. The stuff I've read all has you creating a new logical partition. Can this be avoided and the snapshot written directly to /dev/fileserverLVM/backup? Or do I have no options?
Snapshot is the volume of it's own by definition, so it must be added to Volume Group as it.
If you want an almost instant copy of the working home LV within your backup LV using snapshots, you can proceed as follows:
lvcreate -LXG -s -n snapshot /dev/fileserverLVM/home
dd if=/dev/fileserverLVM/snapshot of=/dev/fileserverLVM/backup bs=1M
lvremove /dev/fileserverLVM/snapshot
No that isn't really an option..
What you could to achieve this behavior is something like this.
The important thing to remember is that you must have enough free physical extents in your volume group to accomplish this.
See snapshot backup section of the LVM HOWTO.
I wanted this to be a comment to but the formatting in comments is unreadable so:
The other thing to remember is that you want to use a file system that can be quintessed ( see xfs _freeze , xfs _freeze -u ) before the snap shot so the correct set would be: