Re: fsck root fs: fsck, devfs, /proc/mounts miscooperate.

Andreas Dilger (adilger@turbolabs.com)
Wed, 29 Aug 2001 12:17:32 -0600


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/