This draft comes from a practical note I wrote while working with a physical disk through WSL 2. It is the kind of task that is easy to forget if you do it only occasionally, so I wanted to keep a clean version of the steps in one place.
The goal here was simple: identify the correct disk from Windows, attach it to WSL 2, verify it from Linux, wipe it safely, and then detach it again.
Why I Wrote This Down
When working across Windows and Linux, disk operations can feel more awkward than they should. The commands are not complicated, but the main risk is targeting the wrong device.
That makes this kind of note valuable: not because the commands are fancy, but because the sequence matters.
1. Identify the Disk in PowerShell
Start in an elevated PowerShell session and list the physical disks:
| |
Example output:
| |
Once I identified the correct device, I attached it to WSL 2 in raw mode:
| |
If the disk is unpartitioned or you are attaching it more generically, the pattern is the same:
| |
2. Verify the Disk from WSL 2
Inside WSL, I checked the block devices before doing anything destructive:
| |
One important modern WSL detail: this note was written around the block-device workflow, which is why lsblk is still the first thing I check. In current Microsoft WSL documentation, disks mounted with wsl --mount are accessed under the path controlled by automount.root, whose default is /mnt/wsl, while Windows fixed drives are auto-mounted separately under /mnt/<drive-letter> by default. If you use --bare, the disk is only attached as a block device until you mount it yourself.
Example output:
| |
This is the point where I slow down and confirm the target one more time. On storage work, caution is more important than speed.
3. Wipe the Disk
To zero or securely overwrite the target disk from Linux, I used shred:
| |
What that does:
-vshows progress-zwrites a final pass of zeros-n 1performs one overwrite pass before the zeroing pass
Depending on what you actually need, you may prefer a filesystem-level format, a partition table reset, or a full wipe. In my case, this note was specifically about wiping the disk from WSL 2.
4. Unmount the Disk
Once the operation was done, I detached the disk back from PowerShell:
| |
That step is easy to overlook, but it is part of closing the workflow cleanly.
Practical Notes
- Always double-check the physical drive number before attaching it.
- Always verify the corresponding Linux block device with
lsblkbefore running destructive commands. - If you only need to repartition or reformat, a full
shredmay be more than necessary. - If the disk contains anything important, stop before wiping and confirm your target again.
Closing Thought
This is not a glamorous task, but it is exactly the kind of small systems note that saves time later. When you work across Windows and Linux regularly, having a short, trusted sequence for storage operations is worth keeping.