1 unstable release

0.1.1 Sep 21, 2024

#583 in Unix APIs

24 downloads per month

MIT license

5KB
80 lines

blkpg

A Rust library to call Linux blkpg ioctls.

Note: only the BLKPG_RESIZE_PARTITION operation is implemented.

Example

use std::fs::File;
use std::io::Error;

use blkpg::resize_partition;

fn main() -> Result<(), Error> {
    let f = File::options()
        .read(true)
        .write(true)
        .open("/dev/nvme0n1")?;
    resize_partition(&f, 2, 456, 789, 512)?;
    Ok(())
}

lib.rs:

A library to call Linux blkpg ioctls.

Note: only the BLKPG_RESIZE_PARTITION operation is implemented.

Dependencies

~1.5–9.5MB
~111K SLoC