#StackBounty: #lvm #device-mapper #qnap What is /dev/mapper/cachedev1?

Bounty: 50

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 that I’m setting up as RAID 1 “storage pool”. Within that pool, I created a “thick volume”.

These naming conventions do seem a bit confusing. When the “storage pool” gets created, QNAP seems to immediately create a LVM thin pool (i.e. a volume) across all of the free space. Any “thick” or “thin” volumes are then created within that pool.

Here is the output of vgs and lvs right after the creation of the storage pool and one 250GB thick volume:

 # vgs
  VG   #PV #LV #SN Attr   VSize VFree
  vg1    1   3   0 wz--n- 1.81t    0

 # lvs
  LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv1   vg1  Vwi-aot--- 250.00g tp1         100.00
  lv544 vg1  -wi-------  18.54g
  tp1   vg1  twi-aot---   1.73t             14.13  0.03

After I created the volume, I tried to find out where it was mounted but neither mount nor df -h would show that lv1 was mounted. From the web interface, you could already interact with the shared folder in the lv, so clearly it had to be somewhere.

dmsetup ls --tree gives more info:

# dmsetup ls --tree
cachedev1 (252:8)
 └─vg1-lv1 (252:7)
    └─vg1-tp1-tpool (252:4)
       ├─vg1-tp1_tmeta (252:0)
       │  └─ (9:1)
       ├─vg1-tp1_tierdata_2 (252:3)
       │  └─vg1-tp1_tierdata_2_fcorig (252:6)
       │     └─ (9:1)
       ├─vg1-tp1_tierdata_1 (252:2)
       └─vg1-tp1_tierdata_0 (252:1)

So, there is a device called cachedev1 in /dev/mapper and it’s mounted on /share/CACHEDEV1_DATA. And within here, any “shared folders” will appear.

I don’t have the knowledge to make sense of this configuration. What is /dev/mapper/cachedev1 exactly? How did lv1 become part of it? And what is the benefit of using it over just mounting the LVM volume directly?

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.