How to freeze ext3 file system
I want to develop a application with C for Red Hat Linux Enterprise AS2.1 platform...
The function is as follows: - freeze the file system(ext2 or ext3) - take the backup - thaw the file system. But I don't know that how to freeze the file system with ioctl or other system calls? So I want to get some help. Please tell me for detail usage and notice items. thanks... Regards, Xiao Liang:Pengy: |
How about
Code:
mount -o remount -o ro /dev/hdXX |
ToniT
I think that other processes still can access mountpoint with read-only. but also the processes which is writing data to mountpoint terminate for failing to write. regards. |
If some are trying to write into it while you remount it, your remounting fails.
If you really don't want anyone to even try to open the disk for writing, then you should drop into single user mode for that time. Though I don't see much harm in processes trying to open files. |
Sorry, Please teach that how to drop into single user mode?
In addition, before taking the backup, if I want to hang the processes which is writing data to disks and which try to open the disk for reading or writing, Please teach how to do? regards. |
Code:
init 1 |
That will restart Linux, this is not expecting.
Before taking the backup, as follows require can be got: 1. don't unmount the disks 2. block(or hang) the processes which have opened the disks for reading or writing, but don't make the processes terminate. 3. block(or hang) the processes which try to open disks, but don't make the processes terminate. 4. take the backup. 5. recovery, make the processes which have opened the disks for reading or writing continue to do. Regards. |
init 1 wont restart linux. init 0 or init 6 does.
Why can't you just tar to take a running copy of the system? If this, for some reason, unacceptable, you might want to familiarize yourself with raid mirroring (they make an exact copy of the partition while it is actively in use). Alternatively you can try to do some tricks with lvm; they do process holding and some other tricks when moving data around in physical layers. |
กกกก
At present, lvm have realized above functions(freeze function) on the file system reiserfs, Veritas File System also have realized on the file system vxfs. Now I also want to realize above functions on the file system ext3 not to use lvm or Veritas File System. But I don't know how to do. Regards. |
All times are GMT -5. The time now is 04:14 PM. |