Merge ~mwhudson/curtin:quick_zero-wipefs into curtin:master

Proposed by Michael Hudson-Doyle
Status: Merged
Approved by: Dan Bungert
Approved revision: 42fd0ba2e375911d521cbb7adc8abbf5c5200ae5
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~mwhudson/curtin:quick_zero-wipefs
Merge into: curtin:master
Diff against target: 17 lines (+2/-1)
1 file modified
curtin/block/__init__.py (+2/-1)
Reviewer Review Type Date Requested Status
Dan Bungert Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+433621@code.launchpad.net

Commit message

call wipefs -a -f in addition to zeroing in quick_zero

LP: #1997920

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Bungert (dbungert) wrote :

Thanks! Wipefs is probably better than some sort of block-zero arms race with wherever future tools decide to put information.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py
2index a46c8ec..1f9bb60 100644
3--- a/curtin/block/__init__.py
4+++ b/curtin/block/__init__.py
5@@ -1207,10 +1207,11 @@ def wipe_file(path, reader=None, buflen=4 * 1024 * 1024, exclusive=True):
6
7 def quick_zero(path, partitions=True, exclusive=True):
8 """
9- zero 1M at front, 1M at end, and 1M at front
10+ call wipefs -a -f on path, then zero 1M at front, 1M at end
11 if this is a block device and partitions is true, then
12 zero 1M at front and end of each partition.
13 """
14+ util.subp(['wipefs', '--all', '--force', path])
15 buflen = 1024
16 count = 1024
17 zero_size = buflen * count

Subscribers

People subscribed via source and target branches