site  contact  subhomenews

Revisiting device-mapper

March 05, 2018 — BarryK

I investigated device-mapper, for Quirky, back in 2016:

http://bkhome.org/news/201611/investigating-device-mapper.html

http://bkhome.org/news/201611/device-mapper-compiled.html

As Quirky does not have an initramfs (well, the live-CD does, but not the full installation), I was interested in the kernel patch created by Chrome OS developers, to setup device-mapper direct from the kernel commandline.

The problem is, it only seems to allow specifying devices by name, example "sda1" or by major:minor device node numbers. However, this is not satisfactory, as these assignments are subject to change. The above link contains a link to a post from me to the "linux-lvm" mail-list about this, but noone replied,

Note, that patch was v5, and and there is now a v8 (May 2017):

https://www.redhat.com/archives/linux-lvm/2017-May/msg00053.html

As the patch is not suitable, I need to run 'dmsetup' in an initramfs. My interest is to setup COW (Copy On Write), as a replacement for aufs/overlayfs layered filesystems.

First step, compiling kernel 4.14.24, with the drivers builtin:

Device Drivers --> Multiple devices driver support
    <*> Device mapper support (CONFIG_BLOCK_DEV_DM, was dm-mod.ko)
    <*> Crypt target support (CONFIG_DM_CRYPT, was dm-crypt.ko)
    <*> Snapshot target (CONFIG_DM_SNAPSHOT)
    [*] DM uevents (CONFIG_DM_UEVENT)
That last one is very interesting, will be able to use pup_event to pickup device-mapper changes. The crypt option is also very interesting.

Tags: easy, quirky