Docker still on loopback after docker-storage-setup

In centOS 7 after I ran docker-storage-setup, it was successful without any error but still docker is on loopback.
Data file: /dev/loop0
Metadata file: /dev/loop1

Below is the setup I have done. added a disk and without doing any partitioning, done below setup with /dev/sdc

systemctl stop docker

rm -rf /var/lib/docker


systemctl start docker


Below is the output of docker-storage-setup
[root@prodserv~]# docker-storage-setup
Checking that no-one is using this disk right now …

Disk /dev/sdc: 51200 cylinders, 64 heads, 32 sectors/track
sfdisk: /dev/sdc: unrecognized partition table type

Old situation:
sfdisk: No partitions found

New situation:
Units: sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sdc1 2048 104857599 104855552 8e Linux LVM
/dev/sdc2 0 - 0 0 Empty
/dev/sdc3 0 - 0 0 Empty
/dev/sdc4 0 - 0 0 Empty
Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
Successfully wrote the new partition table

Re-reading the partition table …

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
Physical volume “/dev/sdc1” successfully created
Volume group “centos” successfully extended

Then I loaded the image and started.

But still the docker info shows that it’s still on loopback.

docker info

Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 1
Server Version: 1.11.2
Storage Driver: devicemapper
Pool Name: docker-253:1-268630178-pool
Pool Blocksize: 65.54 kB
Base Device Size: 10.74 GB
Backing Filesystem: xfs
Data file: /dev/loop0
Metadata file: /dev/loop1
Data Space Used: 900.1 MB
Data Space Total: 107.4 GB
Data Space Available: 42.6 GB
Metadata Space Used: 2.101 MB
Metadata Space Total: 2.147 GB
Metadata Space Available: 2.145 GB
Udev Sync Supported: true
Deferred Removal Enabled: false
Deferred Deletion Enabled: false
Deferred Deleted Device Count: 0
Data loop file: /var/lib/docker/devicemapper/devicemapper/data
WARNING: Usage of loopback devices is strongly discouraged for production use. Either use --storage-opt dm.thinpooldev or use --storage-opt dm.no_warn_on_loop_devices=true to suppress this warning.
Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
Library Version: 1.02.107-RHEL7 (2016-06-09)
Logging Driver: json-file
Cgroup Driver: cgroupfs
Volume: local
Network: null host bridge
Kernel Version: 3.10.0-327.22.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.64 GiB
Name: servername
Docker Root Dir: /var/lib/docker
Debug mode (client): false
Debug mode (server): false
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

lsblk -f

ââsda1 xfs ba16f77b-3c3a-4ffa-b7bc-00e76735abe7 /boot
ââsda2 LVM2_member PrLkTT-fKqJ-zUm8-sAlH-588I-HN35-QBigB0
ââcentos-swap swap 66e17f41-c97b-4bdf-83c3-784f8df1d961 [SWAP]
ââcentos-root xfs aca3d41a-fec2-4497-af10-572b014b1730 /
ââsdc1 LVM2_member AsfBqY-NsEq-f6ON-N0Fs-tkpp-m1YA-jjDlPu
ââdocker-253:1-268630178-451bffa81b77c581d9eb8b3b154757c9e015779f619881d35838d47c88ab62da xfs eda37027-15ea-44b7-924e-f61e658a67af
ââdocker-253:1-268630178-451bffa81b77c581d9eb8b3b154757c9e015779f619881d35838d47c88ab62da xfs eda37027-15ea-44b7-924e-f61e658a67af

Have I missed any step.


Is there anyone who has gone through this. Really appreciate your support.

as mentioned in here,

pvcreate /dev/sdc1
vgcreate docker-vg /dev/sdc1

Edit /etc/sysconfig/docker-storage-setup to contain these lines:


and deleted /var/lib/docker
and started docked.

Still the issue is same. It still fills /var/lib/docker with container stuff

I managed to get it configured to run it in production with direct LVM setup.
What I found is it’s not exactly the truth what is in most places in internet. Something is missing in most places.

Anyway finally managed to do it. If anyone is in need of a help wrt this you may contact me.

hi @amigo2016 , I am experiencing the same issue . Can you please share your solution. will be great help. Thanks

1 Like

Hi @amigo2016

I am facing similar issue. I got the loop back error. Can you pls suggest me exact steps on how to configure direct LVM for production USING the existing Volumes as below. I am using centos7

[root@master-3 ~]# docker --version
Docker version 1.12.6, build 88a4867/1.12.6

[root@master-3 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home cl -wi-ao---- 141.12g
root cl -wi-ao---- 50.00g
swap cl -wi-a----- 7.88g

[root@master-3 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 cl lvm2 a-- 199.00g 4.00m

[root@master-3 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
cl 1 3 0 wz–n- 199.00g 4.00m

[root@master-3 ~]# lsblk -f
├─sda1 xfs 48ae1774-890e-43ab-b84b-3f1021f384ef /boot
└─sda2 LVM2_member 3VJOpx-nvgf-d00T-UPxx-yMCT-oJB7-4c8adu
├─cl-root xfs 8226b014-8a61-4f79-bf24-0389fe046d71 /
├─cl-swap swap 8654958d-9e4d-4c42-8b9b-c4dcf2568083
└─cl-home xfs 5eb89b44-d559-400d-8f7f-94e1268b56ba /home

I did lot of search on the Net but couldnt get it working…

I tried below in /etc/sysconfig/docker-storage-setup


[root@master-3 ~]# docker-storage-setup
ERROR: There is not enough free space in volume group cl to create data volume of size MIN_DATA_SIZE=2G.

Thanks a lot in advance.

Hey! I am getting the same error while starting docker. Kindly help

[root@CDCUESEARCHAPP2 ~]# systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
Active: failed (Result: exit-code) since Tue 2017-10-31 01:55:34 IST; 32s ago
Process: 25552 ExecStart=/usr/bin/docker daemon --insecure-registry (code=exited, status=2)
Main PID: 25552 (code=exited, status=2)

Oct 31 01:54:04 CDCUESEARCHAPP2 systemd[1]: Starting Docker Application Container Engine…
Oct 31 01:54:04 CDCUESEARCHAPP2 docker[25552]: time=“2017-10-31T01:54:04.697052800+05:30” level=warning msg=“Usage of loopback devices is strongly discouraged for production use. Please use --storage-opt dm.thinpooldev or use man docker to refer to dm.thinpooldev section.”
Oct 31 01:54:04 CDCUESEARCHAPP2 docker[25552]: time=“2017-10-31T01:54:04.724263438+05:30” level=info msg=“API listen on /var/run/docker.sock”
Oct 31 01:54:04 CDCUESEARCHAPP2 docker[25552]: time=“2017-10-31T01:54:04.749381041+05:30” level=info msg="[graphdriver] using prior storage driver “devicemapper”"
Oct 31 01:55:34 CDCUESEARCHAPP2 systemd[1]: docker.service start operation timed out. Terminating.
Oct 31 01:55:34 CDCUESEARCHAPP2 systemd[1]: docker.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Oct 31 01:55:34 CDCUESEARCHAPP2 systemd[1]: Failed to start Docker Application Container Engine.
Oct 31 01:55:34 CDCUESEARCHAPP2 systemd[1]: Unit docker.service entered failed state.
Oct 31 01:55:34 CDCUESEARCHAPP2 systemd[1]: docker.service failed.