DebianThis forum is for the discussion of Debian Linux.
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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,315
Rep:
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)
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.
Distribution: Mint 20.1 on workstation, Debian 11 on servers
Posts: 1,315
Original Poster
Rep:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.