LVM snapshots in a file instead of wasting pre allocated space?
Hi,
I am just fiddling around with LVM and snapshots and was wondering if there is a way to use snapshots without wasting a lot of space. Normally, when you do a snapshot, the size you allocate for the snapshot must be free in the volume group. So if your snapshot will take 10% of your volume, you have to keep 10% reserved in the VG and this will be wasted and never be used for anything else than snapshots. Since I will not be using snapshots that much, I prefer to have a solution that is dynamical, i.e. that the snapshot space is a file that can grow and shrink. Currently, it seems that snapshots are similar allocated (and have to be space reserved for it rigidly, when you create the filesystem) like the swap space: you cannot use it for anything else. But with the difference, that swap space you might need every day, while snapshots you might only use from time to time. Resizing the filesystem and logical volume is not an option, as so far I have found, reduction of the FS does not work online and you have to shut down the server every time you do it, which is unfeasable. Can a LVM snapshot be put in a file and dynamically grow and take up as much space as it needs? In Windows I have noticed that you don't seem to have to plan for how large the snapshots become when you install the system /setup the filesystem, as it is dynamically taken from the FS. Cheers Markus |
Use btrfs instead of LVM.
|
Quote:
http://www.h-online.com/open/news/it...l-1471706.html quote: ---- Oracle the second Linux distributor to officially support Btrfs in an enterprise distribution, even though the filesystem is currently still considered experimental in the Linux kernel that is maintained by Linus Torvalds ... In Fedora, OpenSUSE and Ubuntu, Btrfs has been available during installation for some time. However, plans to use Btrfs as the default filesystem have repeatedly been postponed; one of the reasons is that only a rudimentary tool for testing and repairing Btrfs filesystems is available. Like SUSE, Oracle's distribution includes an improved variant of the btrfsfsck program that hasn't become available separately. The code for an improved test and repair tool has been available in the developer repository for Btrfs tools for a month – but it is located in a branch whose name, "dangerdonteveruse", clearly advises against its use. ---- Not something that I want to trust with my valuable data. Not having a basic maintenance tool is a nono for me. It is like getting a new car and well, having no wrench (yet) available to open the hood to check the oil, coolant and belts. But the premise of BTRFS is good, I just hope it will be ready this century still, it has been an a quasi beta state for a long time. |
But I was also not asking the question "what alternatives are there to LVM?" but more specific "how to do this with LVM?"
Markus |
And I answered it.
|
Quote:
|
To help others, this might be relevant:
http://glandium.org/blog/?p=2059 here a few excepts: ---- ...Debian Squeeze + btrfs = FAIL ...Lesson learned: Never use a file system without a working fsck in production... ---- Like me he is using RAID and Debian Squeeze and is looking for a fs that can do snapshotting. So it seems to be still a work in progress, beta stage. Not that great for a filesystem, as consistent and reliable operation is unfortunately not an option at such an essential layer of the OS. |
All times are GMT -5. The time now is 11:27 PM. |