Re: Removable media bug

Fionn Behrens (fionn@unix-ag.org)
Tue, 01 Jun 1999 16:01:02 +0200 (CEST)


Hi Alan Cox,

on 30-May-99 you wrote:

>> >at least all Fujitsu MO drives (the vast majority of MOs).
>
> Its not all Fujitsu MO drives. It works fine on my 640AI.

This is what /proc/scsi/scsi says on my host:

Host: scsi1 Channel: 00 Id: 05 Lun: 00
Vendor: FUJITSU Model: M2513A Rev: 1700
Type: Direct-Access ANSI SCSI revision: 02

>
> The drive is reported as a scsi-removable (correctly), and if I do
> tar xvf /dev/sda
>
> then eject and change disk, then tar xvf /dev/sda
>
> I see two different archives

I think it may well be a problem of e2fs. Your method does not involve any
file systems.

>> >MSDOS formatted disk between two e2fs-formatted ones to force a flush
>> in some way.
>>
>> You can also try to mount the device without inserting a disk (you'll

Mounting without inserting a disk does NOT fix the problem for me.

> The MS-DOS one would be a block size change causing a flush. That would
> make sense.

> Do you see a disk change notification when you change disk or not ?

I see one in the kernel log when I issue a mount command.

I have appended a piece of syslog - it shows the following:

1) I insert, mount and directly unmount an ext2 formatted MO after having
unmounted and removed an other ext2 formatted MO.

Jun 1 15:43:08 localhost kernel: VFS: Disk change detected on device sd(8,0)
Jun 1 15:43:08 localhost kernel: SCSI device sda: hdwr sector= 2048 bytes.
Sectors= 310352 [606 MB] [0.6 GB]
Jun 1 15:43:08 localhost kernel: sda: Write Protect is off
Jun 1 15:43:08 localhost kernel: sda: unknown partition table
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 3, stored = 0,
counted = 7884
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 4, stored = 787,
counted = 4753
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 5, stored = 0,
counted = 16371
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 7, stored = 0,
counted = 3699
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 8, stored = 0,
counted = 3896
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 11, stored = 0,
counted = 16372
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 12, stored = 0,
counted = 16372
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 13, stored = 0,
counted = 14809
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 16, stored = 1467,
counted = 4692
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 17, stored =
16372, counted = 0
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count for group 18, stored = 3879,
counted = 0
Jun 1 15:43:08 localhost kernel: EXT2-fs error (device sd(8,0)):
ext2_check_blocks_bitmap: Wrong free blocks count in super block, stored =
88967, counted = 88849

[ 50 more lines deleted ]

2) I mount a DOS-formatted MO

Jun 1 15:44:53 localhost kernel: VFS: Disk change detected on device sd(8,0)
Jun 1 15:44:53 localhost kernel: SCSI device sda: hdwr sector= 2048 bytes.
Sectors= 310352 [606 MB] [0.6 GB]
Jun 1 15:44:53 localhost kernel: sda: Write Protect is off
Jun 1 15:44:53 localhost kernel: sda: unknown partition table
Jun 1 15:44:53 localhost kernel: MSDOS: Hardware sector size is 2048

3) I mount the MO from 1) again

Jun 1 15:45:35 localhost kernel: VFS: Disk change detected on device sd(8,0)
Jun 1 15:45:35 localhost kernel: SCSI device sda: hdwr sector= 2048 bytes.
Sectors= 310352 [606 MB] [0.6 GB]
Jun 1 15:45:35 localhost kernel: sda: Write Protect is off
Jun 1 15:45:36 localhost kernel: sda: unknown partition table
Jun 1 15:45:36 localhost kernel: EXT2-fs warning: mounting fs with errors,
running e2fsck is recommended

4) I run e2fsck

fionn@rtfm[~] e2fsck /dev/sda
e2fsck 1.12, 9-Jul-98 for EXT2 FS 0.5b, 95/08/09
/dev/sda contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/sda: 116/2432 files (9.5% non-contiguous), 221385/310352 blocks

Kernel used for this test: 2.3.0

Hope this helps.

Fionn

---
                         PGP-Key available on request

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