-
Notifications
You must be signed in to change notification settings - Fork 160
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
Windows: complete rewrite of drive restoration and image writing #740
Conversation
432ad64
to
9f814da
Compare
b738491
to
c0045f7
Compare
223f9c3
to
c5252fd
Compare
Alright, the |
5893e45
to
14f1be9
Compare
@kparal @gastoner can you please do one more round of testing? I have installed Windows 11 and could reproduce the error. I have changed few things and it made things more reliable. Still I got verification error afterwards, but not all the time. This was only with faster USB drive so I suspect it was caused by some data still not being fully written. I have added a Thank you. |
I tried it about 6 times. I haven't seen the 4.8% bug at all. I haven't seen the double-write bug. I still saw the first-write-after-boot bug (screenshot log1 log2) , but only with my thumb drive, not usb hdd. Also, waiting a few minutes after rebooting seemed to avoid this bug. |
Here are mine observations:
With using Rufus to write the iso, from log I see some similar patterns as in FMW-helper.log rufus.log |
de83c43
to
37db5b3
Compare
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
I'm going to merge this now. I will make something like a pre-release so this gets more tested and we can catch the remaining corner cases before making a "stable" release. |
I've spent several hours (sigh) testing 5.1.90 pre-release with two different usb sticks, and it mostly works fine. I only filed #759 as a regression. However, I still see some problems, randomly and rarely. I saw the 4.8% problem once, and I saw the Restore functionality only re-creating a partition but not formatting it several times. But I'm starting to attribute it to some problem in Windows itself. I noticed that every time I have a Fedora image on the stick and plug it in, the "Safely remove" systray icon only contains "..." when I display its menu, instead of "Eject $thumbdrive". It's like some operation is pending and never finishes. It's even worse in the Disk Management tool, if you try to eject the drive from there, the app completely freezes. When I play with the system like this, often I then saw the inability to restore the drive, and I had to reboot the PC to make it work again. Some operation was stuck/pending/etc in the background, probably, blocking access. But not always. It's exhausting, because when I think I finally have a reproducer, I find out that it works differently with a different stick. It's probably some race in Windows itself. So overall 5.1.90 seems to work OK, and the issues I randomly see might just be Windows bugs, which are not going to disappear with any FMW rewrite... |
Thank you so much for a thorough testing. I really appreciate it. Do you think in a normal use, where the user just writes the image, boot it and restores the drive aftewards this will work reliably? Basically asking whether the issues you mentioned are only reproducible when doing multiple operations one after the other? I will look into the issue you reported, I already have some ideas what could be wrong. |
@kparal would you be able to get a log (MediaWriter-helper.txt) from when the restore functionality fails to format the partition? |
Here we go: But I couldn't reproduce it with just the systray interaction this time, I had to open Disk Management, try to eject the drive from there, kill the app, reinsert the thumb drive, and then restore in FMW. On an unrelated note, I noticed that when the drive is affected by th 4.8% bug, it shows up in explorer (D:, "unformatted") and in systray correctly (drive name). When it's not affected by 4.8%, it doesn't show up in explorer and systray only contains "..." instead of drive name. But I can't be sure, this is hard to reproduce several times in a row. |
The fewer operations, the higher likelihood of things working, I assume. But it's tricky. I might have a Windows computer where I create the thumb drive, then use it to install Fedora on a different computer, and then put the thumb drive back to the Windows computer to restore it. That's already two actions. And it might be different if you closed FMW in the meantime or kept it running. And I'm unable to pinpoint a simple reproducer to my issues, so I can't say how much reliable a simple use case is. But overall I think this is definitely not worse than previous FMW versions, if that helps :-) In other words, I think you can release it this way. |
This could be a big source of my troubles. Maybe if we fix that, all of these issues might go away. |
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