swapping LVs about

Tony Arnold tony.arnold at manchester.ac.uk
Sun Sep 3 08:18:19 UTC 2006


Gabe,

On Sun, 2006-09-03 at 14:24 +0100, Gabriel M Dragffy wrote:
> Hi,
> 
> How is it possible to, for example, take a snapshot of root and then
> mount that snapshot in place of the real root partition, to try out some
> ideas or changes? Of course when I try to unmount the root partition I
> can't! Then after this how is it possible to swap them back to get the
> original root partition back?
> 
> I also have something that I don't understand. My root partition is 300M
> and has used about 170M of space. I created a 100M snapshot volume of it
> and it worked - how come it had enough space? How much space does a
> snapshot actually need, or more simply how does the snapshot work? I
> have read that excellent LVM howto, but these two points I don't fully
> understand and I don't think they are covered in more detail in the
> howto.

I'm not sure if it is possible to do what you want. A snapshot volume
just records the changes to its original volume. More accurately, if
something changes on the original volume, the old copy of the block that
is changing is written to the snapshot. When you mount the snapshot, the
system gets blocks that changed fro the snapshot, but block that have
not changed from the original volume.

Thus the snapshot volume can be a lot smaller than the original and you
need both available to read the snapshot.

I think what you really need to do is set up a mirror volume, or RAID 1
volume. This way the second volume is an exact copy of the original and
you could mount it separately once you break the mirror. I'm not sure if
this can be done at the logical volume level, or if you need to do it at
the partition level.

Regards,
Tony.
-- 
Tony Arnold, IT Security Coordinator, University of Manchester,
IT Services Division, Kilburn Building, Oxford Road, Manchester M13 9PL.
T: +44 (0)161 275 6093, F: +44 (0)870 136 1004, M: +44 (0)773 330 0039
E: tony.arnold at manchester.ac.uk, H: http://www.man.ac.uk/Tony.Arnold




More information about the ubuntu-users mailing list