Python Forum
Discovered a terrible bug in file copy (cp) - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Forum & Off Topic (https://python-forum.io/forum-23.html)
+--- Forum: Bar (https://python-forum.io/forum-27.html)
+--- Thread: Discovered a terrible bug in file copy (cp) (/thread-18002.html)



Discovered a terrible bug in file copy (cp) - Larz60+ - May-02-2019

** BE WARNED **
This may be a Linux Mint or Debian issue, or may be related to the driver, not sure, but at any rate, it can destroy your Boot disk (I just recovered from this).
I was running Linux Mint 19.
here's what lead up to the problem.
  • I was backing up the source of a project onto a Sandisk microSDHC UHS-1 32GB card.
  • I stupidly didn't check the size of my project because i 'knew' that is was smaller by far then 32 GB
  • I made the (again stupid) mistake of copying the entire project, including data (about 200GB) onto the microSD.
  • copy started without a size warning, and within a short period of time proceeded to overwrite the microSD, and continue
    writing onto what turned out to be my boot disk.
My guess, it that the drives were using memory mapped I/O, and when the buffer was overwritten, it just happened to create a write
to the hard drive.

I don't know if this is reproducible, (if it is indeed memory mapped I/O problem, arrangement of these mem vectors may very well be different from install to install) and I don't want to try and find out. All I can advise is to be very careful when writing to one of these devices.


RE: Discovered a terrible bug in file copy (cp) - Gribouillis - May-02-2019

You could perhaps file a bug report to the GNU Coreutils developers...


RE: Discovered a terrible bug in file copy (cp) - Larz60+ - May-03-2019

It's on my list and will get done later today.
I'm under pressure to finish some work, and getting my OS back took most of yesterday.
So I'm running half fast.