Closed zouherenjie closed 2 years ago
@zouherenjie those are temporary mounts, won't survive reboots, indeed. Make your mount permanent by adding the partition(s) to /etc/fstab
. Here's a link with more information: https://devblogs.microsoft.com/commandline/automatically-configuring-wsl/
it's a feature, I'm using bat file to launch wsl instance in windows terminal with mounted vhd disk, the advantage of this approach is that I can run wsl with different mounted disks
wt.exe -p "Name_of_wsl_profile_in_windows_terminal"
wsl --mount ...
@elsaco @RobertSpir Does this mean I still have to mount the disk to WSL2 manually before I start WSL2?
But /dev/sde
or /dev/sdf
when I use Docker Desktop. It's hard to control the boot priority. Any solutions?
maybe use timeout /t 10 command in-between the launch and mount commands to wait, so the extra disk will be mounted later
Version
10.0.22000.613
WSL Version
Kernel Version
Linux version 5.10.102.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Wed Mar 2 00:30:59 UTC 2022
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
I mount my disk as follows, and it worked well as long as I don't restart WSL2. Did I do something wrong?
mkfs.ext4 /dev/sdf
Expected Behavior
The disk should be mounted as same as I
Actual Behavior
Everytime I restart WSL2, I cannot find my disk in WSL2 with cmds like
lsblk
blkid
fdisk -l
dmesg.txtDiagnostic Logs
No response