Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A flash drive restored on Linux is not accessible in Windows #575

Closed
kparal opened this issue Nov 14, 2022 · 7 comments · Fixed by #740 or #763
Closed

A flash drive restored on Linux is not accessible in Windows #575

kparal opened this issue Nov 14, 2022 · 7 comments · Fixed by #740 or #763
Assignees
Labels

Comments

@kparal
Copy link

kparal commented Nov 14, 2022

I noticed that when I restore a flash drive on Windows, I see it in the File explorer and it has a letter assigned. However, when I restore the same drive on Linux (Fedora 37) and then plug it to my Windows system, the File explorer doesn't see the drive - there is no flash drive icon visible and of course that means nor a letter assigned.

When I look at that flash drive through gnome-disks, it looks the same in both cases - an MBR with one exFAT partition. I have no idea why Windows accepts it only when the restoration happens on Windows, but it is reproducible behavior for me. The downside of this is that if such a restored flash drive is given to a person with Windows, he has no easy way to make that flash drive usable, because the file explorer doesn't see it, and FMW doesn't offer to restore it (it's already "restored").

A possible workaround is to burn some ISO to this "invisible" flash drive through FMW on Windows, and then restore it. Once that is done, the flash drive is made accessible again.

Reproducer:

  1. Write a Live ISO to a flash drive on Windows with FMW
  2. Restore the flash drive on Linux with FMW
  3. Plug the flash drive to Windows and see that Windows doesn't see it - it's not listed in File explorer -> This PC -> Devices and drives

The same thing happens, when I try to restore the flash drive manually, by reformatting it with MBR and creating an exFAT partition. If the drive was previously burned on Windows with FMW, even after manual restore Windows doesn't see it. But if I restore the drive on Windows first, or if I burn the ISO on Linux with FMW and then do the manual restore, the drive is accessible on Windows.

It almost seems like FMW sets some flag "this is an invisible drive" on Windows during ISO burn, and when the drive is reformatted on Linux, the flag is not reset. But when it's restored through FMW on Windows, the flag gets reset.

System:
FMW 5.0.4
Windows 10
Fedora 37

@grulja
Copy link
Collaborator

grulja commented Nov 18, 2022

This might have the same reason as why we have to make sure to restore the partition table when restoring the drive on Windows. Looks that the way we write images on Windows makes it to corrupt it somehow and for that reason it's not working when restored on Linux. I guess I will have to check and improve the way we write images on Windows to fix this and possibly get rid of the hack we have there.

@grulja grulja self-assigned this Nov 18, 2022
@grulja grulja added the Windows label Nov 18, 2022
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626
Fixes FedoraQt#575
Fixes FedoraQt#574
Fixes FedoraQt#555
Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 18, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 21, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 22, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 22, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 22, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 23, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 23, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 23, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 23, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 25, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 25, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 25, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 25, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 25, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit to grulja/MediaWriter that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes FedoraQt#626 | Fixes FedoraQt#575 | Fixes FedoraQt#574 |Fixes FedoraQt#555 | Fixes FedoraQt#96
grulja added a commit that referenced this issue Oct 29, 2024
This is a complete rewrite of the Windows support. It introduces a new
library 'libwindisk' that combines use of WMI and WinAPI to manipulate
with devices. We use Windows Storage Management for getting information
about devices and some actions, especially since pure WinAPI does not
seem to have support for things like formatting or partition removal.
This library is used in both the app and the helper process used for
writing and formatting. We now also don't rely on diskpart since it
didn't work properly in some cases.

Fixes #626 | Fixes #575 | Fixes #574 |Fixes #555 | Fixes #96
@kparal
Copy link
Author

kparal commented Nov 13, 2024

Is there a FMW 5.1.90 build for Linux (e.g. Flatpak) that I could test this with? In Releases there's no Linux build.

@grulja
Copy link
Collaborator

grulja commented Nov 13, 2024

Is there a FMW 5.1.90 build for Linux (e.g. Flatpak) that I could test this with? In Releases there's no Linux build.

Both Flathub and Fedora packages are updated to this version actually and to test this, you don't actually need the same version on Linux, since for Linux there are no related changes.

@kparal
Copy link
Author

kparal commented Nov 13, 2024

I don't see how this can be fixed outside of the Linux build. The problem is that restoring the drive on Linux doesn't make it appear in file explorer on Windows. It's not related to FMW on Windows.

Anyway, I tested it right now with the current Fedora RPM version of FMW (5.1.90). I burned an ISO and then restored the image. I looked at it, it had a single exfat partition, looked OK. Inserted the stick in a Windows computer, and nothing happens, no drive in explorer. There was a Safely Remove systray menu with just three dots in it (I already complained about it here), but nothing else. Then I started FMW 5.1.90 on Windows. Quite remarkably, there was a "Restore drive" option there. How on earth did FMW detect the drive as being restorable? I don't understand it. After restoring the drive in FMW in Windows, the drive immediately showed up in explorer, and the Safely Remove systray menu got populated correctly. Hmmm.

I think this should be re-opened, it still seems to be happening.

@grulja
Copy link
Collaborator

grulja commented Nov 13, 2024

I don't see how this can be fixed outside of the Linux build. The problem is that restoring the drive on Linux doesn't make it appear in file explorer on Windows. It's not related to FMW on Windows.

Anyway, I tested it right now with the current Fedora RPM version of FMW (5.1.90). I burned an ISO and then restored the image. I looked at it, it had a single exfat partition, looked OK. Inserted the stick in a Windows computer, and nothing happens, no drive in explorer. There was a Safely Remove systray menu with just three dots in it (I already complained about it here), but nothing else. Then I started FMW 5.1.90 on Windows. Quite remarkably, there was a "Restore drive" option there. How on earth did FMW detect the drive as being restorable? I don't understand it. After restoring the drive in FMW in Windows, the drive immediately showed up in explorer, and the Safely Remove systray menu got populated correctly. Hmmm.

I think this should be re-opened, it still seems to be happening.

Ok, I think I misunderstood the issue. Anyway, the detection in FMW in Windows to allow to restore the drive or not is basically done on assumption whether the drive has all the partitions mountable, which in your case it doesn't. I'm reopening this issue then.

@grulja grulja reopened this Nov 13, 2024
@kparal
Copy link
Author

kparal commented Nov 13, 2024

OK, I think I'm onto something! On Linux, FMW restores the drive as MBR+exfat partition. On Windows, FMW restores it as GPT+exfat partition.

When I test this manually using gnome-disks, when I format it as GPT+exfat (or ntfs, doesn't matter, same behavior), it works fine in Windows (shows up in explorer, behaves normally in systray). But when I format it as MBR+exfat/ntfs, it exhibits exactly the described symptoms (not in explorer, three dots in systray). This is fully repeatable.

BUT!

When I use dd to overwrite the first 10MB of the drive with zeroes, suddenly I can format the drive as MBR+exfat/ntfs and it works in Windows!

So, there's a clear pattern here. When a Fedora ISO is written onto the drive, some it contains some partition layout metadata. When the drive is reformatted as MBR, for some reason it confuses Windows and it can't finish probing the drive. If the metadata are completely overwritten (10MB was enough), then a new MBR layout works just fine on Windows.

Reproducer:

  1. Write a Fedora image onto the drive
  2. Restore the drive on Linux (it creates MBR+exfat)
  3. Put the drive into Windows, it doesn't show up in explorer
  4. Back in Linux, use gnome-disks (that's what I tested) and reformat it as MBR+exfat
  5. Put it into Windows again, still doesn't work
  6. Back in Linux, make sure it's unmounted(!) and rewrite the beginning of the drive: sudo dd if=/dev/zero of=/dev/sdX bs=10M count=1
  7. Again use gnome-disks to reformat it as MBR+exfat
  8. Put it into Windows, this time it works

So what we need to do is to rewrite the first 10MB (I don't know how many really, this number worked for me) with zeroes, before you start creating the partition layout. (Note: wipefs -a didn't help, I really needed to overwrite the start and end manually). Or switch to GPT, but I think it would make sense to use the zero overwrite in both cases. And maybe not just the beginning, but also the end (because it could contain a GPT backup table from some past initialization and again confuse Windows). This should definitely increase the reliability of the restoration process.

@grulja
Copy link
Collaborator

grulja commented Nov 14, 2024

THANKS!!

We actually do the same thing on Windows, we overwrite some first blocks with zeroes (also some blocks at the end), to be sure there are no GPT partition residues. I will implement the same on Linux. Also, I think changing to GPT + exFAT might be better than MBR + exFAT to be on the same par as Windows.

grulja added a commit to grulja/MediaWriter that referenced this issue Nov 20, 2024
Similar to Windows, overwrite the beginning of the drive and the end of
the drive with zeroes before creating a new partition table. This is to
make sure there are no partition table residues after a Fedora image was
written onto the drive.

Resolves FedoraQt#575
grulja added a commit to grulja/MediaWriter that referenced this issue Nov 20, 2024
Similar to Windows, overwrite the beginning of the drive and the end of
the drive with zeroes before creating a new partition table. This is to
make sure there are no partition table residues after a Fedora image was
written onto the drive.

Resolves FedoraQt#575
grulja added a commit to grulja/MediaWriter that referenced this issue Nov 20, 2024
Similar to Windows, overwrite the beginning of the drive and the end of
the drive with zeroes before creating a new partition table. This is to
make sure there are no partition table residues after a Fedora image was
written onto the drive.

Resolves FedoraQt#575
@grulja grulja closed this as completed in 05eda32 Nov 22, 2024
grulja added a commit that referenced this issue Nov 22, 2024
Similar to Windows, overwrite the beginning of the drive and the end of
the drive with zeroes before creating a new partition table. This is to
make sure there are no partition table residues after a Fedora image was
written onto the drive.

Resolves #575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants