LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   fsck.ext2: Is a directory while trying to open / (https://www.linuxquestions.org/questions/linux-software-2/fsck-ext2-is-a-directory-while-trying-to-open-681176/)

linuxgentoo 11-04-2008 07:47 PM

fsck.ext2: Is a directory while trying to open /
 
Hi,all
I want to enable check root filesytem during boot ,the following code complete the task

fsck -y -C /

( /dev/sda3 is root)

it failed ,the log message:

fsck.ext2: Is a directory while trying to open /
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>


if i add
/dev/sda3 / ext3 default 1 1

everything looks well


why?

thanks

i92guboj 11-04-2008 07:55 PM

Two things:
  1. you don't fsck dirs, but devices, for example, fsck /dev/sda2, but not fsck /
  2. you never ever fsck volumes that are mounted r/w, or you will seriously screw up them

linuxgentoo 11-04-2008 08:02 PM

Quote:

Originally Posted by i92guboj (Post 3331937)
Two things:
  1. you don't fsck dirs, but devices, for example, fsck /dev/sda2, but not fsck /
  2. you never ever fsck volumes that are mounted r/w, or you will seriously screw up them

thanks for your reply

1) but /dev/sda3 already mounted /
2) before fsck filesystem,already mount filesystem ro

in fact ,in most popular linux distro,the script is checkfs.sh

i92guboj 11-04-2008 08:08 PM

So I don't understand what the problem is exactly.

If you just want to use the standard checks, set up fstab accordingly and use tune2fs or a similar tool to set the time between checks (or the number of mounts).

If that's not it, how, when and from where are you running that fsck command?

PS. I don't think that the fact that it's mounted in / is relevant. fsck still works over device nodes, and not over mountpoints/dirs.

Quakeboy02 11-04-2008 08:13 PM

I'm not so sure you can run fsck.ext2 on an ext3 filesystem.

i92guboj 11-04-2008 08:20 PM

All the ext?.fsck are symlinks to e2fsck usually. Ext2/3 is basically the same fs, just that ext3 uses a journal to keep track of the operations.

Quakeboy02 11-04-2008 08:23 PM

Quote:

Originally Posted by i92guboj (Post 3331950)
All the ext?.fsck are symlinks to e2fsck usually. Ext2/3 is basically the same fs, just that ext3 uses a journal to keep track of the operations.

Oh. Well as Gilda used to say: "never mind".


All times are GMT -5. The time now is 09:55 AM.