LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 03-16-2006, 06:39 AM   #1
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
how to use fsck


Hi everyone,

How would I use fsck? I went into init3 and then tried fsck /..but it gave me a warning that runnig fsck on mounted fs's could lead to severe damage..when I tried to unmount / even by going into another fs like /home...it gave me an error that the / is busy....

issuing mount command gives me this:
# mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
none on /dev/shm type tmpfs (rw)
/dev/hda6 on /home type ext3 (rw)
/dev/hda3 on /usr type ext3 (rw)
/dev/hda2 on /var type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)



How should I go about it?

Regards,
Danish

Last edited by dsids; 03-16-2006 at 06:43 AM.
 
Old 03-16-2006, 07:01 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,644

Rep: Reputation: Disabled
Two ways:

1. "man shutdown" Shutdown has an option to force fsck during reboot.

or

2. Use a live CD, umount the harddrive and run fsck manually.
 
Old 03-16-2006, 07:04 AM   #3
Aperculum
LQ Newbie
 
Registered: Mar 2006
Location: Finland
Distribution: Gentoo
Posts: 13

Rep: Reputation: 0
well, obviously you can't umount your root partition since your system is using it. You could get som live-cd(like finnix), boot to it and do fsck
 
Old 03-16-2006, 07:05 AM   #4
houdelou
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu
Posts: 44

Rep: Reputation: 15
It is very important to not fsck a mounted filesystem.

You can't umount the root / filesystem because that is the core one. But you could umount any other filesystem you have (hda6-3-2).

And if you want to fsck a partition just issue this command

fsck -t ext3 /dev/hda3

What you can do to force fsck to check the root partition at the next boot, issue the following command :

tune2fs -c 30 -C 30 /dev/hda1

where -C sets the number of time the filesystem has been mounted and -c
adjusts the maximum mounts count between filesystem checks. This will force the filesystem to be checked at next boot.

I hope this helps!

Louis
 
Old 03-16-2006, 07:13 AM   #5
houdelou
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu
Posts: 44

Rep: Reputation: 15
I didn't see the quick solution of the shutdown option. I think this is the quickest solution.
 
Old 03-16-2006, 07:30 AM   #6
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by houdelou

What you can do to force fsck to check the root partition at the next boot, issue the following command :

tune2fs -c 30 -C 30 /dev/hda1

where -C sets the number of time the filesystem has been mounted and -c
adjusts the maximum mounts count between filesystem checks. This will force the filesystem to be checked at next boot.

Louis
thank you very much everyone. Louis I coud'nt clearly understand the options -c and -C...if i'm correct -C sets the number of time the fs has been mounted but how would i come to know how many times it has been mounted.. or is it a specific number that i have to write...and the same goes for -c..
i tried man fsck but was not able to understand much

thanks,
Danish
 
  


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
How to use fsck? odiseo77 Linux - Software 4 11-07-2009 01:13 AM
Need help with fsck Grill Master Linux - Newbie 2 07-05-2005 05:37 PM
2 fsck or not 2 fsck? naps Suse/Novell 4 03-18-2005 02:11 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 07:51 AM
How to do fsck Please help Zi5 Linux - Distributions 2 05-13-2004 06:47 PM


All times are GMT -5. The time now is 03:43 AM.

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