mount-disk
筆記下我手上的 Ubuntu 安裝碟,再 Windows 11 WSL 2 中的掛載方式。
Windows 11 WSL 2 中掛載 Ubuntu 安裝碟
1. 識別磁碟
GET-CimInstance -query "SELECT * from Win32_DiskDrive"

下面如果有問題可以到磁碟管理將該磁碟先離線

2. 掛載磁碟
wsl --mount \\.\PHYSICALDRIVE1 --bare

3. 進入 WSL 2
lsblk

4. 識別格式
sudo blkid

記錄下 ext4 的 ID = 4
5. 卸離磁碟
wsl --unmount \\.\PHYSICALDRIVE1

6. 重新掛載磁碟
將 ext4 的 ID = 4 帶入
wsl --mount \\.\PHYSICALDRIVE1 --partition 4

磁碟已成功裝載為 '/mnt/wsl/PHYSICALDRIVE1p4'。
7. 進入磁碟
cd /mnt/wsl/PHYSICALDRIVE1p4
8. 離開 WSL 2
exit
9. 卸離磁碟
wsl --unmount \\.\PHYSICALDRIVE1
REF
Last modified: 06 May 2024