LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - General
User Name
Password
Linux - General This 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

Reply
 
Thread Tools Search this Thread
Old 07-26-2009, 01:58 AM   #1
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15
Thumbs up Discussion with all linux champions and guru on How fsck works???


[Log in to get rid of this advertisement]
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 02:25 AM..
vap16oct1984 is offline     Reply With Quote
Old 07-26-2009, 02:55 AM   #2
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
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.

but still confused about its working steps.
vap16oct1984 is offline     Reply With Quote
Old 07-26-2009, 04:16 AM   #3
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124
Thanked: 2
Read these articles to get an in depth understanding of how a filesystem works in Linux:
http://www.oracle.com/technology/pub...h_filesys.html
http://www.ibm.com/developerworks/li...ux-filesystem/

Last edited by nathacof; 07-26-2009 at 04:23 AM..
nathacof is offline     Reply With Quote
Old 07-26-2009, 03:17 PM   #4
GrapefruiTgirl
Moderator
 
Registered: Dec 2006
Location: N.S.
Distribution: Slackware64
Posts: 5,094
Thanked: 292
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'

Sasha
GrapefruiTgirl is offline     Reply With Quote
Old 07-27-2009, 01:44 AM   #5
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
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 View Post
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.

well thanks for your contribution.
vap16oct1984 is offline     Reply With Quote
Old 07-27-2009, 01:50 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 5.4
Posts: 8,107
Thanked: 401
As this is Linux, you could try reading the source... if you want to know how it works in depth.
chrism01 is offline     Reply With Quote
Old 07-27-2009, 01:52 AM   #7
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
Hi GrapefruiTgirl,
Its better if we talk about the work of fsck.

Quote:
Originally Posted by GrapefruiTgirl View Post
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.
vap16oct1984 is offline     Reply With Quote
Old 07-27-2009, 09:48 AM   #8
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
Angry

Quote:
Originally Posted by chrism01 View Post
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.
vap16oct1984 is offline     Reply With Quote
Old 07-27-2009, 10:06 AM   #9
pixellany
Moderator
 
Registered: Nov 2005
Location: Pasadena, CA
Distribution: Arch+KDE
Posts: 14,165
Thanked: 382
Dear Mr. VAP;

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)
pixellany is offline     Reply With Quote
Old 07-28-2009, 11:33 AM   #10
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
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.
vap16oct1984 is offline     Reply With Quote
Old 07-28-2009, 11:53 AM   #11
catkin
Senior Member
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.0
Posts: 2,515
Blog Entries: 6
Thanked: 325
Quote:
Originally Posted by vap16oct1984 View Post
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
catkin is offline     Reply With Quote
Old 07-29-2009, 02:40 AM   #12
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
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.
vap16oct1984 is offline     Reply With Quote
Old 07-29-2009, 03:46 AM   #13
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 376
Thanked: 47
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.
karamarisan is offline     Reply With Quote
Old 07-30-2009, 02:51 AM   #14
squiz
LQ Newbie
 
Registered: Apr 2009
Posts: 11
Thanked: 0
Quote:
Originally Posted by vap16oct1984 View Post
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?
squiz is offline     Reply With Quote
Old 07-31-2009, 01:56 AM   #15
vap16oct1984
Member
 
Registered: Jun 2009
Location: INDIA
Distribution: RHEL-5
Posts: 169
Blog Entries: 3
Thanked: 15

Original Poster
Quote:
Originally Posted by squiz View Post
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.
vap16oct1984 is offline     Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 05:21 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration