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

Images not a multiple of the device block size silently fail to write on macOS #611

Open
bguzzardi opened this issue Apr 24, 2023 · 1 comment
Labels

Comments

@bguzzardi
Copy link

Preface: I understand that FMW isn't really meant to be used in this way.

Writing this OpenWrt image to a USB stick fails with no error message on macOS.

My guess is that because the Fedora Media Writer helper uses /dev/rdiskN instead of /dev/diskN on macOS, writes fail if they aren't a multiple of the device block size, see user astruct's answer on StackExchange/SuperUser. That's consistent with what happens using dd:

# USB Stick isn't bootable
% sudo dd if=openwrt-ipq40xx-chromium-google_wifi-squashfs-factory.bin of=/dev/rdisk4 bs=1M
dd: /dev/rdisk4: Invalid argument
20+1 records in
20+0 records out
20971520 bytes transferred in 3.086768 secs (6794006 bytes/sec)
# USB stick boots OK
% sudo dd if=openwrt-ipq40xx-chromium-google_wifi-squashfs-factory.bin of=/dev/disk4 bs=1M 
20+1 records in
20+1 records out
21129694 bytes transferred in 4.396772 secs (4805729 bytes/sec)

I'm assuming the helper encounters a similar error to dd: /dev/rdisk4: Invalid argument which isn't propagated up from the helper into the UI, and because of #257 there's no verification step to catch the missing partial block at the end either.

Thanks to everyone for the hard work you've put into this useful tool, and I hope this report is helpful.

@bguzzardi
Copy link
Author

To avoid confusion/distraction/wild-goose-chases, re-running dd without bs=1M still leaves an incomplete image written:

% sudo dd if=openwrt-ipq40xx-chromium-google_wifi-squashfs-factory.bin of=/dev/rdisk4
dd: /dev/rdisk4: Invalid argument
41268+1 records in
41268+0 records out
21129216 bytes transferred in 17.996230 secs (1174091 bytes/sec)
% sudo dd if=openwrt-ipq40xx-chromium-google_wifi-squashfs-factory.bin of=/dev/disk4
41268+1 records in
41268+1 records out
21129694 bytes transferred in 8.008283 secs (2638480 bytes/sec)

The image file is 21129694 bytes long.

@grulja grulja added the MacOS label Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants