NAS-139069 Wipe disk writes ASCII 0 instead of bytes 0#17898
Open
ryd994 wants to merge 1 commit intotruenas:masterfrom
Open
NAS-139069 Wipe disk writes ASCII 0 instead of bytes 0#17898ryd994 wants to merge 1 commit intotruenas:masterfrom
ryd994 wants to merge 1 commit intotruenas:masterfrom
Conversation
Author
themylogin
approved these changes
Jan 7, 2026
Contributor
themylogin
left a comment
There was a problem hiding this comment.
@yocalebo I think we should merge this :)
Author
|
@themylogin Sorry for not knowing the right procedure. This is the first time I contributing to truenas. What can I do to help this PR merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In TrueNAS Scale, wipe the disk using Storage -> Disks -> Wipe -> Quick or Full with zeros. After that, the disk is expected to be wiped with null bytes (numeric value of 0).
However, the disk is filled by 0x30 instead of 0x0:
0x30 is ASCII character '0'.
While ASCII character '0' also serves the purpose of destroying the data on disk, it does not match the description in UI and the typical expectation.
The problem is at
middleware/src/middlewared/middlewared/plugins/disk_/wipe.py
Line 78 in 6c6e2c2
It should use
b'\0'instead ofb'0'A similar bug exists when expanding partition:
middleware/src/middlewared/middlewared/plugins/disk_/wipe.py
Line 78 in 6c6e2c2