Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
09-13-2004, 01:59 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2004
Location: China
Posts: 13
Rep:
|
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 
|
|
|
|
09-19-2004, 09:49 PM
|
#2
|
|
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357
Rep:
|
How about
Code:
mount -o remount -o ro /dev/hdXX
?
|
|
|
|
09-22-2004, 06:41 AM
|
#3
|
|
LQ Newbie
Registered: Sep 2004
Location: China
Posts: 13
Original Poster
Rep:
|
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.
|
|
|
|
09-22-2004, 08:01 AM
|
#4
|
|
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357
Rep:
|
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.
|
|
|
|
09-22-2004, 08:31 PM
|
#5
|
|
LQ Newbie
Registered: Sep 2004
Location: China
Posts: 13
Original Poster
Rep:
|
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.
|
|
|
|
09-22-2004, 10:03 PM
|
#6
|
|
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357
Rep:
|
the later is not so trivial.
|
|
|
|
09-22-2004, 10:34 PM
|
#7
|
|
LQ Newbie
Registered: Sep 2004
Location: China
Posts: 13
Original Poster
Rep:
|
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.
|
|
|
|
09-22-2004, 11:31 PM
|
#8
|
|
Senior Member
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357
Rep:
|
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.
|
|
|
|
09-23-2004, 12:27 AM
|
#9
|
|
LQ Newbie
Registered: Sep 2004
Location: China
Posts: 13
Original Poster
Rep:
|
กกกก
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:05 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|