BtrFS and Device Mapper (DM)
Dude!Oct 6 2012 — edited Oct 8 2012Hello,
I learned from a previous thread here that BtrFS should not be put on a LVM volume as both provide similar technologies that compete with each other. What about Device Mapper (DM) and BtrFS under Oracle Linux 6.3? I guess both share similar technologies as well, like Snapshot. Albeit DM is probably less sophisticated. However, I was wondering whether BtrFS and Device Mapper should be used together.
According to https://www.suse.com/documentation/sles11/singlehtml/stor_admin/stor_admin.html. +"You can create BtrFS on Multiple Devices (MD) and Device Mapper (DM) storage configurations by using the YaST2 Partitioner."+ So this tells me that DM and BtrFS can be used together. And I guess one example might be disk encryption using cryptsetup, which uses device mapper. Is this correct?
If I'm not mistaken, then Device Mapper support is in the Linux 2.6 kernel, and /dev/mapper devices are typcially setup by LVM and cryptsetup, but I can also create them using dmsetup. Let's say I have e.g. /dev/sda2 and I want to map it to a DM virtual device named root, then initialize it using BtrFS:
<pre>
dmsetup create root table "0 $(blockdev getsz /dev/sda2) linear /dev/sda2 0"
mkfs.btrfs /dev/mapper/root
</pre>
The command works, but I might doing something wrong, because /dev/mapper/root does not survive a system restart. Unfortunately I have not found anything useful about it in Google yet. Anyway, does this make any sense?
Thanks!