Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 09-29-2005, 12:15 AM   #1
LQ Newbie
Registered: Sep 2005
Posts: 8

Rep: Reputation: 0
fsck -t option


I am new to Linux. I am writing a bash script to do a filesystem check in all the filesystems except vfat, dos and root specified in /etc/fstab. From the man page I found that the -t option will help me to solve this problem.

but I am not sure of the syntax of the command.

can someone please gimme an example syntax.

currently in the bash I used the following syntax and it throwed me an error

#fsck -ARs -t !dos,!vfat

Thanks for ur time.

Old 10-03-2005, 02:17 AM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Maybe I'm completely off, but I'd think that you can't
negate what wouldn't be checked in the first place?

As far as I know fsck has no means to check these
two in the first place.

Old 10-03-2005, 03:02 AM   #3
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
Try this
fsck -ANt nodos,novfat
A - Check all listed in fstab
R - Omit / filesystem if it's already mounted
t nodos,novfat - Do not check dos and vfat type fs

Running fsck on mounted fs is not recommended since it can cause fs damage. So you would prefer to do a read-only fsck on such. (Check -n option)

-s option (in your entry) tells to serialize the checks (this is not recommended if you intend to use fsck non-interactively)

Last edited by SkyEye; 10-03-2005 at 03:09 AM.
Old 10-03-2005, 06:41 AM   #4
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
Uh, someone should explain that there is no need to write a script to run fsck at all............In most distros, fsck run automagically after a filesystem has been mounted 20 times (slackware is one )..........fsck will also run automatically IF a filesystem was un-mounted improperly.....(like after a hard re-boot ) can change the setting so fsck runs after 5 or 10 mountings, but there is no need really to mess with it............
Old 10-03-2005, 06:48 AM   #5
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
Yes, quite right. Most distros have sheduled fscks and in unexpected system halts. But there may be requirements, where you need to do manual fsck.

Anyway Linuxuser_81 didn't say what was his/her requirement. So I assumed that he knows what he is doing, and gave him some tip.


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
2 fsck or not 2 fsck? naps SUSE / openSUSE 4 03-18-2005 02:11 PM
automatic fsck on boot. fsck errors. nixel Slackware 1 05-17-2004 07:51 AM
How to use Fsck pembo13 Linux - General 4 04-20-2004 11:00 AM
Fsck Soulful93 Linux - Newbie 2 03-18-2004 02:00 PM
fsck leihsun Linux - General 1 07-02-2002 06:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:18 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration