Discussion with all linux champions and guru on How fsck works???
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Discussion with all linux champions and guru on How fsck works???
Hi All linux Guru's and linux lovers and all users who loves to live in linux world.Thanks to all for four great work and contributions for linux
and thanks to linuxquestions.org for giving us such a wonderful platform.
Well now come to the point as we all know that fsck is used for file system check and for recovering file systems. We also know that if we want to run fsck on root partition then it should be in unmounted stated first (let me correct if i am wrong). And we also know that fsck recovers file in steps and its around 5 or 6 steps that fsck uses to recover files.
We all have run fsck many times and uses it but still we most of us are not sure how fsck works. What are the steps that fsck uses to recover to file. How fsck recovers block , inodes.
So i really appreciate if someone explain all the working machinism of fsck. So here i want to discuss with all the linux lovers and experts about this. Please give your valuable advice and give your contribution so there there is no more confusion with working process of fsck.
Thanks a lot in advance...
Last edited by vap16oct1984; 07-29-2009 at 01:25 AM.
Well let me discuss few more about fsck
fsck also reports various informations about the allocation of files and directories, giving a detailed count of the amount of disc space that is wasted due to the way files are stored on it.
Generally, fsck is run automatically at boot time when the operating system detects that a file system is in an inconsistent state, indicating a non-graceful shutdown, such as a crash or power loss.
While this thread is a Linux issue/question, it is not server specific in any way, but more of a general-purpose thread, so I'm moving it to 'Linux - General'
Hi Nathacof,
thanks for your useful links. But You have got got my point i have no issue with file systems.
Quote:
Originally Posted by nathacof
Read these articles to get an in depth understanding of how a filesystem works in Linux:
Well here i want to know about the fsck. How does it works and what are the steps of fsck. So i want to discuss all about the great and small things of fsck.
Hi GrapefruiTgirl,
Its better if we talk about the work of fsck.
Quote:
Originally Posted by GrapefruiTgirl
While this thread is a Linux issue/question, it is not server specific in any way, but more of a general-purpose thread, so I'm moving it to 'Linux - General'
Well i don't know how you thinks and why are saying its not a server specific. Can you answer me is fsck command needed on linux servers or not? This is most basic command for all servers and for handling our servers better we must have a god control and depth knowledge of this command. Its one of the very useful command.
Any ways it does not matter how you categorized the things, most important thing is the good and well depth description.
As this is Linux, you could try reading the source... if you want to know how it works in depth.
Please don't write like this if you don't want to discuss things i my personal advice to you please keep quit and watch all the things.
I would really appreciate you if you give your contributions to the right direction and on the topic. And don't write the things which it out of topic and useless.
If you want to get good help at LQ, I advise you to stop criticizing everyone that tries to help you---or moderators that are just doing their job.
1. GrapefruiTgirl was correct in moving this to Linux-General
2. chrism01's advice to look at the source code is actually a good idea. If you need to know how something works in more detail than what the man page provides, then the source code is sometimes the only way.
If you haven't already done so, please tell us what you have learned from a Google search and from the home page for fsck (probably at sourceforge or the Gnu website)
Well I am soory if i heart some one here, its not my intension. What i want is to make the linux world a beautiful place for all Linux lovers. And that is the main reason why i am here. Well i started this thread for this purpose only.
Well I am soory if i heart some one here, its not my intension. What i want is to make the linux world a beautiful place for all Linux lovers. And that is the main reason why i am here. Well i started this thread for this purpose only.
Cool! I'd like to know a bit more about what fsck does so I hope you'll dig into it and post the results of your research here. Thanks in anticipation
Thanks catkin and deviathan and all linux lovers who read this thread and making contribution towards it. Yes i will share all my ideas with you and hoping your good support for making linux much better for all. Now see some more facts about fsck.
fsck is a Unix utility for checking and repairing file system inconsistencies . File system can become inconsistent due to several reasons and the most common is abnormal shutdown due to hardware failure , power failure or switching off the system without proper shutdown . Due to these reasons the superblock in a file system is not updated and has mismatched information relating to system data blocks, free blocks and inodes .
fsck checks the file system in a series of 5 pages and checks a specific functionality of file system in each phase.
** phase 1 - Check Blocks and Sizes
** phase 2 - Check Pathnames
** phase 3 - Check Connectivity
** phase 4 - Check Reference Counts
** phase 5 - Check Cylinder Groups
fsck should always be run in a single user mode which ensures proper repair of file system . If it is run in a busy system where the file system is changing constantly fsck may see the changes as inconsistencies and may corrupt the file system .
if the system can not be brought in a single user mode fsck should be run on the partitions ,other than root & usr , after unmounting them . Root & usr partitions can not be unmounted . If the system fails to come up due to root/usr files system corruption the system can booted with CD and root/usr partitions can be repaired using fsck
thanks a lot. Hope it will help all and please give your contributions.
This link provides a bunch more info on those steps (scroll down to 'The Ext2fs tools'). It's from the ext2 days, but in many ways ext4 is still very much the same fs.
vap, strange way to phrase your topic - you're not polling for people's opinions about some subjective thing; you're looking for information about a particular subject. There's nothing wrong with 'I'd like to know how x works.' - that's what these forums are for.
File system can become inconsistent due to several reasons and the most common is abnormal shutdown due to hardware failure , power failure or switching off the system without proper shutdown
What other reasons are there?
I have a script that backs up a remote system daily using rsnapshot and then shuts down using "shutdown -h now" The filesystem to which I write the backup data often fails the fsck test on boot up. Why would this be? Surely "shutdown -h" cleanly unmounts the filesystem before powering off?
What other reasons are there?
I have a script that backs up a remote system daily using rsnapshot and then shuts down using "shutdown -h now" The filesystem to which I write the backup data often fails the fsck test on boot up. Why would this be? Surely "shutdown -h" cleanly unmounts the filesystem before powering off?
Yes you are shutdown -h cleanly unmounts the filesystem before powering off. Well let me clear few things.
1)Can you share your scripts with us?
2)Here the problem comes in which system i mean either in remote system or in a system in which you runs the script?
3)In which file system you have write backup data?
4)What are the file system that you are using in both systems?
5)You are taking about fsck fails to the check test on boot up. This happens in which system out of two? And how you know that fsck is not
working while booting?
Well its hard to say much more about this before knowing these facts?
So please let me know all these.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.