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

Example fails on "invalid magic number: 0" #13

Open
Raythonic opened this issue Aug 9, 2022 · 0 comments
Open

Example fails on "invalid magic number: 0" #13

Raythonic opened this issue Aug 9, 2022 · 0 comments

Comments

@Raythonic
Copy link

rwalk@walkubu:/mnt/data3/git2/RustyNode$ sudo target/debug/rusty_node /dev/sdc
thread 'main' panicked at 'ext4 volume: failed to parse superblock

Caused by:
filesystem uses an unsupported feature: "invalid magic number: 0"', src/main.rs:10:63
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

`extern crate ext4;

use std::env;
use std::fs;

fn main() {
let r = fs::File::open(env::args().nth(1).expect("one argument")).expect("openable file");
let mut options = ext4::Options::default();
options.checksums = ext4::Checksums::Enabled;
let vol = ext4::SuperBlock::new_with_options(r, &options).expect("ext4 volume");
let root = vol.root().expect("root");
vol.walk(&root, "/", &mut |_, path, _, _| {
println!("{}", path);
Ok(true)
})
.expect("walk");
}`

dmitry-zakablukov added a commit to passware/ext4-rs that referenced this issue Oct 3, 2023
…проверки целостности ext4 образа через feature flags

Merge in CRATES/ext4-rs from feature/cases/PKM-1959 to without_state_verification

* commit 'a6733ca36926e404595d6ceb46998eca8d427c25':
  [PKM-1959] Feature flag added for checksums verification
  [PKM-1959] Feature flag added for clean state verification
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant