Docker Community Forums

Share and learn in the Docker community.

Way to create two disks during creating a container using loop-lvm


(Shalexx) #1

Is there a way to create two disks for each container when I use devicemapper as the storage device and loop-lvm?

For now, when I create a container I get /dev/dm-1 disk. I need to have two separated disks for the container, /dev/dm-1 and /dev/dm-2. I’m using it for testing. The disk /dev/dm-1 should be used for the system, /dev/dm-2 should be available to format.
I not wont to use direct-lvm since it requires manual configuration for each container. My container should scale (I use docker-compose for this reason). Therefore, the number of containers often change.

My configuration:
Storage Driver: devicemapper
Pool Name: docker-8:2-10223842-pool
Pool Blocksize: 65.54kB
Base Device Size: 53.69GB
Backing Filesystem: ext4
Udev Sync Supported: true
Data file: /dev/loop20
Metadata file: /dev/loop21
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Data Space Used: 6.098GB
Data Space Total: 107.4GB
Data Space Available: 101.3GB
Metadata Space Used: 4.301MB
Metadata Space Total: 2.147GB
Metadata Space Available: 2.143GB
Thin Pool Minimum Free Space: 10.74GB
Deferred Removal Enabled: true
Deferred Deletion Enabled: true
Deferred Deleted Device Count: 1
Library Version: 1.02.145 (2017-11-03)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d64c661f1d51c48782c9cec8fda7604785f93587
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 4.15.0-29-generic
Operating System: Ubuntu 18.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 31.08GiB
Name: oshevchenko-pc
ID: RTO5:5EKZ:II2I:3HBX:FIGJ:MVRI:Z5KV:EVAK:Y4KP:T4C3:CASO:CIR4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

Thanks for any comments.