Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I've seen similar posts to my questions, but I think mine are sufficiently different to warrant this post. So I'll get on with it:
I would like to run fsck on my server, but am unsure how to do it.
I managed to unmount everything but /usr and /var (and maybe /boot). I'm not sure what was using these FS'. How can I track down what is using them and stop them?
I told fsck not to check those FS', and the last thing it says before (apparently) doing nothing (no prompt) is "check aborted." What's happening?
I stopped all the services that I explicitly started/control (eg. httpd, ypbind) but there are things like mpmd that I am unfamiliar with and don't want to touch.
Is there some sort of command to stop all services except those needed to just run the system?
I've also read in numerous places that 'shutdown -rF' will cause an fsck to run. What about the various options that can be supplied? My concern here is that the fsck on boot is just a cursory look at the filesystems rather than a detailed look.
I've also read about booting off a CD to do the check. That still involves a reboot which I would like to avoid. But, can I fsck /root, etc. without using the CD?
Lastly, can fsck auto-fix errors? Will it log its results anywhere? I have some large drives that I would like to check overnight.
Sorry if these questions are dumb, or have been covered, but I want to make sure I can am adequately prepared to do this before I try it again.
I beleive I can competently address some of your post. Skip down to the part about 'shutdown -rF'.
If you check the man or info pages for shutdown, you will see that it will indeed force fsck before the partitions are mounted. You are not offered much more in the way of options.
On the other hand, booting from cd would be the way to go because you boot the kernel image from the cd, not the installed kernel. Once booted, if you take a look at /etc/fstab, you won't find any of your partitions! You are running from the cd, not the installed os.
Therefore, print a copy of your /etc/fstab. Then reboot from cd. Then edit the running copy of fstab (from cd) to add the partitions you want to run fsck on. They are now identified to the system running from cd, but not mounted. You can safely run fsck on the unmounted partitions (all of them).
Fsck -a will automatically repair a file system, without questions.
Fsck -r will repair interactively; the larger the system, the longer it will take to answer questions.
Fsck doesn't offer the option to log it's activities. However, you may be able to pipe the activity through tee to a named file:
Example:
fsck -a | tee fsck.txt
I've never tried it, so I don't know that it will work. But the tee utility is useful to send terminal output to a file for later inspection.
Finally. Your questions are not dumb. The way to learn is to ask questions. Not asking is dumb.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.