How do I mount a LVM partition using WSL2

Nicholas Outram 0 Reputation points
2023-03-29T10:55:11.55+00:00

Hi

I tried following the instructions on mounting Linux partitions using WSL2. This works for regularly partitioned disks.

What I cannot seem to work out is how to mount an unencrypted LVM partition using wsl2.

If I log into WSL, and activate the volume group, I can mount it manually and access the contents. However, from the Windows explorer, I browsed to this folder and it appeared empty.

Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
9,617 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 44,331 Reputation points
    2023-03-30T11:57:37.2166667+00:00

    Hello,

    in order to do the following steps

    there are some Prerequisites

    You will need to be on Windows 11 Build 22000 or later, or be running the Microsoft Store version of WSL.

    Identify the disk - To list the available disks in Windows, run:

    PowerShell

    Copy

    GET-CimInstance -query "SELECT * from Win32_DiskDrive"

    The disks paths are available under the 'DeviceID' columns. Usually under the \.\PHYSICALDRIVE* format.

    Mount the disk - Using PowerShell, you can mount the disk using the Disk path discovered above, run:

    PowerShell

    Copy

    wsl --mount <DiskPath>

    Mount the selected partitions

    Once you have identified the partitions you want to mount, run this command on each partition:

    PowerShell

    Copy

    wsl --mount <DiskPath> --partition <PartitionNumber> --type <Filesystem>

    https://learn.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

    And see if it helps,

    Thank you

    --If the reply is helpful, please Upvote and Accept as answer--

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.