Python Forum

Full Version: Discovered a terrible bug in file copy (cp)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
** 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.
You could perhaps file a bug report to the GNU Coreutils developers...
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.