[linux-lvm] Flushing a device

Roger Lucas roger at planbit.co.uk
Thu Mar 2 17:58:20 UTC 2006


I have a question regarding how to ensure that all data is flushed to a
logical volume before a snapshot is taken.  The exact scenario is as

I have the logical volume "/dev/mapper/userfiles" which is formatted with
Reiser3.  The volume has been created using "dmsetup ... crypt ..." on top
of a logical volume "/dev/storage/cryptdisk".

My aim is to be able to write a set of files to the "/dev/mapper/userfiles"
volume, then take a snapshot of the "/dev/storage/cryptdisk" as a backup,
knowing that the contents of the backup are encrypted.

I don't have a problem setting up the above scenario or creating the
snapshot volume, but I want to be sure that the files I have written will be
in the backup.  My concern is that if all file writes have not been flushed
through all the layers of LVM then I will not get all the files in the
snapshot of then encrypted volume.  I have tried issuing the "sync" command,
but I am not confident that this has worked.

Is it necessary to forcibly flush the data through each layer of the above
volume "stack" so that I know it is all on the snapshot, or is this taken
care of automatically when the snapshot command is issued and I am just
being paranoid...



More information about the linux-lvm mailing list