How to force fsck on boot?

Zach uid000 at gmail.com
Thu Dec 8 11:39:49 UTC 2005


There are times when find stops prematurely because of hard link
problems in /proc & /dev.  I've found that in these cases you have to
"prune" those directories.  I found the man page for "find" to not be
very helpful.  It took some experimentation to figure out how to use
the prune option.

find / -path '/proc' -prune -o -path '/dev' -prune -o -name foo
This command will search for anything named "foo" but won't descend
into /proc or /dev.
The "-o" is an "or".  So the parts that are separated by "-o"
basically mean "do this or do that or do this other thing."  The first
and second parts specifiy "-path" which means to match on path.  They
then specifiy '/proc' and '/dev' respectively as the things to match,
so if find comes across something where the path is /dev or /proc, it
will take the specified action.  And the "-prune" is the action you
want it to take if it finds a match.  In this case if it finds a
match, it should "prune" it from the search tree rather than descend
into it.  In the third part of the the command "-name" means match if
the name is "foo."  When no action is specified, the implied action is
to print to the screen (standard out).

Hope this helps!

Zach

On 12/8/05, Bill Marcum <bmarcum at iglou.com> wrote:
> On Wed, 07 Dec 2005 14:45:58 -0800, Peter Stoddard
>   <peter at stoddard.us> wrote:
> > root at daphne:/etc# find / -name smb.conf
> > /etc/samba/smb.conf
> > /var/cache/setup-tool-backends/backup/network/First/etc/samba/smb.conf
> > /var/cache/setup-tool-backends/backup/network/1/etc/samba/smb.conf
> > /var/cache/setup-tool-backends/backup/network/2/etc/samba/smb.conf
> > /var/cache/setup-tool-backends/backup/shares/First/etc/samba/smb.conf
> > /usr/share/samba/smb.conf
> > find: WARNING: Hard link count is wrong for /proc: this may be a bug in
> > your filesystem driver.  Automatically turning on find's -noleaf option.
> > Earlier results may have failed to include directories that should have
> > been searched.
> > root at daphne:/etc#
> >
> > I wanted to do an fsck to see if it would clear up that error message.
> > It didn't.
> >
> The contents of /proc are not on your hard drive, it's a virtual file
> system, so fsck has no effect and is not needed.  You can ignore the
> warnings or use find commands that exclude /proc.
>
> --
> You have a strong appeal for members of the opposite sex.
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>


--
If you reply to a message I posted to a mailing list,
and you want me to see your reply, be sure to put my
address in the 'To:', or I might not see the message.




More information about the ubuntu-users mailing list