[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: More external journal woes.

On Tuesday December 11, neilb cse unsw edu au wrote:
> On Monday December 10, tytso mit edu wrote:
> > On Tue, Dec 11, 2001 at 01:44:50PM +1100, Neil Brown wrote:
> > > 
> > >  - After the e2fsck fails, "tune2fs -l" on the journal device shows
> > >    much the same superblock as on the main device.  Normally it
> > >    fails to find a superblock on the journal device.
> > 
> > Use dumpe2fs, not "tune2fs -l".  Tune2fs doesn't know about the
> > special superblocks used by the journal device.  The fact that
> > "tune2fs -l" works after e2fsck fails is definitely very weird.  If
> > you could send us the output of dumpe2fs on the journal device before
> > and after the e2fsck failure, that would be very interesting.
> > 
> Thanks for the pointer to dumpe2fs.
> It looks like e2fsck is writing the superblock from the filesys device
> onto the journal device!

... and I can show you how to reproduce it...

The following shell script sets up a filesystem using loopback
devices and then takes a copy without unmounting to simular a crash.
If I use e2fsck on the result, then it breaks.
If I just mount it directly, it work.


# Set up the filesystem
  dd if=/dev/zero of=/tmp/fs bs=1024 count=10240
  dd if=/dev/zero of=/tmp/journal bs=1024 count=4096
  losetup /dev/loop0  /tmp/fs
  losetup /dev/loop1  /tmp/journal 
  mke2fs -O journal_dev /dev/loop1
  mke2fs -J device=/dev/loop1 /dev/loop0
  mount -t ext3 -o data=journal /dev/loop0 /mnt

  cp -r /etc/init.d /mnt

# simulate a crash
  cp /tmp/fs /tmp/fs1
  cp /tmp/journal /tmp/journal1

  umount /mnt
  losetup -d /dev/loop0
  losetup -d /dev/loop1

# and a reboot

  losetup /dev/loop0  /tmp/fs1
  losetup /dev/loop1  /tmp/journal1

  dumpe2fs /dev/loop0
  dumpe2fs /dev/loop1

# choose one of the following lines.  
  e2fsck /dev/loop0
#  mount /mnt ; umount /mnt

# clean up
  dumpe2fs /dev/loop0
  dumpe2fs /dev/loop1
  losetup -d /dev/loop0
  losetup -d /dev/loop1

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]