Skip to content

shred: detected block size differs from GNU #7870

Closed
@BenWiederhake

Description

@BenWiederhake

uutils du uses a different block size than GNU du, which leads to files of different sizes:

$ echo a > foo && shred -v -n1 foo && du -b foo
shred: foo: pass 1/1 (random)...
4096	foo
$ echo a > foo && cargo run -q --features shred shred -v -n1 foo && du -b foo
shred: foo: pass 1/1 (random)...
65536	foo

I'm not convinced that this is fine, but there's a good chance. If you, dear reader, know for certain that this is fine, please add a paragraph to https://uutils.github.io/coreutils/docs/extensions.html#shred .

Found while trying to solve #5711.

EDIT: Also, this comment (and perhaps code) in shred.rs needs to be updated:

// This block size seems to match GNU (2^16 = 65536)
const BLOCK_SIZE: usize = 1 << 16;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions