nautilus does not warn when copying files to read only usb flash drive

Bug #14318 reported by sam tygier
6
Affects Status Importance Assigned to Milestone
linux-source-2.6.15 (Ubuntu)
Won't Fix
Medium
Unassigned

Bug Description

I have a very generic usb flash drive which has a readonly/readwrite switch
(like the tab on floppy disks). If it is set to read only and then plugged in
the a ubuntu machine it appears to work like it is set to readwrite. it is
possible to copy files to it and delete files from it. if you click refresh in
nautilus to changes appear to have been made. if you then unmount the drive and
remount it (by plugging it back in), then you can see that none of the changes
you made have actually happened.

i realise that some flash drives might not comunicate that they are set to read
only, but surely a refresh in nautilus should be able to tell.

i am using nautilus 2.10.0-0ubuntu3 and the rest of the system is an up to date
hoary as of friday the 18th of march.

Revision history for this message
Sebastien Bacher (seb128) wrote :

can you copy the output of a "mount" here ? Can you copy on the device from the
command line ?

Revision history for this message
Sebastien Bacher (seb128) wrote :

no reply, bug closed. Feel free to reopen the bug with the asked informations if
you still get the issue.

Revision history for this message
sam tygier (samtygier) wrote :

sorry, i forgot about this report. the issuse still occures.

i reformated the usb flash drive with gparted to a single primary fat16 partition

then with the switch set to readwrite
connect the drive, it mounts and nautilus pops up a window.
mount says
/dev/sda1 on /media/usbdisk type vfat
(rw,nosuid,nodev,sync,noatime,quiet,uid=1000,gid=1000,umask=077,iocharset=utf8)
the drive works as it should, i can make new files and they are still there if i
unmount and remount

now, set drive to read only and connect
mount says
/dev/sda1 on /media/usbdisk type vfat
(rw,nosuid,nodev,sync,noatime,quiet,uid=1000,gid=1000,umask=077,iocharset=utf8)
create a new folder with nautilus. looks like it worked
ls /media/usbdisk says
untitled folder
looks like the folder really has been created

after a few minutes ls /mount/usbdisk says nothing. and refreshing nautilus says
that the new folder is gone.

then i tried
mkdir foo
ls shows that it made the folder, and it shows up in nautilus.

then it disapeared again.

now getting
mkdir: cannot create directory `foo2': Input/output error
and sometimes
mkdir: cannot create directory `foo2': Read-only file system

but mount still says rw.

summery

this is a lower level issue than nautilus.
the ghost files only last a short time, possibly there is a disk sync every so
often?

some info about the usb drive
acording to the device manager
vendor : Alcor Micro Corp.

there are to chips in the drive
ALCOR MICRO
AU9381A21-CAL
MGQCL-000
0326

SAMSUNG 337
K9FIG08UOM
YCBO

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

Can you please plug the stick in ro mode and attach here the output of dmesg?

Revision history for this message
sam tygier (samtygier) wrote :
Download full text (3.6 KiB)

when connecting with it set to rw

usb 1-1: new full speed USB device using ohci_hcd and address 15
scsi14 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 15
usb-storage: waiting for device to settle before scanning
  Vendor: Generic Model: Flash Disk Rev: 7.77
  Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming drive cache: write through
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming drive cache: write through
 /dev/scsi/host14/bus0/target0/lun0: p1
Attached scsi disk sda at scsi14, channel 0, id 0, lun 0
usb-storage: device scan complete
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will
be case sensitive!

when connecting with it set to ro

usb 1-1: new full speed USB device using ohci_hcd and address 16
scsi15 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 16
usb-storage: waiting for device to settle before scanning
  Vendor: Generic Model: Flash Disk Rev: 7.77
  Type: Direct-Access ANSI SCSI revision: 02
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming drive cache: write through
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: assuming drive cache: write through
 /dev/scsi/host15/bus0/target0/lun0: p1
Attached scsi disk sda at scsi15, channel 0, id 0, lun 0
usb-storage: device scan complete
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will
be case sensitive!

i also noticed that after making a newfolder, and waiting for a minute for it to
resync and the new folder to disapear this get dumped in dmesg

SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 265
Buffer I/O error on device sda1, logical block 202
lost page write due to I/O error on sda1
SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 500
Buffer I/O error on device sda1, logical block 437
lost page write due to I/O error on sda1
SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 534
Buffer I/O error on device sda1, logical block 471
lost page write due to I/O error on sda1
SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 207018
Buffer I/O error on device sda1, logical block 206955
lost page write due to I/O error on sda1
SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write protected
end_request: I/O error, dev sda, sector 207019
Buffer I/O error on device sda1, logical block 206956
lost page write due to I/O error on sda1
SCSI error : <15 0 0 0> return code = 0x8000002
Info fld=0x0, Current sda: sense key Data Protect
Additional sense: Write pro...

Read more...

Revision history for this message
Fabio Massimo Di Nitto (fabbione) wrote :

We can skip the directory tests from now on. All the directory "is there and
disappear" effect is due
to the VFS layer not recongnizing that the device is ro. As a consequenze all
the applications
will behave in the same way.

Can you please do another test for me?

Plug the device in ro mode (no need to do extra testing in rw).
as user do:
pumount /media/<path>

as root do:
mount -t vfat /dev/sda1 /mnt

(or similar)

and check if mount spaws a warning about the device being ro.

If it doesn't, than the device is not reporting information correctly to
the kernel and there is absolutely nothing i can do about it.

I have a similar rw/ro key here and it is working fine.. so i suspect
an hardware problem. It would also be interesting to see if it happens
on i386. Perhaps some USB specs are misinterpreted on ppc.

Fabio

Revision history for this message
sam tygier (samtygier) wrote :

sam@titania:~$ sudo mount -t vfat /dev/sda1 /mnt
Password:
sam@titania:~$ mount
<snipped>
/dev/sda1 on /mnt type vfat (rw)

no error messages, nothing suspect in dmesg

my powerpc machine is a 1ghz 15inch titanium powerbook
uname -a
Linux titania 2.6.10-5-powerpc #1 Tue Apr 5 12:44:32 UTC 2005 ppc GNU/Linux

i'll give it a try on a via epia mini itx and see what happens.

Revision history for this message
sam tygier (samtygier) wrote :

ok, had a go on the via epia

followed your last set of instuctions

i get an error and am told that the disk is being mounted read only.

as you suspected this is a powerpc (or what ever chipset is in my powerbook issue)

let me know if there is anything else i can do.

Revision history for this message
Ben Collins (ben-collins) wrote :

This could very well be something with the USB controller. Can you test under
latest breezy or Colony 5 live?

Revision history for this message
sam tygier (samtygier) wrote :
Download full text (4.2 KiB)

i have tested use the breezy preview live cd and the symptoms persist (i could
try colony 5 next week)
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 2.6.12-8-powerpc #1 Tue Aug 30 23:03:49 BST 2005 ppc GNU/Linux

dmesg in plugging the device with it set to ro

[ 1532.259790] usb 2-1: new full speed USB device using ohci_hcd and address 6
[ 1532.370080] scsi5 : SCSI emulation for USB Mass Storage devices
[ 1532.373879] usb-storage: device found at 6
[ 1532.373891] usb-storage: waiting for device to settle before scanning
[ 1537.377862] Vendor: Generic Model: Flash Disk Rev: 7.77
[ 1537.377894] Type: Direct-Access ANSI SCSI revision: 02
[ 1537.390635] SCSI device sdb: 256000 512-byte hdwr sectors (131 MB)
[ 1537.390651] sdb: assuming drive cache: write through
[ 1537.402840] SCSI device sdb: 256000 512-byte hdwr sectors (131 MB)
[ 1537.402854] sdb: assuming drive cache: write through
[ 1537.402867] /dev/scsi/host5/bus0/target0/lun0: p1
[ 1537.415094] Attached scsi disk sdb at scsi5, channel 0, id 0, lun 0
[ 1537.419294] usb-storage: device scan complete
[ 1538.269583] FAT: utf8 is not a recommended IO charset for FAT filesystems,
filesystem will be case sensitive!

and the output from mount

/dev/sdb1 on /media/usbdisk type vfat
(rw,noexec,nosuid,nodev,quiet,shortname=winnt,uid=1000,gid=1000,umask=077,iocharset=utf8)

and if i try to write a file

ubuntu@ubuntu:/media$ mkdir /media/usbdisk/foo
ubuntu@ubuntu:/media$ ls /media/usbdisk/
foo
ubuntu@ubuntu:/media$ sync
ubuntu@ubuntu:/media$ ls /media/usbdisk/

there is a big dump of stuff in dmesg after the sync command

[ 1728.841673] SCSI error : <5 0 0 0> return code = 0x8000002
[ 1728.841688] sdb: Current: sense key: Data Protect
[ 1728.841695] Additional sense: Write protected
[ 1728.841712] Info fld=0x0
[ 1728.841717] end_request: I/O error, dev sdb, sector 64
[ 1728.841727] Buffer I/O error on device sdb1, logical block 1
[ 1728.841735] lost page write due to I/O error on sdb1
[ 1728.855674] SCSI error : <5 0 0 0> return code = 0x8000002
[ 1728.855688] sdb: Current: sense key: Data Protect
[ 1728.855695] Additional sense: Write protected
[ 1728.855712] Info fld=0x0
[ 1728.855717] end_request: I/O error, dev sdb, sector 299
[ 1728.855728] Buffer I/O error on device sdb1, logical block 236
[ 1728.855735] lost page write due to I/O error on sdb1
[ 1728.869674] SCSI error : <5 0 0 0> return code = 0x8000002
[ 1728.869688] sdb: Current: sense key: Data Protect
[ 1728.869695] Additional sense: Write protected
[ 1728.869711] Info fld=0x0
[ 1728.869717] end_request: I/O error, dev sdb, sector 534
[ 1728.869728] Buffer I/O error on device sdb1, logical block 471
[ 1728.869735] lost page write due to I/O error on sdb1
[ 1728.883689] SCSI error : <5 0 0 0> return code = 0x8000002
[ 1728.883703] sdb: Current: sense key: Data Protect
[ 1728.883710] Additional sense: Write protected
[ 1728.883726] Info fld=0x0
[ 1728.883732] end_request: I/O error, dev sdb, sector 574
[ 1728.883743] Buffer I/O error on device sdb1, logical block 511
[ 1728.883750] lost page write due to I/O error on sdb1
[ 1728.897675] SCSI error : <5 0 0 0> return code = 0x8000002
[ 1728.8976...

Read more...

Revision history for this message
Ben Collins (ben-collins) wrote :

This bug has been flagged because it is old and possibly inactive. It may or may
not be fixed in the latest release (Breezy Badger 5.10). It is being marked as
"NEEDSINFO". In two weeks time, if the bug is not updated back to "NEW" and
validated against Breezy, it will be closed.

This is needed in order to help manage the current bug list for the kernel. We
would like to fix all bugs, but need users to test and help with debugging.

If this change was in error for this bug, please respond and make the
appropriate change (or email <email address hidden> if you cannot make the
change).

Thanks for your help.

Revision history for this message
sam tygier (samtygier) wrote :

i can confirm the bug still exists in breezy final.

Revision history for this message
Ben Collins (ben-collins) wrote :

If possible, please upgrade to Dapper's 2.6.15-7 kernel. If you do not want to
upgrade to Dapper, then you can also wait for the Dapper Flight 2 CD's, which
are due out within the next few days.

Let me know if this bug still exists with this kernel.

Revision history for this message
sam tygier (samtygier) wrote :

sorry for long silence.

this is still occuring in dapper, clean installed from flight 4, and a few days of updates. kernel 2.6.15-17.24

Revision history for this message
Matt Zimmerman (mdz) wrote :

This bug is set to target dapper, but it's an upstream issue with no fix in sight. Unless there is a real opportunity to fix this for dapper final, please remove the milestone

Changed in linux-source-2.6.15:
status: Needs Info → Confirmed
Revision history for this message
sam tygier (samtygier) wrote :

as nobody else ever confirmed this, and i no longer have the hardware, i'll close this.

Changed in linux-source-2.6.15:
assignee: ben-collins → nobody
milestone: ubuntu-6.06 → none
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.