[dm-devel] device mapper mapping across reboot

Zdenek Kabelac zkabelac at redhat.com
Mon Mar 12 14:41:48 UTC 2018


Dne 12.3.2018 v 12:09 Jitendra napsal(a):
> On Mon, Mar 12, 2018 at 10:49:02AM +0100, Zdenek Kabelac wrote:
>> Dne 10.3.2018 v 11:47 Jitendra napsal(a):
>>>
> 
>> Once kernel is booted and 'ramdisk' is processed - you have plenty of
>> time and lots of binaries there (typically with lvm2 built-in)  - so
>> here you can safely activate your root volume being on dm device (even
>> without lvm2 just by issuing couple 'dmsetup' commands)
> 
> This is something which I have tried in following steps.
> 
> 1. First load my target driver(eg. my_custom_target) in initramfs (RHEL 7) 
> using dracuf.
> 2. Now  my_custom_target will be available when initramfs get loaded.
> 3. Before the switch_root, I tried to run following command as,
> 
>      [root at localhost ~]# ls -l /usr/lib/systemd/system/initrd-switch-root.service
>      -rw-r--r--. 1 root root 737 Mar 12 07:00 
> /usr/lib/systemd/system/initrd-switch-root.service
> 

I'm not quite sure why do you ever need to play with any systemd service s

Is there lost support for some kind of /etc/rc.local ?

Of course you have to use UUID on your devices - and shift filesystems on your 
real /dev/sdaX  so  systemd  WAIT for devices that will appear in your system 
only via  'DM' mapping (so your rootfs on sdX needs to be prefixed with some 
header).

You cannot have in your system 2 'same' devices' - that will confuse your 
systemd.

Solving complexity of systemd world is where lvm2 is there for. So if you plan 
to 'recreate' simpler lvm2 just because you don't want to use lvm2 - it's 
going to be hard task...

> In my target driver, I am tracking each and every I/O and looking for offset and
> length in each bio and doing some logging stuff.

Btw - isn't  dmstats  good enough for that already? You can split every device 
in your system in regions and get very detailed start about that.

For using dmstats - you can directly use LVs and attach dmstats to them - so 
you don't have to recreate this machinery yourself...

Regards

Zdenek




More information about the dm-devel mailing list