Not a fan of device mapper in Linux
By joe
- 2 minutes read - 235 wordsYeah, I know. It brings all manner of capabilities with it. Its just the cost of these capabilities, when combined with other tools, like, say, Docker, that make me not want to use it. To wit:
root@ucp-01:~# ls -alF /var/lib/docker/devicemapper/devicemapper/
total 52508
drwx------ 2 root root 80 Jan 29 22:38 ./
drwx------ 4 root root 80 Jan 29 22:38 ../
-rw------- 1 root root 107374182400 Jan 29 22:39 data
-rw------- 1 root root 2147483648 Jan 29 22:39 metadata
root@ucp-01:~# ls -halF /var/lib/docker/devicemapper/devicemapper/
total 52M
drwx------ 2 root root 80 Jan 29 22:38 ./
drwx------ 4 root root 80 Jan 29 22:38 ../
-rw------- 1 root root 100G Jan 29 22:39 data
-rw------- 1 root root 2.0G Jan 29 22:39 metadata
root@ucp-01:~# ls -salF /var/lib/docker/devicemapper/devicemapper/
total 52508
0 drwx------ 2 root root 80 Jan 29 22:38 ./
0 drwx------ 4 root root 80 Jan 29 22:38 ../
51820 -rw------- 1 root root 107374182400 Jan 29 22:39 data
688 -rw------- 1 root root 2147483648 Jan 29 22:39 metadata
Sure, it takes up 52MB of space. But its done a nice sparse allocation of 100GB and 2GB for metadata. I am working on switching this off of device mapper (it has only given me grief in other contexts), and onto overlayfs as a better choice. Its needed as this is one of our ramboot file systems, and I really don’t want to see that sparse file get filled.