Wed, 08 Nov 2000 mai wrote:
> Hi,
> I had insert my module test.o successfully,Thank everyone!
> I have another problem now,my system had to be power off
> suddenly,randomly,the operating system can not shutdown normally,Can the
> rtlinux work normally again after sudden power off?
Generally, no, just as for normal Linux systems - you will occasionally get
file system crashes that fsck can't fix automatically, or even crashes that
can't be fixed with less than a system reinstall. (Any OSes with r/w
non-journalling file systems has this problem - that's one reason why I power
my new workstation and server at home from a UPS. Too many brown-outs for my
nerves...)
However, if you can run your application without writing data to disk, it's
possible to set it up so that all file systems are mounted read-only. An
alternative way is to run you system from a ram-disk that's created at boot
time.
If you have to write some data occasionally, you could get away with
temporarilly mounting a partition (preferably NOT the system partition!) R/W,
write to it, and then unmount it, or remount it read-only. (I use this on my
home server in order to do automatic quick backups to a secondary hard drive
that's normally unmounted and powered down.)
If you want to be *safe*, do the above, but use two partitions, and do this:
1. Mount partition A.
2. Write data to partition A.
3. Sync A.
4. Verify A.
5. Unmount A.
6. If ERROR ==> "Write error on Partition A!" ; FAIL;
7. Mount partition B.
8. Write data to partition B.
9. Sync B.
10. Verify B.
11. Unmount B.
12. If ERROR ==> "Write error on Partition B!" ; FAIL
Now, the worst thing that can happen is that you lose power while writing
either partition A or B, thus corrupting it. One of the partitions will always
be OK.
At boot you do this:
1. Check Partition A.
2. If ERROR ==> image copy Partition B to Partition A ; GOTO 5
3. Check Partition B.
4. If ERROR ==> image copy Partition A to Partition B.
5. Sync.
6. Continue booting.
After this sequence, both partitions will be ok (provided there are no hard
errors on the disk), and the write algorinhm above will work safely.
Another way is to simply throw in a journalling file system, and rely on that
to do the job. :-) Look at Reiserfs, for example.
//David
..- M u C o S -------------------------. .- David Olofson --------.
| A Free/Open Source | | Audio Hacker |
| Plugin and Integration Standard | | Linux Advocate |
| for | | Open Source Advocate |
| Professional and Consumer | | Singer |
| Multimedia | | Songwriter |
`-----> http://www.linuxdj.com/mucos -' `---> [EMAIL PROTECTED] -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/