Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [device-mapper]

The device mapper is a block layer component which allows the creation of virtual block devices. LVM2 is based on it.

13
votes
1answer
2k views

Why are there two different values for the size of a drive and how to reconcile them with device-mapper and LVM?

I have a 1 TB drive attached via USB. It contains an LVM physical volume filling the entire device (without any partition table). When I tried to extend a logical volume by using the entire PV, the ...
6
votes
2answers
2k views

remap read-only LUKS partition to read-write

cryptsetup can be invoked with --readonly or -r option, which will set up a read-only mapping: cryptsetup --readonly luksOpen /dev/sdb1 sdb1 Once I have opened a device as read-only, can I later re-...
6
votes
1answer
5k views

GNU/Linux: “device mapper: create ioctl failed” “device or resource busy”

I can't mount my encrypted devices anymore. The error is: device mapper: create ioctl failed device or resource busy This error arises both with two different programs to access TrueCrypt ...
5
votes
1answer
2k views

What does `cryptsetup resize` do if LUKS doesn't store partition size?

The LUKS / dm-crypt / cryptsetup FAQ page says: 2.15 Can I resize a dm-crypt or LUKS partition? Yes, you can, as neither dm-crypt nor LUKS stores partition size. I'm befuzzled: What is "...
5
votes
1answer
223 views

How do I temporarily extract a flash drive or HDD in Linux?

Suppose I mounted a disk in this way: mount /dev/sdb /mnt/tmp I have some files opened on this filesystem and don't want to unmount it. However I want to temporarily extract the device, then ...
4
votes
3answers
21k views

list the devices associated with logical volumes without using lvm2 package commands

I want to list all the physical volume associated with logical volume. I know lvdisplay, pvscan, pvdisplay -m could do the job. but I don't want to use these commands. Is there any other way to do it ...
4
votes
2answers
11k views

device mapper on RHEL6 unable to create devs for LVM logical volume

I have XEN guest running RHEL6, and it has a LUN presented from the Dom0. This contains an LVM volume groups called vg_ALHINT (INT for Integration and ALH is an abbreviation of its Oracle database ...
4
votes
2answers
5k views

What's the difference between lvmcache and dm-cache?

Recently I found article mentioning that recently dm-cache significantly improved in linux. I also found that in userspace you see it as lvmcache. And it's quite confusing for me. I thought that LVM ...
4
votes
1answer
2k views

Cannot mount LVMm: resume ioctl on failed

I wanted to resize my LVM, followed some tutorial on the net and the system totally crashed (I got some boot error with UUID not found). I ran a LiveCD and tried to at least recover some files but I ...
4
votes
1answer
333 views

dmsetup: Where is persistent metadata stored?

The dmsetup snapshot documentation says: <persistent?> is P (Persistent) or N (Not persistent - will not survive after reboot). O (Overflow) can be added as a persistent store option to allow ...
4
votes
1answer
417 views

Get target device by /dev/dm-X entry

I have to map several loopback devices via dmsetup. I could track which loopback device is mapped to a particular /dev/dm-X device file, but is there an easy way to get this info by the /dev/dm-X ...
4
votes
0answers
2k views

Mounting squashfs image with read-write overlay for rootfs

I am trying to update a custom initramfs init script to mount a squashfs image as the root file system. I have been testing the mounting of a squash image to a loop device in read only, mounting ...
4
votes
0answers
329 views

How to cache block devices (for device mapper)?

problem / observed effect It seems that the page cache ignores block devices which are not opened. And worse: Reads from device mapper (DM) devices which use a cached device are not cached at all (...
4
votes
0answers
2k views

docker run always fails with “no such file or directory”

Every time that I try to run a container with docker I get the following error: # docker run hello-world Error response from daemon: Cannot start container ...
3
votes
3answers
3k views

Device mapper table alignment inconsistency

In the journal, I'm getting lines such as: Jan 27 18:23:08 tara kernel: device-mapper: table: 254:2: adding target device sdb2 caused an alignment inconsistency: physical_block_size=4096, ...
3
votes
1answer
128 views

Can I tell whether a block device is in use?

Let's assume this is based on device-mapper. How can I tell if a given block device is already in use? (For example, a PV of a currently in use VG, or a encrypted LUKS device that is currently ...
3
votes
0answers
97 views

Is there a way for a device mapper target to limit the rate at which i/o is sent to it?

I am writing a device mapper target and am having a issue. While running an i/o test, the number of i/o inflight to my target gets very high, presumably from the filesystem paging out the cache. At ...
3
votes
0answers
381 views

Documentation on Device Mapper ioctls?

In the Red Hat documentation on Device Mapper, it reads: "the application interface to the Device Mapper is the ioctl system call." So far, I understand that the ioctls are sent to /dev/mapper/...
3
votes
0answers
220 views

Clone dmsetup configuration of a disk - not the data?

Is there a way to clone the dmsetup configuration of a disk onto another disk and recreate the filesystems and mount points ? I do not need to copy the data of the file systems, only the configuration....
3
votes
1answer
566 views

RAID-1 mirror has become a single hard disk

I have an HP N40L microserver, with 2 identical drives, I used the system to hardware-RAID them as a mirror. I then installed mint on the system about a year ago. This has been running perfectly, ...
3
votes
0answers
150 views

Device mapper target to “change” sector size?

I'm wondering if there exists a device mapper target that I can use to make a device appear to have a different sector size. For example, let's say I set the "virtual" sector size to 448; then, every ...
2
votes
1answer
412 views

How to make device mappings stay after reboot?

I notice that if a device mapping is created with the low-level dmsetup or through ioctls, the device mapping will no longer be there after reboot. Is this normal? I am using a USB to test out ...
2
votes
1answer
51 views

“Delete on write” with devicemapper and Docker

The current default behavior of Docker is COW (copy on write), aka allocate on write. This relies on free space in a drive in order to write to disk. In contrast - with memory, unreferenced files are ...
2
votes
2answers
2k views

How can I tell if a encrypted (LUKS) device is already open?

Is there a way to tell, given a path to a LUKS block device, and not knowing the passphrase, whether the device is already open (decrypted)? What about knowing the path to the decrypted device?
2
votes
1answer
707 views

veritysetup verify successful but mount fails after upgrade to new kernel

We are using dm-verity for a squashfs root file system. Using kernel 4.8.4 everything was ok, after upgrading to kernel 4.14.14 mount fails, even though the veritysetup verify command validates the ...
2
votes
2answers
368 views

LVM volume on USB drive fails: Read-only file system

This is on a Raspberry Pi running Raspbian 8 (Linux kernel 4.9.) I have a 64 GB USB pen drive plugged (as /dev/sda) and configured as an LVM physical volume. There's only one volume group ("data") and ...
2
votes
0answers
472 views

Create a block device made of files

TL;DR: Given 2TB worth of 4MB files, how would I create a block device with those files as backing storage? Background I want to trial use of Sia for storage, since: Storing 1TB on Sia costs ...
2
votes
0answers
513 views

create a device-mapper snapshot of an lvm volume multiple linear device with cow data outside of volume group

I need to make an in-memory snapshot of a running mounted root filesystem. The filesystem itself is on an lvm device, but there is zero free space in the VG and there is no way to expand it. However ...
2
votes
0answers
65 views

recover last state of full lvm snapshot

I recently ran into the case that an LVM snapshot overflowed. The reasons are unclear: * there was probably no write access to the origin at all * both snapshot and origin have same size (100g, 25600 ...
2
votes
2answers
444 views

Why there are many mapper volumes created in my Suse Linux installation

Recently I installed Suse Linux and Sled. After the installation, I found out that more memory is allocated for mappers; I don't know what is the use of these things. Will they be used once the main ...
2
votes
0answers
49 views

software-level error detection and correction for raw storage

If I understand data storage correctly, all storage devices are unreliable to some extent, which is why most have hardware-level abstraction layers. Hard drives use error correction. If a sector is ...
2
votes
0answers
446 views

About dev mapping of partitions

New Linux user. Today had bright idea of making a backup of two partitions on an sd card to another sd card already in use. Did this: shrunk partition on backup sd, thus creating unallocated space, ...
1
vote
1answer
158 views

What is /dev/mapper/cachedev1?

I just got my first QNAP NAS, used to work mostly with Synology before, and I'm currently trying to figure out how the system uses LVM. Mostly out of curiosity. In my specific case, it's a 2 bay NAS ...
1
vote
1answer
296 views

Does lvm-thin use dm-thin underneath or they are completely separate utilities?

LVM snapshots seem to have extremely poor performance It seems that dm-thin snapshots use a new implementation: Another significant feature is support for an arbitrary depth of recursive ...
1
vote
1answer
849 views

How to configure device mapper name of encrypted root partition with Grub2?

I would like to have my encrypted root partition mapped to the device mapper name system, i.e. it should eventually appear under /dev/mapper/system. My operating system is Fedora 24 Workstation Linux ...
1
vote
1answer
1k views

Using Device mapper thin provisioning on loop devices

I have several KVM raw files that are read only (about 100gb). I am adding these raw files as loopback devices. I then create a snap file to allow the VM to have read/write access to its disk. This ...
1
vote
1answer
475 views

How to handle (with LVM or DM (device mapper)) when a drive has gone away and come back as a new block device

(This correct answer is to one that bears little surface resemblance to this one. Asking the question and answering it myself with reference to that one.) Consider a virtual host environment in which ...
1
vote
1answer
757 views

Can we create lvm volume group with mapped device?

I can create a lvm volume group with a loop device. But if I use dmsetup to map the loop device into several devices, then I can't create a lvm group with /dev/dm-. Why is it not possible to create ...
1
vote
0answers
24 views

dd command is initiating bios with read direction in device-mapper target

I setup a block level device-mapper target, and when I am writing to it using the following dd command: dd if=/dev/zero of=/dev/mapper/mytarget bs=4096 count=5 I have observed that there are a lot ...
1
vote
0answers
60 views

How can I xor two block devices together?

I'm looking for a way to create a virtual block device that when accessed returns the XOR of two block devices. I feel like dmsetup would be used here somewhere but I can't find anything related to ...
1
vote
1answer
82 views

Is Block device aware of the actual user/process which initiates read/write?

The VFS knows which user/process has sent read/write request. Is the actual block device aware of these details. Does 'bio' struct contain any details which point to the user space parameters? Using ...
1
vote
1answer
462 views

After increasing chunksize in an LVM cache, files are no longer promoted to the cache

After running into issues with running out of kernel memory, I increased the chunksize of my lvmcache from the default (which I believe was 64k) to a much higher 8M. After this change, blocks do not ...
1
vote
0answers
504 views

kpartx doesn't create block device

I am trying to create some block devices with losetup and kpartx as follow: #losetup --show -f disk.img /dev/loop0 #kpartx -avs /dev/loop0 # so nothing happend, and kpartx -l gives nothing as well: ...
1
vote
0answers
332 views

What prevents a dm-verity mapping from being reset?

On Chrome OS and Android, dm-verity is used to verify the system partition. In Chrome OS, since there is no initial RAM disk, the mapping and the root digest are provided on the kernel command line ...
1
vote
1answer
3k views

device-mapper: reload ioctl on cache1 failed: Device or resource busy

When I run the below command while setting up dm-cache on my CentOS system, I receive the error: device-mapper: reload ioctl on cache1 failed: Device or resource busy Command failed Command is: ...
1
vote
0answers
35 views

Which is the correct dm-cache version

I am trying to install dm-cache on my CentOS machine. Which dm-cache version should I use. I read on wikipedia as below: Another dm-cache project with similar goals was announced by Eric Van ...
1
vote
0answers
195 views

device-mapper error while setup of dm-cache

I am trying to setup dmcache using the tutorial https://wiki.mikejung.biz/Dmcache When I run the command `dmsetup create home-cached --table '0 976771120 cache /dev/mapper/ssd-metadata /dev/mapper/...
1
vote
2answers
629 views

Why does dm-verity use a salt?

In dm-verity, there is a root hash that is used to verify a data storage device. It is created when you run veritysetup. But in addition to the root hash, a salt is also given. Why?
1
vote
1answer
470 views

device-mapper linear documentation parameters

Here is the documentation for using device-mapper linear: https://www.kernel.org/doc/Documentation/device-mapper/linear.txt I am trying to understand this documentation. It says it takes 2 parameters:...
1
vote
0answers
380 views

Mount success but property of device mapper that dmsetup create is lost

I tried to create device mapper with dmsetup as followed: dmsetup create error_disk 0 20000 linear /dev/loop0 0 20000 1 error 20001 20959 linear /dev/loop0 20001 Then I check with command below: dd ...