Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #231295 > unrolled thread

Flash Drive suddenly read only?

Started bykaye n <guikaye@gmail.com>
First post2021-01-31 07:10 +0100
Last post2021-01-31 21:40 +0100
Articles 8 — 6 participants

Back to article view | Back to linux.debian.user


Contents

  Flash Drive suddenly read only? kaye n <guikaye@gmail.com> - 2021-01-31 07:10 +0100
    Re: Flash Drive suddenly read only? Charles Curley <charlescurley@charlescurley.com> - 2021-01-31 07:50 +0100
      Re: Flash Drive suddenly read only? <tomas@tuxteam.de> - 2021-01-31 10:30 +0100
        Re: Flash Drive suddenly read only? kaye n <guikaye@gmail.com> - 2021-01-31 13:40 +0100
          Re: Flash Drive suddenly read only? The Wanderer <wanderer@fastmail.fm> - 2021-01-31 14:00 +0100
            Re: Flash Drive suddenly read only? The Wanderer <wanderer@fastmail.fm> - 2021-01-31 15:50 +0100
          Re: Flash Drive suddenly read only? David Wright <deblis@lionunicorn.co.uk> - 2021-01-31 22:10 +0100
    Re: Flash Drive suddenly read only? David Christensen <dpchrist@holgerdanske.com> - 2021-01-31 21:40 +0100

#231295 — Flash Drive suddenly read only?

Fromkaye n <guikaye@gmail.com>
Date2021-01-31 07:10 +0100
SubjectFlash Drive suddenly read only?
Message-ID<BDe5P-69G-1@gated-at.bofh.it>

[Multipart message — attachments visible in raw view] — view raw

Hello Friends!

When I plug in my usb flash drive to my desktop computer, I can edit
certain libreoffice calc files saved in that flash drive. But after I try
to copy several dbf files from the desktop computer hard drive to the flash
drive via the terminal, it says it's read only. When I open the calc files
again, they are now read only and cannot be edited.

The desktop is dual boot system, windows 7 and Debian 10.

If it matters, the dbf files in the desktop hard drive are always edited in
windows, then I sometimes log in to Debian and copy the desktop hard drive
dbf files onto my usb flash drive.   I cannot do that anymore, as stated
above. Even after rebooting or powering off.

Thank you for your time!
Kaye

[toc] | [next] | [standalone]


#231296

FromCharles Curley <charlescurley@charlescurley.com>
Date2021-01-31 07:50 +0100
Message-ID<BDeIx-6qd-1@gated-at.bofh.it>
In reply to#231295
On Sun, 31 Jan 2021 14:00:31 +0800
kaye n <guikaye@gmail.com> wrote:

> When I plug in my usb flash drive to my desktop computer, I can edit
> certain libreoffice calc files saved in that flash drive. But after I
> try to copy several dbf files from the desktop computer hard drive to
> the flash drive via the terminal, it says it's read only. When I open
> the calc files again, they are now read only and cannot be edited.

What file system is on the flash drive? What does gparted or parted
report?

Are the files marked read only (ro), or is the entire flash drive
mounted ro?

Are you editing the calc files from Linux or Windows?

How, exactly, are you mounting the flash drive under Linux. What
command?

How long has this been going on?

-- 
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/

[toc] | [prev] | [next] | [standalone]


#231298

From<tomas@tuxteam.de>
Date2021-01-31 10:30 +0100
Message-ID<BDhdn-82l-1@gated-at.bofh.it>
In reply to#231296

[Multipart message — attachments visible in raw view] — view raw

On Sat, Jan 30, 2021 at 11:27:52PM -0700, Charles Curley wrote:
> On Sun, 31 Jan 2021 14:00:31 +0800
> kaye n <guikaye@gmail.com> wrote:
> 
> > When I plug in my usb flash drive to my desktop computer, I can edit
> > certain libreoffice calc files saved in that flash drive. But after I
> > try to copy several dbf files from the desktop computer hard drive to
> > the flash drive via the terminal, it says it's read only. When I open
> > the calc files again, they are now read only and cannot be edited.
> 
> What file system is on the flash drive? What does gparted or parted
> report?
> 
> Are the files marked read only (ro), or is the entire flash drive
> mounted ro?
> 
> Are you editing the calc files from Linux or Windows?
> 
> How, exactly, are you mounting the flash drive under Linux. What
> command?
> 
> How long has this been going on?

What do the logs say? /var/log/syslog, or .../messages? Or however
systemd folks call that stuff these days).

If there's an event forcing the OS to put the file system in read-only
mode (e.g. write error), you will see traces of it in the system logs.

Cheers
 - t

[toc] | [prev] | [next] | [standalone]


#231301

Fromkaye n <guikaye@gmail.com>
Date2021-01-31 13:40 +0100
Message-ID<BDkbf-1wl-1@gated-at.bofh.it>
In reply to#231298

[Multipart message — attachments visible in raw view] — view raw

On Sun, Jan 31, 2021 at 5:20 PM <tomas@tuxteam.de> wrote:

> On Sat, Jan 30, 2021 at 11:27:52PM -0700, Charles Curley wrote:
> > On Sun, 31 Jan 2021 14:00:31 +0800
> > kaye n <guikaye@gmail.com> wrote:
> >
> > > When I plug in my usb flash drive to my desktop computer, I can edit
> > > certain libreoffice calc files saved in that flash drive. But after I
> > > try to copy several dbf files from the desktop computer hard drive to
> > > the flash drive via the terminal, it says it's read only. When I open
> > > the calc files again, they are now read only and cannot be edited.
> >
> > What file system is on the flash drive? What does gparted or parted
> > report?
> >
> > Are the files marked read only (ro), or is the entire flash drive
> > mounted ro?
> >
> > Are you editing the calc files from Linux or Windows?
> >
> > How, exactly, are you mounting the flash drive under Linux. What
> > command?
> >
> > How long has this been going on?
>
> What do the logs say? /var/log/syslog, or .../messages? Or however
> systemd folks call that stuff these days).
>
> If there's an event forcing the OS to put the file system in read-only
> mode (e.g. write error), you will see traces of it in the system logs.
>
> Cheers
>  - t
>

What file system is on the flash drive? What does gparted or parted
report?
Gparted shows fat32 as the file system of the flash drive.

Are the files marked read only (ro), or is the entire flash drive
mounted ro?
The dbf files seem to be READ WRITE EXECUTE for OWNER, GROUP, and OTHER

Are you editing the calc files from Linux or Windows?
>From Debian 10

How, exactly, are you mounting the flash drive under Linux. What
command?
I just insert the flash drive to the desktop computer and it mounts and is
ready for use.
If it matters, here is the /etc/fstab
UUID=2E7B-BA02   /media/kaye   vfat
user,rw,noauto,uid=1000,gid=users,umask=0,dmask=0,fmask=0,users,exec,x-systemd.device-timeout=5s,
  0    0

How long has this been going on?
Just last night

What do the logs say? /var/log/syslog, or .../messages?
I fail to open it

[toc] | [prev] | [next] | [standalone]


#231302

FromThe Wanderer <wanderer@fastmail.fm>
Date2021-01-31 14:00 +0100
Message-ID<BDkuC-1CR-13@gated-at.bofh.it>
In reply to#231301

[Multipart message — attachments visible in raw view] — view raw

On 2021-01-31 at 07:30, kaye n wrote:

> On Sun, Jan 31, 2021 at 5:20 PM <tomas@tuxteam.de> wrote:
> 
>> On Sat, Jan 30, 2021 at 11:27:52PM -0700, Charles Curley wrote:

>>> Are the files marked read only (ro), or is the entire flash
>>> drive mounted ro?
> 
> The dbf files seem to be READ WRITE EXECUTE for OWNER, GROUP, and
> OTHER

What do the following commands say (substituting in the actual paths to
the file and the mount directory of the USB drive)?

$ ls -lh /path/to/file.dbf

$ mount | grep /path/to/mount/directory

>>> How, exactly, are you mounting the flash drive under Linux. What 
>>> command?
> 
> I just insert the flash drive to the desktop computer and it mounts
> and is ready for use.

So any of a number of mechanisms could be handling this, and IIRC at
least some of them may not actually present the drive as mounted at all
(I believe I'm thinking of gvfs, there) - in which case the latter of
the above commands may not present any useful information.

>> What do the logs say? /var/log/syslog, or .../messages?
> 
> I fail to open it

Try doing it as root. You might also try running the command 'dmesg',
also as root; that's likely to present a lot more information, although
if you do it right after the change to read-only has happened then the
relevant part (if any) is likely to be in the final few lines.

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

[toc] | [prev] | [next] | [standalone]


#231304

FromThe Wanderer <wanderer@fastmail.fm>
Date2021-01-31 15:50 +0100
Message-ID<BDmd4-2Ko-21@gated-at.bofh.it>
In reply to#231302

[Multipart message — attachments visible in raw view] — view raw

(I've replied publicly again, as I'm not the only person who may be able
to advise you on this, and I don't see any reason for this to have been
taken off-list. If your reply being direct instead of via the list was
intentional, then I apologize.)

On 2021-01-31 at 08:28, kaye n wrote:

> On Sun, Jan 31, 2021 at 8:53 PM The Wanderer <wanderer@fastmail.fm>
> wrote:
> 
>> On 2021-01-31 at 07:30, kaye n wrote:

>>> The dbf files seem to be READ WRITE EXECUTE for OWNER, GROUP,
>>> and OTHER
>> 
>> What do the following commands say (substituting in the actual
>> paths to the file and the mount directory of the USB drive)?
>>
>> $ ls -lh /path/to/file.dbf
>>
>> $ mount | grep /path/to/mount/directory

> ls -lh /media/marlon/acval/ACPAY.DBF
> -rwxrwxrwx 1 homet users 0 Jan 19 21:04 /media/marlon/acval/ACPAY.DBF

This shows that the file is read/write in all cases.

> mount | grep /media/marlon
> /dev/sdd1 on /media/marlon type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=100,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro,user,x-systemd.device-timeout=5s)

This shows that the partition is mounted rw, which is to say,
read/write. It also shows fmask 0000, which corresponds to and likely
explains the file permissions seen from the other command.

It also shows 'errors=remount-ro', which is expected: that tells the
system that if there are errors involving this mount path, the mount
should be changed from read-write to read-only.

When you ran these commands, was the file being reported as read-only by
your other means of testing?

If not, then these results aren't useful; please reproduce the problem
and try the commands again while the system is in the problematic state.

If so, then we may need to dig deeper.

> dmesg
> It's too long. What should I be looking for?

Anything that:

* Mentions the device name, /dev/sdd1.

* Mentions the mount path, /media/marlon.

* Mentions the filesystem type, FAT / vfat.

* Mentions the word 'remount' (not case-sensitive).

* Has a timestamp which is around the same time as most recent point
when the "read-only" errors started to manifest. (dmesg timestamps tend
to be presented as 'seconds since boot', so reading them may not be the
easiest thing in the world.)

-- 
   The Wanderer

The reasonable man adapts himself to the world; the unreasonable one
persists in trying to adapt the world to himself. Therefore all
progress depends on the unreasonable man.         -- George Bernard Shaw

[toc] | [prev] | [next] | [standalone]


#231315

FromDavid Wright <deblis@lionunicorn.co.uk>
Date2021-01-31 22:10 +0100
Message-ID<BDs8O-6y6-19@gated-at.bofh.it>
In reply to#231301
On Sun 31 Jan 2021 at 20:30:22 (+0800), kaye n wrote:
> On Sun, Jan 31, 2021 at 5:20 PM <tomas@tuxteam.de> wrote:
> > On Sat, Jan 30, 2021 at 11:27:52PM -0700, Charles Curley wrote:
> > > On Sun, 31 Jan 2021 14:00:31 +0800 kaye n wrote:
> > >
> > > > When I plug in my usb flash drive to my desktop computer, I can edit
> > > > certain libreoffice calc files saved in that flash drive. But after I
> > > > try to copy several dbf files from the desktop computer hard drive to
> > > > the flash drive via the terminal, it says it's read only. When I open
> > > > the calc files again, they are now read only and cannot be edited.

This is written as if it has happened more than once (but that could
be your English). I'm going to assume this happened just once, and the
stick's readonly state is permanent.

> > If there's an event forcing the OS to put the file system in read-only
> > mode (e.g. write error), you will see traces of it in the system logs.

OTOH if the stick does this itself, there may be no trace at all, but
just a sudden change from rw to ro. You need to determine which.

> How long has this been going on?
> Just last night
> 
> What do the logs say? /var/log/syslog, or .../messages?
> I fail to open it

That suggests you should put yourself in the adm group so that you
can read them. (I'm assuming you "own" the machine.)

If the mount looks good for writing, and the file permissions look
good too, then I would suspect the firmware in the stick itself.
(Note—none of my sticks has a hardware switch on it. Does yours?)
Presumably you've checked it out in windows, too.

You're obviously running some sort of automounter, and I don't.
Others might need to help you with keeping the stick in an unmounted
state, which is recommended, but probably not essential, to perform
the actions below. Desktop Environments and automounters like to
get in the way, and dealing with them is above my pay-grade.

My own course of action would be:

  Physically mark the stick as suspect/ephemeral/for scratch use.

  Back up the files on the stick, BUT treat them all as suspect.
  They might already  have been corrupted by partially successful
  writes.

  Zero the drive with dd from /dev/zero, carefully, ie making
  sure you're writing to the correct device. (Needs root.)

  Unplug/reinsert/try using elsewhere, to see whether the stick
  is now unusable/has been zeroed:

    If zeroing was successful, repartition and reformat the stick,
    and keep it just for unimportant uses, eg if you use it to
    play videos/music/slide shows on your TV. (Needs root.)

    If your dbf/calc files are still present, zeroing was unsuccessful,
    so perform funeral rites. The stick's continued existence may
    present a security risk, like discarded papers. (Needs a hammer.)

Cheers,
David.

[toc] | [prev] | [next] | [standalone]


#231314

FromDavid Christensen <dpchrist@holgerdanske.com>
Date2021-01-31 21:40 +0100
Message-ID<BDrFL-684-3@gated-at.bofh.it>
In reply to#231295
On 2021-01-30 22:00, kaye n wrote:
> Hello Friends!
> 
> When I plug in my usb flash drive to my desktop computer, I can edit
> certain libreoffice calc files saved in that flash drive. But after I try
> to copy several dbf files from the desktop computer hard drive to the flash
> drive via the terminal, it says it's read only. When I open the calc files
> again, they are now read only and cannot be edited.
> 
> The desktop is dual boot system, windows 7 and Debian 10.
> 
> If it matters, the dbf files in the desktop hard drive are always edited in
> windows, then I sometimes log in to Debian and copy the desktop hard drive
> dbf files onto my usb flash drive.   I cannot do that anymore, as stated
> above. Even after rebooting or powering off.

First, back up your data.


When you respond to mailing list posts, please "reply to list".


Can you create files or save files on the USB drive using Windows?


David

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web