LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-01-2012, 10:13 AM   #1
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Rep: Reputation: Disabled
Smile fsck commad


can somebody tell me what exactly fsck command does ?
please dont post the man page for it I had aleady read it.
 
Old 05-01-2012, 10:30 AM   #2
grim76
Member
 
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308

Rep: Reputation: 50
The man page is pretty straight forward as to what fsck does. Is there another question that you have regarding fsck other than what it does?
 
1 members found this post helpful.
Old 05-01-2012, 10:31 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,717
Blog Entries: 14

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
The intent of fsck to check a filesystem. What exactly it does is dependent on the filesystem type and on the extent if any of damage.

For example for non-journaled filesystems it typically has to read all the blocks and verify everything including superblocks are where they are. For a journaled filesystem on the other hand it typically just tries to verify that what was last logged in the journal has been committed to the data and if not does the commit. However a "full" fsck on a journaled filesystem does pretty much what it did on non-journaled. On Linux by default this full fsck is done on ext3 which is a journaled version of ext2 (which wasn't journaled) after a certain number of mounts or number of days.
VxFS which is Veritas' journaled filesystem is something that I only did a full fsck on when I suspected or saw filesystem issues. Others have suggested that although you could disable the automatic full of ext3 on Linux it isn't a good idea unless you're scheduling a time to do it yourself.

The main thing fsck does is to fix issues found in order to make the filesystem perform better and/or to repair damage so that an unmountable filesystem again becomes mountable.

To get into more detail you'd really need to investigate the filesystem type you're interested in and then find what fsck does for that specific filesystem.
 
1 members found this post helpful.
Old 05-01-2012, 10:32 AM   #4
anandg111
Member
 
Registered: Jan 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
due to improper shutdown file system of my machine became read only i ran fsck and it worked. So my question is what fsck does and how it converted fs of my system to write mode as well ?
 
Old 05-01-2012, 11:01 AM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,717
Blog Entries: 14

Rep: Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039Reputation: 1039
fsck didn't convert your filesystem to write mode. It fixed the issue that made your system decided to mount in read only.

That is to say at boot the system tries to mount filesystems but if it finds issues it will mount as read only to prevent further corruption then tell you to run an fsck to fix whatever it issues existed. It doesn't automatically do the fsck because there is a potential the fsck would render the filesystem completely unusable. By mounting read only it gives you a chance to try to save important information before you attempt the fsck.

Again unless you want to study the underlying filesystem structures in detail the best answer is "it tries to fix the filesystem". In most cases it DOES. Some user prefer to interact with fsck answering questions as it goes along but many people just run "fsck -y" as they don't understand the underlying structures and don't want to answer the potentially hundreds of questions it asks.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
cd commad Mrjas Linux - General 4 01-06-2008 09:28 PM
commad linux somsahi Linux - General 4 09-12-2006 02:26 PM
chroot commad juanb Linux - General 1 09-13-2005 12:24 PM
Insmod commad error arunatmac Linux - Hardware 1 07-08-2005 10:05 PM
[HELP] After dd commad nothing works rabside Linux - Newbie 4 04-19-2004 08:28 AM


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

Main Menu
Advertisement
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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration