On a Debian 12 installation with Plasma desktop, I'm having a weird problem copying files to USB flash drives. Copying a 1GB file it should take a few minutes, but it completes instantly and reportedly successfully. The copied file appears to be the same size as the source file, but when I try to open it, it appears to be empty or corrupt.
Specifically, I'm attempting to copy an iso file to a flash drive set up with Ventoy. The Ventoy partition is formatted with exFAT, and has 5 GB free. When I attempt to boot into the offending copied iso file, I get an error (something like "magic number is incorrect").
I've tried both terminal and Dolphin to copy the file, with the exact same result in both cases: the copy operation completes instantly and the copied file appears to be the same size as the source, but the copied file doesn't work. Adding to the weirdness: the checksum of the copied file is correct.
Workaround, and proof that the problem is not with the flash drive: a virtual machine running Windows is able to properly copy to the flash drive properly. As expected, the process to copy a >1GB iso file takes a few minutes to complete, and I am able to boot into the iso file via Ventoy.
Am I somehow unwittingly creating a symbolic link or something silly like that?
Please help! Thanks in advance!
[Solved] Files copy instantly to flash drive, but appear to be empty
-
- Posts: 7
- Joined: 2024-11-15 03:53
- Has thanked: 3 times
[Solved] Files copy instantly to flash drive, but appear to be empty
Last edited by burtfaceman on 2025-02-02 17:56, edited 1 time in total.
-
- Global Moderator
- Posts: 4262
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 124 times
- Been thanked: 576 times
Re: Files copy instantly to flash drive, but appear to be empty
Hello,
USB sticks are usually very slow. The operating system (Debian) uses RAM as a memory cache to buffer file transfers, i.e. file copying. So, from the user's point of view, the copy command is completed before the actual data is written to the USB flash drive, and the OS continues to copy data files in the background. You have to wait for the copy to complete before you can use the copied files. In a terminal, you can do this by running the command
--
note: discussion moved to "Beginners Questions" sub-forum.
This may be normal behaviour, i.e. using a Debian/GNU Linux console.burtfaceman wrote: 2025-01-25 05:12 [..] I'm having a weird problem copying files to USB flash drives. Copying a 1GB file it should take a few minutes, but it completes instantly and reportedly successfully. The copied file appears to be the same size as the source file, but when I try to open it, it appears to be empty or corrupt.
[..]
USB sticks are usually very slow. The operating system (Debian) uses RAM as a memory cache to buffer file transfers, i.e. file copying. So, from the user's point of view, the copy command is completed before the actual data is written to the USB flash drive, and the OS continues to copy data files in the background. You have to wait for the copy to complete before you can use the copied files. In a terminal, you can do this by running the command
sync
, which will keep the console idle until the transfer is complete. Otherwise, as @ruwolf suggested, the un-mounting features of desktop environment ("safely remove ..") will sync the file system on the USB stick for you.--
note: discussion moved to "Beginners Questions" sub-forum.
-
- Posts: 7
- Joined: 2024-11-15 03:53
- Has thanked: 3 times
Re: Files copy instantly to flash drive, but appear to be empty
Ah, this was it, thanks! I'd have expected Plasma or any desktop environment would know whether a file copy was truly complete.Aki wrote: 2025-01-25 08:18 This may be normal behaviour, i.e. using a Debian/GNU Linux console.
USB sticks are usually very slow. The operating system (Debian) uses RAM as a memory cache to buffer file transfers, i.e. file copying. So, from the user's point of view, the copy command is completed before the actual data is written to the USB flash drive, and the OS continues to copy data files in the background. You have to wait for the copy to complete before you can use the copied files. In a terminal, you can do this by running the commandsync
, which will keep the console idle until the transfer is complete. Otherwise, as @ruwolf suggested, the un-mounting features of desktop environment ("safely remove ..") will sync the file system on the USB stick for you.
- RedGreen925
- Posts: 185
- Joined: 2024-05-16 02:56
- Has thanked: 4 times
- Been thanked: 36 times
Re: Files copy instantly to flash drive, but appear to be empty
It does that is why you seeing the spinning circle when you eject the drive before it has completed the copy. Then once that is complete the spinning stops and the drive disappears from the places or devices whichever one it is it shows up in. I get to see this on more than a few occasions when getting to quick to try the eject triangle.. I agree it is stupid the way it does it with the quick dismissal of the dialog it does. More than few times I have tried to get the speed of copy like you can with internal drive with large files but I cannot even get the mouse there before the dialog is gone.burtfaceman wrote: 2025-02-02 17:51 Ah, this was it, thanks! I'd have expected Plasma or any desktop environment would know whether a file copy was truly complete.
-
- Global Moderator
- Posts: 3243
- Joined: 2018-06-20 15:16
- Location: Colorado
- Has thanked: 69 times
- Been thanked: 286 times
Re: [Solved] Files copy instantly to flash drive, but appear to be empty
Xfce has a ‘transfer in progress’ dialog that doesn't go away until it's actually done. Unfortunately the dialog size is hard coded so you do have to mouse up the size to see the transfer rate.
Mottainai