LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Making system "bad shutdown" ready (https://www.linuxquestions.org/questions/debian-26/making-system-bad-shutdown-ready-348449/)

Red Squirrel 07-30-2005 08:23 PM

Making system "bad shutdown" ready
 
Is there a way to make ext3 as reliable as ntfs in terms of bad shutdowns? I'll be using a system as a router and don't have enough UPS capacity to put another machine on battery backup (and no "buy another one" is not the answer, I've spent enough money already), so if there's a power outage or what not, it will just shut off. Ext3 is very vulnerble to corruption if a system is badly shut down. I know, since I had to do it once, and my whole filesystem was gone.

So any way to make it more reliable, any mount settings or what not? Performance is not a huge issue on this server, so perhaps something that makes it so EOF markers are always there, and they are only removed for each access then put back, unlike the normal way where they are removed for the whole session, so bad shut downs means they are not put back so it messes up. (at least that's how my programming teacher describes it, I'm not sure if that's how it really works)

infinity42 07-31-2005 03:00 AM

I don't know much about this, but you might want to look at using data-journaling, rather than the default meta-data journaling. Meta-journaling only uses the journal to write the file metadata, helping to ensure that the FS's structure remains valid, but makes no attempt to journal the file's data. Data-journaling journals all writes to the disk. Bear in mind that data-journaling can slow down writes by up to a half (no effect on seeks though), but if that is not a problem then it should be a good bet.

Hope that helps

Red Squirrel 07-31-2005 09:06 AM

Hmm sounds like what I need. How do I go about doing that, and is it possible to do it on a partition to partition basis?

Ex: I want to do that for my OS partition, but for the logs partition I'd want to keep it normal as it would probably be a huge performance hit, this will be a firewall box so every packet will involve a disk write, pretty much.

And if I get a power outage loosing all the logs would not be as bad as loosing the OS,since it takes a while to rebuild, while logs would only be looked at once in a while anyway.

infinity42 07-31-2005 09:46 AM

The journaling options are set on a per-filesystem basis. IIRC then you just specify the journal mode when mounting by simply using '-o data=mode' as a mount option. Mode can be writeback, ordered, or journal. Writeback just does meta-data journaling.

In ordered mode:
Quote:

In data=ordered mode, ext3 only officially journals metadata, but it logically groups metadata and data blocks into a single unit called a transaction. When it's time to write the new metadata out to disk, the associated data blocks are written first. data=ordered mode effectively solves the corruption problem found in data=writeback mode and most other journaled filesystems, and it does so without requiring full data journaling. In general, data=ordered ext3 filesystems perform slightly slower than data=writeback filesystems, but significantly faster than their full data journaling counterparts.
In journal mode all data writes are journaled:
Quote:

data=journal mode provides full data and metadata journaling. All new data is written to the journal first, and then to its final location. In the event of a crash, the journal can be replayed, bringing both data and metadata into a consistent state.
So to mount an ext3 partition with full journaling something like this should work:
Code:

mount -t ext3 /dev/hdx /mnt/hdx -o data=journal
So I think you can just stick the journaling options you want onto the mount param's in your fstab.

Good luck && Have fun :)

heema 07-31-2005 09:56 AM

i use reiserfs and alot of the time it shutdown unexpectedly bec. of the electricity

and it never failed ( touch wood :D )

craigevil 07-31-2005 10:00 AM

"Reiser4"
http://www.ubuntuforums.org/showthread.php?t=27673

"Reiser4."
http://www.namesys.com/v4/v4.html

I used Reiser3 , (I think) on my Debian system ; it manages to get shut off about every couple of weeks either from thunderstorms or by my kids. I have been running it since November 2004 with no problems.

Red Squirrel 07-31-2005 12:13 PM

Cool thanks, I'll give that a shot and see what I get. I'll pull the power on it a few times to test out the best config. :D


All times are GMT -5. The time now is 09:11 AM.