lkml.org 
[lkml]   [2002]   [Jul]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ext2 'remount' problem
On Jul 12, 2002  13:34 -0400, Richard B. Johnson wrote:
> On Fri, 12 Jul 2002, Andreas Dilger wrote:
> > On Jul 12, 2002 08:53 -0400, Richard B. Johnson wrote:
> > > If file-systems are mounted upon boot with 'defaults' as options
> > >
> > > like /etc/fstab...
> > > /dev/sdc1 /alt ext2 defaults 0 2
> > >
> > > mount -o remount,rw,noatime /alt
> > >
> > > The result is (correctly)
> > > /dev/sdc1 /alt ext2 rw,noatime 0 0
> > >
> > > Now, if I shut down the system, properly dismounting all the drives,
> > > then I reboot, the drives that were re-mounted end up being fscked
> > > due to 'was not cleanly unmounted' inference. Nothing wrong is found.
> > >
> > > Now, if I mount the drives "noatime" from the start, i.e., from
> > > /etc/fstab upon startup, there are no such errors upon re-boot.
>
> # umount /dev/sdb1
> # dumpe2fs -h /dev/sdb1
> dumpe2fs 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
> Filesystem state: clean
> Last mount time: Fri Jul 12 13:04:15 2002
> Last write time: Fri Jul 12 13:04:15 2002
>
> Booted with init=/bin/bash
> Then I mounted a floppy off from /tmp, chdir there, and ran script.
>
> Script started on Fri Jul 12 09:07:57 2002
> bash# /sbin/e2fsck /dev/sdb1
> e2fsck 1.19, 13-Jul-2000 for EXT2 FS 0.5b, 95/08/09
> /dev/sdb1: was not cleanly unmounted, check forced
> 242040/2109408 files, 1619150/4217054 blocks

Well, I don't know what to say about this... The unmount path calls
ext2_put_super(), which marks the superblock clean and calls
ext2_sync_super() to force it to disk (this can be seen from debugfs
output).

On reboot the filesystem is not clean. Either the kernel is not
doing what it should to flush the dirty superblock to disk, or the disk
is lying about having written the superblock to disk. I would suspect
the latter on IDE drives, but SCSI drives are usually sane.

Try adding a sync or two before rebooting, and also checking via
debugfs after reboot to ensure it is marked dirty when it shouldn't
be. You could even add some printk's to ext2_put_super() inside the
conditional where it marks the filesystem clean and syncs the super
to ensure that is being called.

> # umount -a
> umount: /mnt: device is busy

What about the above message?

The fact that /dev/sda1 is your root fs could cause some strangeness also.

It would appear to be that ext2_remount() is missing "sb->s_flags |=
MS_RDONLY" after the comment "set the rdonly flag and then mark the
partition as valid again". The other check for valid flags also appears
to be a bit suspect.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:27    [W:0.040 / U:0.620 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site