Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
Handling power off with no shutdown
- 03-04-2004
- Brian Rosenthal
March 4, 2004, 7:27 pm

I have a control system that is running Linux. The user will not be
"shutting down", he will be simply turn the power off. When this
happens, I see "/dev/hda1 was not cleanly unmounted, check forced" and
then it scans/repairs the drive.
It seems that I could use some combination of initrd, a ramdisk and
remounting the hard drive as read-only to avoid this, but I have no
idea where to start.
Can anyone give me a clue? (I'm using SUSE v7.0 with RTAI)
-Brian Rosenthal
"shutting down", he will be simply turn the power off. When this
happens, I see "/dev/hda1 was not cleanly unmounted, check forced" and
then it scans/repairs the drive.
It seems that I could use some combination of initrd, a ramdisk and
remounting the hard drive as read-only to avoid this, but I have no
idea where to start.
Can anyone give me a clue? (I'm using SUSE v7.0 with RTAI)
-Brian Rosenthal

Re: Handling power off with no shutdown

In my system i've mounted the whole thing readonly, and only if i have to
write something to the disk (or in my case a cf-card) i have to remount it
in rw-mode, then i write, then i remount it in ro-mode again. All the
temporary stuff which linux will write goes into a ramdisk, so per
example /var is mounted in a ramdisk. In this way you can minimize the
writings.
This is maybe not the best way, but for me it works.
hth, Jens
--
Die o.a. Adresse ist OK, wird aber nicht gelesen. Für Mails an mich bitte
"usenet" durch "jens.nixdorf" ersetzen.
Die o.a. Adresse ist OK, wird aber nicht gelesen. Für Mails an mich bitte
"usenet" durch "jens.nixdorf" ersetzen.

Re: Handling power off with no shutdown
If nothing is written to the disk it can be mounted as read-only.
If the system writes to the disk at random times the only way is to add
a battery to provide power to do a shut down when power is switched off.
Using a journalling file system reduced the boot time after a not clean
shout down and enables a cleaner remounting of a not cleanly dismounted
partition, but increases the risk of interrupting a write cycles as a
lot more writes are done with a single transaction. So it's not
recommended when using some kind of flash instead of a disk.
-Michael
If the system writes to the disk at random times the only way is to add
a battery to provide power to do a shut down when power is switched off.
Using a journalling file system reduced the boot time after a not clean
shout down and enables a cleaner remounting of a not cleanly dismounted
partition, but increases the risk of interrupting a write cycles as a
lot more writes are done with a single transaction. So it's not
recommended when using some kind of flash instead of a disk.
-Michael
Site Timeline
- » 2D graphics on compulab ARM sbc under linux - advice please
- — Next thread in » Embedded Linux
-
- » uClinux 2.4.19 with 8MByte limit
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Miernik energii potrzebny, taki domowy
- — The site's Newest Thread. Posted in » Electronics (Polish)
-