hi all, I intend to write a snapshot module for Ext2/3 file-systems. For that i need to make sure that FS is in consistent state before taking snapshot. For ex. in case of UFS, the superblock has a fs_clean flag which is set to be FSSTABLE to tell that its in consistent state. (otherwise its set to FSACTIVE) I m not able to find any such information for Ext2/Ext3. (The superblock does have a s_state flag, but that just tells whether file-system was cleanly unmounted or not.) Pls, let me know if you have any clue/info on this aspect. Thanks & Regards, Satish Singhal E-Mail: satish_single@hotmail.com _________________________________________________________________ Are you Unmarried? Register in India's No 1 Matrimony. http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?4d
On Jun 23, 2003 10:24 +0530, Satish Singhal wrote:> I intend to write a snapshot module for Ext2/3 file-systems. > For that i need to make sure that FS is in consistent state before taking > snapshot. > > For ex. in case of UFS, the superblock has a fs_clean flag which is set to > be FSSTABLE to tell that its in consistent state. (otherwise its set to > FSACTIVE) > > I m not able to find any such information for Ext2/Ext3. > (The superblock does have a s_state flag, but that just tells whether > file-system was cleanly unmounted or not.) > > Pls, let me know if you have any clue/info on this aspect.See ext3_sync_super_lockfs(), ext3_unlockfs(), and the LVM VFS-locking patch. These are used to put the filesystem into a stable state for a short time until the snapshot is created. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/
>See ext3_sync_super_lockfs(), ext3_unlockfs(), and the LVM VFS-locking >patch. >These are used to put the filesystem into a stable state for a short time >until the snapshot is created. >Sir, Thanks for your response. But my problem is a bit different. Once the snapshot is taken, how do I determine that the given snapshot image (Ext2/Ext3 File-System) is indeed consistent. Is there any field in super-block or any other on-disk structure which could tell the state of a raw File-System(Ext2/3) image. Regards, Satish Singhal _________________________________________________________________ Are you Unmarried? Register in India's No 1 Matrimony. http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?4d
On Jun 24, 2003 10:55 +0530, Satish Singhal wrote:> >See ext3_sync_super_lockfs(), ext3_unlockfs(), and the LVM VFS-locking > >patch. > >These are used to put the filesystem into a stable state for a short time > >until the snapshot is created. > > Thanks for your response. > But my problem is a bit different. > Once the snapshot is taken, how do I determine that the given snapshot image > (Ext2/Ext3 File-System) is indeed consistent. > > Is there any field in super-block or any other on-disk structure which could > tell the state of a raw File-System(Ext2/3) image.After the snapshot is taken (as above), the absence of EXT3_VALID_FS in s_mount_state, or the presence of EXT3_FEATURE_INCOMPAT_RECOVER in s_feature_incompat means that the snapshot was not valid. Cheers, Andreas -- Andreas Dilger http://sourceforge.net/projects/ext2resize/ http://www-mddsp.enel.ucalgary.ca/People/adilger/