linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fsck root fs: fsck, devfs, /proc/mounts miscooperate.
@ 2001-08-29  6:54 VDA
  2001-08-29  8:13 ` Andreas Dilger
  2001-08-29 12:14 ` VDA
  0 siblings, 2 replies; 9+ messages in thread
From: VDA @ 2001-08-29  6:54 UTC (permalink / raw)
  To: linux-kernel

Hello all,

I use devfs to manage my /dev.
I symlinked /etc/mtab to /proc/mounts.
My root fs is on /dev/sdb1 and stays RO.
There is not /etc/fstab entry for it
(I hate making new Linux partitions by copying my old system, boot
them and discover I forgot to change root entry in /etc/fstab - kernel
already knows where root is, so why do I need to tell that?).

I have trouble with fsck'ing my root fs from init script.
As you can see below:
"fsck /" can't figure out from where my root is mounted.
"fsck /dev/sdb1" works fine, but that means init script must be
modified when root mount point is changed.
"fsck /dev/scsi/host0/bus0/target1/lun0/part1" is suitable for init
script (I could get dev name from /proc/mounts)
but complaining about mounted fs (why? my root fs is RO).

So, how can I fsck my root?

# cat /etc/mtab
/dev/scsi/host0/bus0/target1/lun0/part1 / ext2 ro 0 0
...

# fsck /
Parallelizing fsck version 1.15 (18-Jul-1999)
e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
/sbin/e2fsck: Is a directory while trying to open /

The superblock could not be read or does not describe a correct ext2
filesystem...

# fsck /dev/sdb1
Parallelizing fsck version 1.15 (18-Jul-1999)
e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
/dev/sdb1: clean, 6416/122400 files, 86059/488432 blocks

# fsck /dev/scsi/host0/bus0/target1/lun0/part1
Parallelizing fsck version 1.15 (18-Jul-1999)
e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
/dev/scsi/host0/bus0/target1/lun0/part1 is mounted.

WARNING!!!  Running e2fsck on a mounted filesystem may cause
SEVERE filesystem damage...
-- 
Best regards,
VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua
http://port.imtp.ilyichevsk.odessa.ua/vda/



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29  6:54 fsck root fs: fsck, devfs, /proc/mounts miscooperate VDA
@ 2001-08-29  8:13 ` Andreas Dilger
  2001-08-29 14:27   ` Re[2]: " Richard Gooch
  2001-08-29 12:14 ` VDA
  1 sibling, 1 reply; 9+ messages in thread
From: Andreas Dilger @ 2001-08-29  8:13 UTC (permalink / raw)
  To: VDA; +Cc: linux-kernel

On Aug 29, 2001  09:54 +0300, VDA wrote:
> # fsck /dev/scsi/host0/bus0/target1/lun0/part1
> Parallelizing fsck version 1.15 (18-Jul-1999)
> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> /dev/scsi/host0/bus0/target1/lun0/part1 is mounted.
> 
> WARNING!!!  Running e2fsck on a mounted filesystem may cause
> SEVERE filesystem damage...

Get a new version of e2fsprogs (at http://sf.net/projects/e2fsprogs).
The detection of mounted root filesystems has changed in recent releases,
so it _should_ be fixed - let us know if it is not.

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re[2]: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29  6:54 fsck root fs: fsck, devfs, /proc/mounts miscooperate VDA
  2001-08-29  8:13 ` Andreas Dilger
@ 2001-08-29 12:14 ` VDA
  2001-08-29 18:17   ` Andreas Dilger
                     ` (4 more replies)
  1 sibling, 5 replies; 9+ messages in thread
From: VDA @ 2001-08-29 12:14 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: linux-kernel

Hello Andreas,

Wednesday, August 29, 2001, 11:13:04 AM, you wrote:
>> # fsck /dev/scsi/host0/bus0/target1/lun0/part1
>> Parallelizing fsck version 1.15 (18-Jul-1999)
>> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
>> /dev/scsi/host0/bus0/target1/lun0/part1 is mounted.
>> 
>> WARNING!!!  Running e2fsck on a mounted filesystem may cause
>> SEVERE filesystem damage...

AD> Get a new version of e2fsprogs (at http://sf.net/projects/e2fsprogs).
AD> The detection of mounted root filesystems has changed in recent releases,
AD> so it _should_ be fixed - let us know if it is not.

Installed e2fsprogs 1.23. It does not print warning now on
"fsck /dev/scsi/host0/bus0/target1/lun0/part1"
However, it still cannot fs check root fs when given "fsck /" which I
really need in my init script. Now the only way to do root fs check
for me is to parse /proc/mounts and extract mount point for / via sed
(I have never used sed yet...).

# fsck /
Parallelizing fsck version 1.15 (18-Jul-1999)
e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
/sbin/e2fsck: Is a directory while trying to open /

The superblock could not be read or does not describe a correct ext2
filesystem...

Best regards,
VDA
--
mailto:VDA@port.imtp.ilyichevsk.odessa.ua
http://port.imtp.ilyichevsk.odessa.ua/vda/



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re[2]: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29  8:13 ` Andreas Dilger
@ 2001-08-29 14:27   ` Richard Gooch
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Gooch @ 2001-08-29 14:27 UTC (permalink / raw)
  To: VDA; +Cc: Andreas Dilger, linux-kernel

VDA@port.imtp.ilyichevsk.odessa.ua writes:
> Hello Andreas,
> 
> Wednesday, August 29, 2001, 11:13:04 AM, you wrote:
> >> # fsck /dev/scsi/host0/bus0/target1/lun0/part1
> >> Parallelizing fsck version 1.15 (18-Jul-1999)
> >> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> >> /dev/scsi/host0/bus0/target1/lun0/part1 is mounted.
> >> 
> >> WARNING!!!  Running e2fsck on a mounted filesystem may cause
> >> SEVERE filesystem damage...
> 
> AD> Get a new version of e2fsprogs (at http://sf.net/projects/e2fsprogs).
> AD> The detection of mounted root filesystems has changed in recent releases,
> AD> so it _should_ be fixed - let us know if it is not.
> 
> Installed e2fsprogs 1.23. It does not print warning now on
> "fsck /dev/scsi/host0/bus0/target1/lun0/part1"
> However, it still cannot fs check root fs when given "fsck /" which I
> really need in my init script. Now the only way to do root fs check
> for me is to parse /proc/mounts and extract mount point for / via sed
> (I have never used sed yet...).
> 
> # fsck /
> Parallelizing fsck version 1.15 (18-Jul-1999)
> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> /sbin/e2fsck: Is a directory while trying to open /
> 
> The superblock could not be read or does not describe a correct ext2
> filesystem...

You say you are running devfs. Well, if that's the case, you can
simply do:
# fsck /dev/root

because devfs makes /dev/root a symbolic link to the root FS device.
Magic.

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29 12:14 ` VDA
@ 2001-08-29 18:17   ` Andreas Dilger
  2001-08-29 19:03   ` Richard Gooch
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andreas Dilger @ 2001-08-29 18:17 UTC (permalink / raw)
  To: VDA; +Cc: linux-kernel

On Aug 29, 2001  15:14 +0300, VDA wrote:
> Installed e2fsprogs 1.23. It does not print warning now on
> "fsck /dev/scsi/host0/bus0/target1/lun0/part1"
> However, it still cannot fs check root fs when given "fsck /" which I
> really need in my init script. Now the only way to do root fs check
> for me is to parse /proc/mounts and extract mount point for / via sed
> (I have never used sed yet...).
> 
> # fsck /
> Parallelizing fsck version 1.15 (18-Jul-1999)
> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> /sbin/e2fsck: Is a directory while trying to open /

That's because "/" is a directory and not a device.  fsck works with
devices.  If you want to avoid specifying your root partition in
/etc/fstab explicitly, then you can use an ext2 label instead.  Set
the label on the filesystem with "tune2fs -L root <root_dev>", and
then put "LABEL=root" in /etc/fstab instead of a device name.  This
way if your root device gets moved around you are still OK.  This
of course works with filesystems other than root as long as they are
ext2/ext3/xfs (reiserfs does not have labels yet).

Cheers, Andreas
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29 12:14 ` VDA
  2001-08-29 18:17   ` Andreas Dilger
@ 2001-08-29 19:03   ` Richard Gooch
  2001-08-29 19:21   ` Re[4]: " VDA
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Richard Gooch @ 2001-08-29 19:03 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: VDA, linux-kernel

Andreas Dilger writes:
> On Aug 29, 2001  15:14 +0300, VDA wrote:
> > Installed e2fsprogs 1.23. It does not print warning now on
> > "fsck /dev/scsi/host0/bus0/target1/lun0/part1"
> > However, it still cannot fs check root fs when given "fsck /" which I
> > really need in my init script. Now the only way to do root fs check
> > for me is to parse /proc/mounts and extract mount point for / via sed
> > (I have never used sed yet...).
> > 
> > # fsck /
> > Parallelizing fsck version 1.15 (18-Jul-1999)
> > e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> > /sbin/e2fsck: Is a directory while trying to open /
> 
> That's because "/" is a directory and not a device.  fsck works with
> devices.  If you want to avoid specifying your root partition in
> /etc/fstab explicitly, then you can use an ext2 label instead.  Set
> the label on the filesystem with "tune2fs -L root <root_dev>", and
> then put "LABEL=root" in /etc/fstab instead of a device name.  This
> way if your root device gets moved around you are still OK.  This of
> course works with filesystems other than root as long as they are
> ext2/ext3/xfs (reiserfs does not have labels yet).

/dev/root works regardless of filesystem type :-)

				Regards,

					Richard....
Permanent: rgooch@atnf.csiro.au
Current:   rgooch@ras.ucalgary.ca

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re[4]: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29 12:14 ` VDA
  2001-08-29 18:17   ` Andreas Dilger
  2001-08-29 19:03   ` Richard Gooch
@ 2001-08-29 19:21   ` VDA
  2001-08-30 19:39   ` Re[2]: " Theodore Tso
  2001-08-31 10:58   ` Re[4]: " VDA
  4 siblings, 0 replies; 9+ messages in thread
From: VDA @ 2001-08-29 19:21 UTC (permalink / raw)
  To: Richard Gooch; +Cc: linux-kernel

Hello Richard,

Wednesday, August 29, 2001, 5:27:19 PM, you wrote:
RG> You say you are running devfs. Well, if that's the case, you can
RG> simply do:
RG> # fsck /dev/root

RG> because devfs makes /dev/root a symbolic link to the root FS device.
RG> Magic.

Thanks! It works!
However, I still think "fsck /" behavior isn't right - people who don't use
devfs won't be able to check root fs without fstab entry for it.
This seems fixable - "mount -o remount,rw /" works without /dev/root
trick, right?

Best regards,
VDA
--
mailto:VDA@port.imtp.ilyichevsk.odessa.ua
http://port.imtp.ilyichevsk.odessa.ua/vda/



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Re[2]: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29 12:14 ` VDA
                     ` (2 preceding siblings ...)
  2001-08-29 19:21   ` Re[4]: " VDA
@ 2001-08-30 19:39   ` Theodore Tso
  2001-08-31 10:58   ` Re[4]: " VDA
  4 siblings, 0 replies; 9+ messages in thread
From: Theodore Tso @ 2001-08-30 19:39 UTC (permalink / raw)
  To: VDA; +Cc: Andreas Dilger, linux-kernel

On Wed, Aug 29, 2001 at 03:14:17PM +0300, VDA wrote:
> 
> Installed e2fsprogs 1.23. It does not print warning now on
> "fsck /dev/scsi/host0/bus0/target1/lun0/part1"
> However, it still cannot fs check root fs when given "fsck /" which I
> really need in my init script. Now the only way to do root fs check
> for me is to parse /proc/mounts and extract mount point for / via sed
> (I have never used sed yet...).
> 
> # fsck /
> Parallelizing fsck version 1.15 (18-Jul-1999)
> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
> /sbin/e2fsck: Is a directory while trying to open /

Umm... it works for me.  (No, I don't use devfs, but I do test
e2fsprogs to make sure they do some sane vs. devfs by using UML...)

usermode:/etc# cat /etc/mtab
/dev/ubd/0 / ext2 rw 0 0
proc /proc proc rw 0 0
devpts /dev/pts devpts rw,mode=0622 0 0
usermode:/etc# fsck -NV /
Parallelizing fsck version 1.23 (15-Aug-2001)
[/sbin/fsck.ext2 -- /] fsck.ext2 /dev/ubd/0 


What does your /etc/mtab file show for an entry for the root
filesystem when you're trying to make it work?  Fsck does require that
/etc/mtab is sane, and I'm guessing that you're missing an entry in
/etc/mtab for /. 

						- Ted

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re[4]: fsck root fs: fsck, devfs, /proc/mounts miscooperate.
  2001-08-29 12:14 ` VDA
                     ` (3 preceding siblings ...)
  2001-08-30 19:39   ` Re[2]: " Theodore Tso
@ 2001-08-31 10:58   ` VDA
  4 siblings, 0 replies; 9+ messages in thread
From: VDA @ 2001-08-31 10:58 UTC (permalink / raw)
  To: Theodore Tso; +Cc: Andreas Dilger, linux-kernel

Hello Ted,

Thursday, August 30, 2001, 10:39:10 PM, you wrote:
>> # fsck /
>> Parallelizing fsck version 1.15 (18-Jul-1999)
>> e2fsck 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
>> /sbin/e2fsck: Is a directory while trying to open /

TT> Umm... it works for me.  (No, I don't use devfs, but I do test
TT> e2fsprogs to make sure they do some sane vs. devfs by using UML...)
...
TT> What does your /etc/mtab file show for an entry for the root
TT> filesystem when you're trying to make it work?  Fsck does require that
TT> /etc/mtab is sane, and I'm guessing that you're missing an entry in
TT> /etc/mtab for /. 

My /etc/mtab is symlinked to /proc/mounts and have these entries:
/dev/scsi/host0/bus0/target1/lun0/part1 / ext2 ro 0 0
/dev/sda2 /.share ext2 rw 0 0
...

Also fsck does not work for my second mountpoint if specified
as a relative path:

pegasus:/#fsck .share    <--- relative path
Parallelizing fsck version 1.23 (15-Aug-2001)
No devices specified to be checked!
pegasus:/#fsck /.share    <--- absolute path
Parallelizing fsck version 1.23 (15-Aug-2001)
e2fsck 1.23, 15-Aug-2001 for EXT2 FS 0.5b, 95/08/09
/dev/sda2 is mounted.
WARNING! Running e2fsck on a mounted filesystem...

Looks like running "fsck <mountpoint>" is uncommon
and isn't tested much.
--
Best regards,
VDA
mailto:VDA@port.imtp.ilyichevsk.odessa.ua
http://port.imtp.ilyichevsk.odessa.ua/vda/



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2001-08-31 11:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-29  6:54 fsck root fs: fsck, devfs, /proc/mounts miscooperate VDA
2001-08-29  8:13 ` Andreas Dilger
2001-08-29 14:27   ` Re[2]: " Richard Gooch
2001-08-29 12:14 ` VDA
2001-08-29 18:17   ` Andreas Dilger
2001-08-29 19:03   ` Richard Gooch
2001-08-29 19:21   ` Re[4]: " VDA
2001-08-30 19:39   ` Re[2]: " Theodore Tso
2001-08-31 10:58   ` Re[4]: " VDA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).