PoC-Consortium / scavenger

A fast Burstcoin miner written in Rust
GNU General Public License v3.0
107 stars 64 forks source link

Can not read network drives sectors #90

Closed andreivcodes closed 3 years ago

andreivcodes commented 3 years ago

Because diskutil does not show network drives on MacOS, scavenger is not able to start

Is there any workaround for this?

Screenshot 2021-05-20 at 16 29 14
JohnnyFFM commented 3 years ago

Hi,

issue acknowledged.

https://github.com/PoC-Consortium/scavenger/blob/99326f2bbe0709c74887f69954b999fc2ea7b5e5/src/utils.rs#L51

The macos routine panics if sector size can't be determined. I'll change it to just warn and default to 4096. Should be done by EOD.

Johnny

JohnnyFFM commented 3 years ago

I've just pushed a fix into master, please let me know if working.

JohnnyFFM commented 3 years ago

should have looked at PRs first :p

andreivcodes commented 3 years ago

macOS works, I tested it, thanks for the tip.

I found a similar issue on aarch64 linux, on my Synology NAS to be exact

./scavenger -c config.yaml 
23:09:18 [INFO]  Scavenger v.1.8.0
thread 'main' panicked at 'failed to execute 'lsblk -o PHY-SeC': Os { code: 2, kind: NotFound, message: "No such file or directory" }', src/utils.rs:83:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

I forced sector_size to 4096 in there as well and now it's all good now.

I believe all the checks regarding sector_size should have a mechanism to fail gracefully to avoid such problems on other platforms.

JohnnyFFM commented 3 years ago

agreed, https://github.com/PoC-Consortium/scavenger/blob/f3e79445912f7d04854b4ae6827fa6ad72a8a1c1/src/utils.rs#L83 replace .expect(...) with .unwrap_or_default() should do the trick.

andreivcodes commented 3 years ago

I will test it tomorrow and make a PR :)

andreivcodes commented 3 years ago

Done in PR https://github.com/PoC-Consortium/scavenger/pull/94