microsoft / microsoft/WSL

Set kernel option CONFIG_UNICODE: cannot mount ext4 filesystem with casefold option

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

Description

### Windows Version

Microsoft Windows [Version 10.0.22621.1992]

### WSL Version

1.2.5.0

### Are you using WSL 1 or WSL 2?

- [X] WSL 2
- [ ] WSL 1

### Kernel Version

5.15.90.1-microsoft-standard-WSL2

### Distro Version

Ubuntu 22.04.3 LTS

### Other Software

_No response_

### Repro Steps

Trying such steps with filesystem to have `casefold` option effective:

1.
`$ dd if=/dev/zero of=~/image.raw bs=1 count=1 seek=$((2**24-1))`

2.

```
$ mkfs.ext4 -O casefold ~/image.raw
mke2fs 1.46.5 (30-Dec-2021)
Discarding device blocks: done
Creating filesystem with 4096 4k blocks and 4096 inodes

Allocating group tables: done
Writing inode tables: done
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done
```

3.

`sudo mkdir /mnt/loopfs`

4.

`$ sudo losetup /dev/loop0 ~/image.raw`

5.==> Error!

```
$ sudo mount -t ext4 /dev/loop0 /mnt/loopfs
mount: /mnt/loopfs: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
```

### Expected Behavior

If above step 2. instead done as such without `casefold` option involved:

`$ mkfs.ext4 ~/image.raw`

then other steps work just fine and have then final outcome like such:

```
$ df -kh /dev/loop0
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 11M 24K 9.9M 1% /mnt/loopfs
```

### Actual Behavior

Getting unexpected error on mount. Tried this approach via VirtualBox and same Ubuntu OS VM - works fine for casefold case, so looks like WSL specific bug.

### Diagnostic Logs

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by checking how CONFIG_UNICODE is set in the WSL 2 kernel used by 5.15.90.1-microsoft-standard-WSL2. Reproduce the report with the dd, mkfs.ext4 -O casefold, losetup, and mount commands on Ubuntu 22.04.3 LTS; done means the casefold ext4 image mounts successfully in WSL 2.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.