fsck and runlevel probs 

Newsgroups: comp.os.linux.setup
Date: 5 Jan 2003 18:15:18 GMT
> When I type umount /dev/hda8 it either returns unknown filesystem or
> filesytem in use. I thought runlevel 1 allowed access to disks without them
> being in use for the particular purpose of fsck etc.

If hda8 is your / try 'touch /forcefsck' then reboot. Your fs checker should then run at boot.

fsck and runlevel probs 

> >> checker should then run at boot.
> >
> > If hda8 is the root fs, just remount it read-only and run fsck
> > on it.  Then remount it read-write and change the runlevel back
> > to 3 or whatever it was.  There is no need to reboot.
>
>In read-only mode, fsck will only be able to find errors, not correct
>them.  To correct any errors, fsck needs write access as well.  Right?

It doesn't work _through_ the filesystem, but _on_ it, via direct access to the device special file. Hence the permissions on /dev/hda8 are what makes a difference, not whether it is mounted read/write.

The point in remounting is to allow fsck to be run on the root filesystem without having to reboot the system from a rescue disk. It would also work on other filesystems, but they can be unmounted. The problem with running fsck on a mounted filesytem is that the kernel will flush its buffers, which contain the same errors as the physical disk, back to the disk after fsck has corrected the errors, thus replacing the corrections with the same old errors. It won't do that if it is mounted read/only, so that is the equivalent of just unmounting the filesystem.

Floyd L. Davidson

What's the problem with my file system? 

Newsgroups:  comp.os.linux.misc
Date:        Fri, 17 Oct 2003 23:51:21 GMT
> root# rm /etc/rc.d/init.d/xinetd -f
> rm: cannot remove `/etc/rc.d/init.d/xinetd': Operation not permitted
>
> root# ls -lF /etc/rc.d/init.d/xinetd
> -rwxr-xr-x    1 root     root     1617 Oct 12 19:51 /etc/rc.d/init.d/xinetd*

try with

lsattr /etc/rc.d/init.d/xinetd

man lsattr and man chattr will explain, what the commands do.

> In trying to solve the problem myself, I tried to fsck my root volume in
> single mode. However, after booting into single mode, and issuing
>
>         mount -o remount,ro /
>
> to remount the root fs in readonly mode, I was some what surprised to
> find out that the root is still in RW mode. It's unbelievable but it was
> true. I tried many times.

try 'mount -n -o remount,ro /' maybe mount wants to change /etc/mtab but can't so the remount fails. also do a 'echo $?' after the mount command so that you get the return status of 'mount'. if it is 0 the command succeeded, otherwise some error occurred.

armin walland

What's the problem with my file system? 

$ lsattr /etc/rc.d/init.d/xinetd
-u-ia--------- /etc/rc.d/init.d/xinetd

attributes for the files:

don't update atime (A), synchronous updates (S), append only (a), compressed (c), no dump (d), immutable (i), data journalling (j), secure deletion (s), and undeletable (u).

chattr = /etc/rc.d/init.d/xinetd
$ lsattr /etc/rc.d/init.d/xinetd
-------------- /etc/rc.d/init.d/xinetd