microsoft / microsoft/WSL

WSL2 - SSD mounted as bare disks do not expose TRIM

Open
#9,123 14 comments 10 reactions 0 assignees View on GitHub
feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

### Version

Microsoft Windows [Version 10.0.22621.674]

### WSL Version

- [X] WSL 2
- [ ] WSL 1

### Kernel Version

5.15.68.1

### Distro Version

Ubuntu 22.04

### Other Software

_No response_

### Repro Steps

- Mount bare ssd disk which support TRIM command.
- lsblk -D

### Expected Behavior

lsblk -D reports DISC-MAX >0B for mounted disk, which means TRIM is supported.

### Actual Behavior

lsblk -D reports DISC-MAX as 0B for mounted disk, which means TRIM is not supported.

Using SSD disks without trim reduces it's lifespan, performance and reliability.

### Diagnostic Logs

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue in WSL 2 with a bare SSD and run `lsblk -D` as described. Trace the WSL2 block-device mount handling and compare the reported DISC-MAX value; done means a TRIM-capable mounted disk reports DISC-MAX greater than 0B.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux, ubuntu
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.