Windows dynamic volumes


I have combined several drives under Windows into a large “dynamic drive”. To be able to access it under Linux, the package “ldmtool” must be installed first:

sudo apt install -y ldmtool

Next, a service must be created for it:

sudo bash -c "cat > /etc/systemd/system/ldmtool.service" <<'EOF'

[Unit] 
Description=Logical Disk Manager
Before=local-fs-pre.target
DefaultDependencies=no

[Service]
Type=forking
User=root
ExecStart=/usr/bin/ldmtool create all

[Install]
WantedBy=multi-user.target
EOF

Then, this service needs to be activated:

sudo systemctl daemon-reload
sudo systemctl enable --now ldmtool.service

You can then find the label of the drive with:

lsblk | grep ldm_vol

In my case this is e.g. ldm_vol_RECHNERNAME-Dg0_Volume1

To mount the drive, use the following service:

sudo bash -c "cat > /etc/systemd/system/media-ldm.mount" <<'EOF'
[Unit]
Description=Mount local drive "ldm" (/media/ldm)
After=ldmtool.service

[Mount]
What=/dev/mapper/<LAUFWERKSBEZEICHNUNG>
Where=/media/ldm
Type=ntfs
Options=defaults,rw,fmask=133,dmask=022,noatime,uid=1000,gid=1000
TimeoutSec=60

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable --now media-ldm.mount

Sources: