linuxmint / nemo

File browser for Cinnamon
GNU General Public License v2.0
1.19k stars 298 forks source link

Handling write protected media #3446

Open ToIstvan opened 3 weeks ago

ToIstvan commented 3 weeks ago

Distribution

Mint 22 (but 21.x too)

Package version

6.2.8 (but olders too)

Frequency

Always

Bug description

Write protected SD card, or write protected floppy (I Have an USB floppy drive also). Try to copy something to a write protected media. An error message says the media is write protected - OK. But the copy process still working, and not stopping. Anytime after, try to shut down, or restart the system, got a warning message: copy process running, do you want to kill it or cancel the shut down/restart....

Steps to reproduce

For first sorry, I am using a localized Mint, so I don't know the exact messages in English.

  1. switch an SD card or floppy to write protected state.
  2. Put in the drive
  3. Nemo window appears
  4. try to drag some files here or try to copy in another way to media.
  5. Write protected warning message appears
  6. copy progress bar still working
  7. close the copy progress window with progress bar
  8. wait a bit, or more.
  9. try to restart or shut down the system
  10. See the warning about copy progress....

Expected behavior

kill the copy process when write protected media detected.

Additional information

There is also some kind a semantic bug in general I think, if you try to write images with dd to a protected media, the process is going on even the write protected state is detected, you must unmount the drive to stop it.

Jeremy7701 commented 3 weeks ago

Are you using copy - perhaps in nemo or are you using dd to write to a device? These are very different commands. dd requires great care in its usage - it can overwrite anything!

ToIstvan commented 3 weeks ago

Are you using copy - perhaps in nemo or are you using dd to write to a device? These are very different commands. dd requires great care in its usage - it can overwrite anything!

No, I used dd (in terminal) to write some image files to floppy disk, just I mentioned that I ran in the same issue when the floppy was set to write protect even with dd. The nemo symptom exist regardless of this.

Jeremy7701 commented 3 weeks ago

With the nemo problem, are you using a hardware switch on the device for the write protection? I would guess that low-end devices don't inform the OS that they are in a read-only state, so nemo waits for an attempted write operation to complete.

Similar considerations would apply to dd.

ToIstvan commented 3 weeks ago

The USB floppy drive is a low-end hardware of course, but the SD-card drive in a HP laptop maybe not. But anyway, nemo displays a "write protected media" message, as wrote, so the read-only state is detected. After this message the copy process is not stopped...