Skip to content

Commit

Permalink
Add SAS protocol support to disk wipe (#117)
Browse files Browse the repository at this point in the history
- Added support for SAS drives in the wipe logic.  
- Grouped `sata` and `sas` cases to handle capabilities (`sanitize`,
`esee`) and select the appropriate wipe method.
- Fallback to zero-filling for SAS and SATA drives if no methods
detected.

### Testing  
- Verified SAS capabilities detection and fallback logic.
  • Loading branch information
turegano-equinix authored Jan 24, 2025
2 parents 3fe2508 + 0147ea9 commit 0b42950
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/disk_wipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func init() {
switch drive.Protocol {
case "nvme":
wiper = utils.NewNvmeCmd(verbose)
case "sata":
case "sata", "sas":
// Lets figure out the drive capabilities in an easier format
var sanitize bool
var esee bool
Expand All @@ -102,6 +102,9 @@ func init() {
case trim:
// Drive supports TRIM, so we use blkdiscard
wiper = utils.NewBlkdiscardCmd(verbose)
default:
// Drive does not support any preferred wipe method so we fall back to filling it up with zeros
wiper = utils.NewFillZeroCmd(verbose)
}
}

Expand Down

0 comments on commit 0b42950

Please sign in to comment.