Eric.Chacron@alcatel.fr
2003-Jun-06 09:36 UTC
how to use LVM snapshot with ext3 - VFS lock patch applicability
Hi, I have an ext3 file system on top of LVM and i use journaled mode. I would like to make a snapshot of my filesystem while the application is running in order to backup on another physical storage. For that i have to create an LVM snapshot and then to mount it in read-only for copying the content. This is not possible as far as ext3 needs to do a log replay at mount time ( AFAIK). I would like to know how do that : when is the VFS lock patch needed ? what does it change in the VFS behavior ? and what is the effect on my application ( on the journal usage and the performances for instance) ? The next question will be to know whether an ext3 snapshot feature is planed or if i need to use EVMS rather than LVM. Eric
Andreas Dilger
2003-Jun-07 20:00 UTC
Re: how to use LVM snapshot with ext3 - VFS lock patch applicability
On Jun 06, 2003 11:36 +0200, Eric.Chacron@alcatel.fr wrote:> I have an ext3 file system on top of LVM and i use journaled mode. > I would like to make a snapshot of my filesystem while the application is > running in order to backup on another physical storage. > > For that i have to create an LVM snapshot and then to mount it in read-only > for copying the content. This is not possible as far as ext3 needs to do > a log replay at mount time ( AFAIK).This is exactly why you need the VFS lock patch - to give ext3 the chance to flush the journal before the snapshot is done.> I would like to know how do that : when is the VFS lock patch needed ? > what does it change in the VFS behavior ? and what is the effect on my > application (on the journal usage and the performances for instance) ?There shouldn't be any effect on the application except for a very small pause in writes to the disk as the journal is locked and flushed for the snapshot to be taken. After the snapshot is done the application can continue to write to the filesystem without ever being aware that anything happened. As for performance effects, that depends on how long you have your snapshot active, how much you write into the filesystem, and whether the snapshot is on the same or a different disk/controller. With any LVM snapshot, you need to copy the data from the original disk to the snapshot volume before you write new data there. If your original filesystem has a lot of writes, then you will now have 2x that many writes (1 going to the snapshot). Once data has been copied to the snapshot, however, it does not need to be copied again so you only need to copy the original superblock, inode tables, etc to the snapshot once.> The next question will be to know whether an ext3 snapshot feature is > planed or if i need to use EVMS rather than LVM.There has been snapshot support in ext3 for a long time already. What is _still_ missing is the VFS locking patch in the standard kernel. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/
Eric.Chacron@alcatel.fr
2003-Jun-11 14:30 UTC
Re: how to use LVM snapshot with ext3 - VFS lock patch applicability
>This is exactly why you need the VFS lock patch - to give ext3 the chance >to flush the journal before the snapshot is done.Ok.>There shouldn't be any effect on the application except for a very small >pause in writes to the disk as the journal is locked and flushed for >the snapshot to be taken. After the snapshot is done the application >can continue to write to the filesystem without ever being aware that >anything happened.OK let's assume there is few delay for snasphot creation (only some LVM metadata to be updated).> >As for performance effects, that depends on how long you have your >snapshot active, how much you write into the filesystem, and whether the >snapshot is on the same or a different disk/controller. With any LVM >snapshot, you need to copy the data from the original disk to the snapshot >volume before you write new data there. If your original filesystem has >a lot of writes, then you will now have 2x that many writes (1 going to >the snapshot). Once data has been copied to the snapshot, however, it >does not need to be copied again so you only need to copy the original >superblock, inode tables, etc to the snapshot once.2x many writes: i'm not aware of how LVM performs its copy on write mechanism: what's the data unit used for replication from the original LV to the snapshot, when a page / block is modified on the original LV ? Eric Andreas Dilger <adilger@clusterfs.com> on 06/07/2003 10:00:39 PM To: Eric CHACRON/FR/ALCATEL@ALCATEL cc: ext3-users@redhat.com Subject: Re: how to use LVM snapshot with ext3 - VFS lock patch applicability On Jun 06, 2003 11:36 +0200, Eric.Chacron@alcatel.fr wrote:> I have an ext3 file system on top of LVM and i use journaled mode. > I would like to make a snapshot of my filesystem while the application is > running in order to backup on another physical storage. > > For that i have to create an LVM snapshot and then to mount it inread-only> for copying the content. This is not possible as far as ext3 needs to do > a log replay at mount time ( AFAIK).This is exactly why you need the VFS lock patch - to give ext3 the chance to flush the journal before the snapshot is done.> I would like to know how do that : when is the VFS lock patch needed ? > what does it change in the VFS behavior ? and what is the effect on my > application (on the journal usage and the performances for instance) ?There shouldn't be any effect on the application except for a very small pause in writes to the disk as the journal is locked and flushed for the snapshot to be taken. After the snapshot is done the application can continue to write to the filesystem without ever being aware that anything happened. As for performance effects, that depends on how long you have your snapshot active, how much you write into the filesystem, and whether the snapshot is on the same or a different disk/controller. With any LVM snapshot, you need to copy the data from the original disk to the snapshot volume before you write new data there. If your original filesystem has a lot of writes, then you will now have 2x that many writes (1 going to the snapshot). Once data has been copied to the snapshot, however, it does not need to be copied again so you only need to copy the original superblock, inode tables, etc to the snapshot once.> The next question will be to know whether an ext3 snapshot feature is > planed or if i need to use EVMS rather than LVM.There has been snapshot support in ext3 for a long time already. What is _still_ missing is the VFS locking patch in the standard kernel. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/