[TC11.50B2] TC moved file to not yet spinned up external USB drive
Moderators: Hacker, petermad, Stefan2, white
[TC11.50B2] TC moved file to not yet spinned up external USB drive
OS: Windows 8.1
The external drive is connected through AgeStar 3U2B3A.
The drive was at sleeping.
TC started and completed moving w/o an error.
The file has been erased before the drive even has started to spin.
The drive is disconnected in between.
The file was lost.
I think this is serious bug.
The external drive is connected through AgeStar 3U2B3A.
The drive was at sleeping.
TC started and completed moving w/o an error.
The file has been erased before the drive even has started to spin.
The drive is disconnected in between.
The file was lost.
I think this is serious bug.
- ghisler(Author)
- Site Admin
- Posts: 50824
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
Unfortunately this cannot be prevented. When moving, TC waits for the "copying complete" from Windows before deleting the source. The Windows function CopyFileEx returns OK in this case because it successfully writes the file to the write cache. I don't see any way to detect your special case, even manually. You could use the option "Verify", but it would make copying at least 10 times slower.
Moderator message from: ghisler(Author) » 2024-11-14, 08:10 UTC
Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
Copy does work differently and WAITS the spin up.ghisler(Author) wrote: 2024-11-14, 08:10 UTC Unfortunately this cannot be prevented. When moving, TC waits for the "copying complete" from Windows before deleting the source. The Windows function CopyFileEx returns OK in this case because it successfully writes the file to the write cache. I don't see any way to detect your special case, even manually. You could use the option "Verify", but it would make copying at least 10 times slower.
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-movefileexaghisler(Author) wrote: 2024-11-14, 08:10 UTC Unfortunately this cannot be prevented. When moving, TC waits for the "copying complete" from Windows before deleting the source. The Windows function CopyFileEx returns OK in this case because it successfully writes the file to the write cache. I don't see any way to detect your special case, even manually. You could use the option "Verify", but it would make copying at least 10 times slower.
MOVEFILE_WRITE_THROUGH 8 (0x8) |
The function does not return until the file is actually moved on the disk. Setting this value guarantees that a move performed as a copy and delete operation is flushed to disk before the function returns. The flush occurs at the end of the copy operation. This value has no effect if MOVEFILE_DELAY_UNTIL_REBOOT is set. |
- ghisler(Author)
- Site Admin
- Posts: 50824
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
MOVEFILE_WRITE_THROUGH bypasses the write cache, which makes copying painfully slow. Sorry, but Total Commander would become unusable when I used this.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
You don't need write the whole file, enough to only start write the first byte. The rest can be done without the flag.ghisler(Author) wrote: 2024-11-15, 08:42 UTC MOVEFILE_WRITE_THROUGH bypasses the write cache, which makes copying painfully slow. Sorry, but Total Commander would become unusable when I used this.
- ghisler(Author)
- Site Admin
- Posts: 50824
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
I have tried to reproduce this problem with an external USB harddisk, but failed. Here is what I tried:
1. Opened control.exe
2. Switched to "Small icons" or "Large icons"
3. Clicked on power options
4. Clicked on the option to change the current plan
5. Opened the extended options
6. Set the harddisk timeout to 15 minutes
7. Attached the USB disk
8. Copied a file to it
9. Switched to a different tab to not accidentally awaken the drive
10. Waited 15 minutes for the drive to spin down
11. Dragged a file to the tab with the USB disk, holding down shift to move the file
12. The copy progress dialog stayed up until the drive had finished spinning up and the file was copied
13. Immediately unplugged the drive after the copy dialog had disappeared
14. Re-attached the drive
-> the file had been copied successfully.
1. Opened control.exe
2. Switched to "Small icons" or "Large icons"
3. Clicked on power options
4. Clicked on the option to change the current plan
5. Opened the extended options
6. Set the harddisk timeout to 15 minutes
7. Attached the USB disk
8. Copied a file to it
9. Switched to a different tab to not accidentally awaken the drive
10. Waited 15 minutes for the drive to spin down
11. Dragged a file to the tab with the USB disk, holding down shift to move the file
12. The copy progress dialog stayed up until the drive had finished spinning up and the file was copied
13. Immediately unplugged the drive after the copy dialog had disappeared
14. Re-attached the drive
-> the file had been copied successfully.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
I still could repro.ghisler(Author) wrote: 2024-11-17, 09:04 UTC I have tried to reproduce this problem with an external USB harddisk, but failed. Here is what I tried:
Mine steps:
1. Create new power plan.
2. Set sleep timeout for 1 min.
3. SHIFT-F4 and create `1.dat` with 5 bytes content (`123<lr>`) on a local drive (HDD too, but seems wake ups faster).
4. Switch the tab to the local drive.
5. Wait ~10 min (deliberately greater interval)
6. F6 to copy `1.dat` to the USB drive.
It looks like it wake ups too slowly and Windows decides to reattach it or something because of the dismount sound.
- ghisler(Author)
- Site Admin
- Posts: 50824
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
This sounds like a hardware problem, no idea how to resolve it.
Does the drive spin up when you switch to the drive in a panel before moving the file to it?
Or when the drive contents are already shown, does it spin up when you press Ctrl+R?
Then I could just refresh the directory before each move operation.
Does the drive spin up when you switch to the drive in a panel before moving the file to it?
Or when the drive contents are already shown, does it spin up when you press Ctrl+R?
Then I could just refresh the directory before each move operation.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
Do you use the Safely Remove Hardware command before disconnecting the disk? The default setting for normal USB disks in Device Manager is to not use a cache, which makes them slow for small fragmented writes. With a cache, the command must always be used.
#148174 Personal license
Running Total Commander v8.52a
Running Total Commander v8.52a
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
The disconnection happens automatically by an event, not by manual disconnection, because of the Windows dismount sound. I don't know why, but suspect of some timeout in the API.j7n wrote: 2024-11-18, 13:13 UTC Do you use the Safely Remove Hardware command before disconnecting the disk?
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
I'll try to investigate it further by remove other drivers which may interfere.ghisler(Author) wrote: 2024-11-18, 10:18 UTC This sounds like a hardware problem, no idea how to resolve it.
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
2andry81
Have you tried adding the USB drive to: "Configuration" -> "Edit/Delete" -> Use compatibility mode for the following drives:" ?
Have you tried adding the USB drive to: "Configuration" -> "Edit/Delete" -> Use compatibility mode for the following drives:" ?
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
- ghisler(Author)
- Site Admin
- Posts: 50824
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
2andry81
Could you please answer my questions?
Could you please answer my questions?
If I find a way to awaken the drive before trying to move a file, the move function shouldn't fail without error.Does the drive spin up when you switch to the drive in a panel before moving the file to it?
Or when the drive contents are already shown, does it spin up when you press Ctrl+R?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC11.50B2] TC moved file to not yet spinned up external USB drive
Yes.Does the drive spin up when you switch to the drive in a panel before moving the file to it?
It based on the drive caching. Not always even the read of a file does trigger the awakening.Or when the drive contents are already shown, does it spin up when you press Ctrl+R?