File system journaling is a method of logging intended changes before and during execution, allowing the system to detect and recover from incomplete operations that could otherwise cause data corruption or loss.
File System Journaling
Some of our file systems will actually do something called journaling. Journaling is a way that we can avoid some corruption that can happen on our devices and on our files.
Journaling is a term in computers that we can use in a lot of different scenarios, so I'm just going to explain what the concept of journaling is first.
In your processes there's multiple things that have to happen. For instance, let's say we are selling something online and we want to charge the customer and then we're going to ship a product to them. We're just going to keep it simple and say there's two steps with this. Let's say I first of all take their order, maybe I'm online with them and I take their order, and so I charge their credit card for that order, and then I go and ship that order to them. But let's say I get distracted somewhere in between, so shipping never happens, I never get to the shipping part. That's problematic, because now our customer didn't receive their product but we've already charged them for that product.
So what happens is typically we write up an order, something that we write up that says we're going to ship it to this person. We charge the card for them, and then we take that order and we put it in the pile to be processed. We send them what needs to be sent to them, and then we take that order and put it in the finished pile. So there is some sort of record that's taking place that says we've completed this, this is now finished, to make sure that all our products get shipped out after we charge our customer.
The same thing happens in file systems. There are changes where multiple processes, multiple steps, have to happen. As an example, let's say we delete file two from the system. It deletes it from the file allocation table, but it also needs to go and mark inside the actual data that now it can be written over, now we don't need this data anymore. So there's multiple steps that need to happen here.
But let's say something happens on the computer and we don't finish the task. Now what happens is that we remove it from the file allocation table, but we never mark that that space is free now, and now we've lost a chunk of data, we lost some of the data on our device. So this is just one example that can happen, but there are other things that can happen on our device too if we don't do journaling.
What journaling is, is that the first thing we're going to do is record what action we're trying to take. For instance, we're going to delete file.txt. Then we go through the process of deleting it from the file allocation table, and then we delete it or remove it, we mark it as being available in where our data is at, and then we mark this as being done. We can put a check mark next to it. Now if something happens along the way and the computer gets distracted, like maybe it gets shut down, it can recover from that, because it knows it can now do an assessment to see if it needs to go back and correct anything.
Not all file systems do this. The ones that do this we call journaling file systems. We can apply journaling in many different systems, like databases, but a journaling file system is a file system that actually does this process.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →