Git Product home page Git Product logo

libldm's Introduction

libldm is a tool and library for managing Microsoft Windows
Dynamic Disks.

Please send patches to [email protected] (you don't need
to subscribe).

WARNING!  Running the test suite (‘make check’) will run various
dmsetup commands as root using sudo.  Although this shouldn't
be unsafe, it's probably a good idea to only run the test suite
inside a virtual machine.

libldm's People

Contributors

deepans-clumio avatar hillu avatar liayan avatar mdbooth avatar rwmjones avatar stenavin avatar vincent-mailhol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

libldm's Issues

ldmtool cannot parse complexity volume

Hello,

I found bug in ldmtool.
ldmtool cannot parse complexity volume with next structure
image

In this case I get next log
ldmtool create all
[ 1.094006] raid6: sse2x1 gen() 10496 MB/s
[ 1.111058] raid6: sse2x1 xor() 8685 MB/s
[ 1.128036] raid6: sse2x2 gen() 14531 MB/s
[ 1.145004] raid6: sse2x2 xor() 10539 MB/s
[ 1.162037] raid6: sse2x4 gen() 16609 MB/s
[ 1.179006] raid6: sse2x4 xor() 10472 MB/s
[ 1.196064] raid6: avx2x1 gen() 22402 MB/s
[ 1.213005] raid6: avx2x1 xor() 17525 MB/s
[ 1.230032] raid6: avx2x2 gen() 28039 MB/s
[ 1.247005] raid6: avx2x2 xor() 19593 MB/s
[ 1.264035] raid6: avx2x4 gen() 30679 MB/s
[ 1.281050] raid6: avx2x4 xor() 20357 MB/s
[ 1.281558] raid6: using algorithm avx2x4 gen() 30679 MB/s
[ 1.282136] raid6: .... xor() 20357 MB/s, rmw enabled
[ 1.282697] raid6: using avx2x2 recovery algorithm
[ 1.283261] tsc: Refined TSC clocksource calibration: 3000.048 MHz
[ 1.284180] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x2b3e72cea23, max_idle_ns: 440795323402 ns
[ 1.289159] xor: automatically using best checksumming function avx
[ 1.291721] async_tx: api initialized (async)
[ 1.317100] device-mapper: raid: Loading target version 1.13.2
[ 1.318409] device-mapper: raid: Ignoring chunk size parameter for RAID 1
[ 1.319542] device-mapper: raid: Choosing default region size of 4MiB
[ 1.320236] device-mapper: table: 253:3: raid: Component device(s) too small
[ 1.320892] device-mapper: ioctl: error adding target to table
Unable to create volume Volume1 in disk group 83cd2cdf-a4d0-11e8-9c37-52540060c947: ldm_vol_DESKTOP-QIB64G9-Dg1_Volume1: Stacking NODE_DEL [verify_udev]
[
]

Thank you.

g_array_unref assertion failure in ldm_add_fd() function

ldmtool version 0.2.4-2

I'm getting a error when scanning a disk:

Unable to determine sector size of merged.flat. Assuming 512 byte sectors

(ldmtool:31287): GLib-CRITICAL **: g_array_unref: assertion 'array' failed
[
]

The gdb backtrace looks like this:

(gdb) where
#0  0x00007ffff72e8afb in g_logv () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#1  0x00007ffff72e8c6f in g_log () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007ffff72b546a in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007ffff7db2a59 in ldm_add_fd () from /usr/lib/x86_64-linux-gnu/libldm-1.0.so.0
#4  0x00007ffff7db32c0 in ldm_add () from /usr/lib/x86_64-linux-gnu/libldm-1.0.so.0

The full gdebug log looks like this right before the assertion

** (ldmtool:1440): DEBUG: Found new disk group: fcab980b-17ad-41be-90a9-a6d0ae5aabe3
** (ldmtool:1440): DEBUG: Disk: Disk13
  ID: 1228
  GUID: 0198020a-d073-44c8-9979-349b305c1a31
** (ldmtool:1440): DEBUG: Disk Group: sccl2_dept_vg
  ID: 1025
** (ldmtool:1440): DEBUG: Disk: Disk1
  ID: 1027
  GUID: 77f25415-db4b-4224-9f21-0f124cf62dff
** (ldmtool:1440): DEBUG: Disk: Disk12
  ID: 1211
  GUID: bf1cf0d2-b56d-4160-977e-fd75844ddcd9
** (ldmtool:1440): DEBUG: Disk: Disk15
  ID: 1262
  GUID: b0eb6ec0-b88b-448b-bcc2-ff4d6dabfdc2
** (ldmtool:1440): DEBUG: Disk: Disk16
  ID: 1275
  GUID: 5e4c6331-3293-4bda-a202-0ba0e6e12e50
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1141293069631488
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk14
  ID: 1237
  GUID: c53e77f6-a781-42d0-925c-860fd2264ea4
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 5231270166528
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk2
  ID: 1043
  GUID: 7b3a0526-7b6b-478c-922a-e73187fe8e5b
** (ldmtool:1440): DEBUG: Disk: Disk3
  ID: 1045
  GUID: 84fddb45-24c1-475d-af57-a0e98da93214
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 5299989643264
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk7
  ID: 1069
  GUID: 9ff58b79-2fab-4144-aa93-7b29e9ee7846
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1183074511486976
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk10
  ID: 1106
  GUID: f4e75190-bc9a-4098-b854-55665761db31
** (ldmtool:1440): DEBUG: Disk: Disk8
  ID: 1079
  GUID: 82b9abef-f29e-4a41-a525-9f5afc8d9b47
** (ldmtool:1440): DEBUG: Disk: Disk4
  ID: 1047
  GUID: 3a40ec7b-6508-470b-9c22-c3866095ca3f
** (ldmtool:1440): DEBUG: Disk: Disk5
  ID: 1049
  GUID: 25f4a3ec-65d8-4f19-91ad-03a0207f6b5d
** (ldmtool:1440): DEBUG: Disk: Disk6
  ID: 1051
  GUID: b483aab1-df11-44f9-b258-5a6525cd3984
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1172079395209216
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1172079395209216
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1172079395209216
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1172079395209216
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1172079395209216
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk9
  ID: 1081
  GUID: 493b383d-beb9-4438-a6e5-8672bbf38d3a
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1198467674275840
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 1198467674275840
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 4776003633152
  Size: 0
** (ldmtool:1440): DEBUG: Disk: Disk11
  ID: 1198
  GUID: 5ff82640-2ab3-44e0-bd7a-35021fd1f8ab
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 5175435591680
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 5342939316224
  Size: 0
** (ldmtool:1440): DEBUG: Partition: \u0002
  ID: 0
  Parent ID: 0
  Disk ID: 0
  Index: 0
  Start: 0
  Vol Offset: 5450313498624
  Size: 0

(ldmtool:1440): GLib-CRITICAL **: g_array_unref: assertion 'array' failed

systemd unit

Would you consider adding a simple systemd unit, e.g.:

[Unit]
Description=Activate Windows Logical Disk Manager volumes
Documentation=man:ldmtool(1)

[Service]
ExecStart=/usr/bin/ldmtool create all
ExecStop=/usr/bin/ldmtool remove all
Type=oneshot
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

This would allow adding LDM mounts to fstab, e.g.:

/dev/mapper/ldm_vol_LOCALHOST-Dg0_Volume1 /mnt/windata ntfs defaults,rw,x-systemd.requires=ldm.service 0 0

Unable to mount multiple volumes with the same UUID

We use ldmtool to mount LDM volumes from VM disk images. Sometimes, we need to mount multiple LDM volumes with the same UUID. This can happen when we mount multiple snapshots of a VM, or when we are mounting multiple VMs cloned from the same template.

Up till 0.2.4, devices were found using the name instead of UUID. So we were able to deduplicate the devices by renaming them after creation. In 0.2.5, there was a commit which changed to using UUID to find devices: 45a47d7. This poses a problem for us since device mapper does not let us change the UUID once it is set: https://man7.org/linux/man-pages/man8/dmsetup.8.html.

Some solutions that come to mind are:

  1. option to switch back to finding devices by name
  2. option to specify UUID to set during device creation
  3. option to leave UUID unset so the caller can set it later

What are your thoughts on this?

ldmtool scan -> TOCBLOCK not found on 4k native dynamic disk stripe set

Hi there,

Edit: Sorry, this is on a fresh Debian sid installation, ldm version 0.2.5-1....

hopefully this is not a completely trivial user error on my side as to not to waste your time.

I have a dynamic disk stripe set which is freshly created in Windows 10 (22H2 / build 19045.xxxx) via the Disk Management MMC Snap-in. Disk layout is GPT. The disks are formatted as NTFS with default allocation unit size, if that matters. Although I tried leaving the array unformatted and it would result in the same issue.

Hardware wise the disks are two identical Seagate Exos E - 7E8, 4Kn (ST6000NM0125) models with 4KB native logical sector size. So no 512K emulation! These are relatively rare in use so maybe it plays a role here?!

When trying to scan for the set ldm provides following quite descriptive error message followed by an empty array (?!) marker '[]':

ldm> scan /dev/sdb
Error scanning /dev/sdb: Didn't find TOCBLOCK at config offset 400
[]
ldm> scan /dev/sdc
Error scanning /dev/sdc: Didn't find TOCBLOCK at config offset 400
[]

My uneducated guess/fear is that it could have to do with the 4K native logical sectors because that is the only "special" thing about these disks that comes into my mind at least.

I'd be happy to provide any more info that would be needed to clarify the issue's cause if deemed worthy of investigating.
Attached are the terminal output of lsblk (-t) and the output as well as the partitioning visualized in GParted.

Thank you in advance for any hint where to go from here.

screen1
screen2
screen3

new release?

0.2.4 was tagged almost 3 years ago. There have been 19 commits since then. Judging by the commit logs, there were some significant fixes. Could you make a new release?

is it possible to access a dynamic disk on the same physical disk as the root partition?

i have a dynamic disk next to my root partition and ldmtool fails to create a device-mapper device for it because the root partition is obviously mounted and device-mapper complains that the device is busy. i've tried the same thing from a livecd and everything works fine.

Device          Start        End    Sectors   Size Type
/dev/sda1        2048  195354564  195352517  93.2G Linux filesystem
/dev/sda2   195354565 1953523086 1758168522 838.4G Microsoft LDM data
/dev/sda3  1953523087 1953525134       2048     1M Microsoft LDM metadata
$ sudo ldmtool create all
Unable to create volume Volume1 in disk group 51bd3060-8f2f-11ed-8b65-00d86154d8d8: ldm_vol_WORKSTATION-Dg0_Volume1: Stacking NODE_DEL [verify_udev]
[]
[ 1263.805769] device-mapper: table: 254:0: linear: Device lookup failed (-EBUSY)
[ 1263.805778] device-mapper: ioctl: error adding target to table

UUID

I use RHEL 7
When i do ./autogen.sh
I get error:configure: error: Package requirements (uuid >= 2.21.0) were not met:
No package 'uuid' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

I installed every uuid library on RHEL in the repo.

Incompatible libdevmapper

Hey, I can't mount my dynamic disk. I thought downgrading but I can't coz dev-mapper is dependency of many core packages. Anyways getting this error:

dm_task_create(DM_DEVICE_CREATE) failed: Incompatible libdevmapper 1.02.175 (2021-01-08) and kernel driver (unknown version).

Also bunch of these but seems unrelated:

GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone's code. You must ensure an error is NULL before it's set.

OS: ArcoLinux x86_64
Kernel: 5.10.14-arch1-1

Thanks in advance!

ldmtool causes kernel trace on shutdown

When running ldmtool create all and then shutting the system down, a trace is printed. The trace is only visible for a fraction of a second, video and picture of the trace can be found here:

Even when running ldmtool remove all before shutting down, the trace is printed.
The warning that is printed is __dma_async_device_channel_unregister called while 2 clients hold a reference, the trace is:

<TASK>
dma_async_device_unregister
ccp_dmaengine_unregister
ccp5_destroy
sp_destroy
pci_device_shutdown
kernel_power_off
__do_sys_reboot
do_syscall
? do_syscall_64
? __s64_sys_rt_sigprocmask
entry_SYSCALL_64_after_hwframe

I encountered this issue with linux 5.15.10, 5.16.1 and 5.16.2. I haven't tested any other version of the kernel.
I'm running Arch Linux, the downstream bug report can be found here: https://bugs.archlinux.org/task/73504

Hardware:
AMD Ryzen 7 2700X
Gigabyte X570 AORUS ELITE Mainboard, F36e firmware

If there's any additional information I can provide, please let me know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.