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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
05-01-2012, 11:13 AM
|
#1
|
Member
Registered: Jan 2012
Posts: 56
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
fsck commad
can somebody tell me what exactly fsck command does ?
please dont post the man page for it I had aleady read it.
|
|
|
05-01-2012, 11:30 AM
|
#2
|
Member
Registered: Jun 2007
Distribution: Debian, SLES, Ubuntu
Posts: 308
Rep:
|
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.
|
05-01-2012, 11:31 AM
|
#3
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
05-01-2012, 11:32 AM
|
#4
|
Member
Registered: Jan 2012
Posts: 56
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
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 ?
|
|
|
05-01-2012, 12:01 PM
|
#5
|
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
|
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.
|
|
|
All times are GMT -5. The time now is 10:09 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|