mongo icon indicating copy to clipboard operation
mongo copied to clipboard

Docker run throws error no space left error for /data/db

Open bimalm opened this issue 10 years ago • 7 comments

Getting Below error when run the docker

docker run -d -p 3000:27017 --name m1 --net mongo-net mongo mongod

2016-11-25T08:56:26.387+0000 I STORAGE [initandlisten] error creating journal dir /data/db/journal boost::filesystem::create_directory: No space left on device: "/data/db/journal" 2016-11-25T08:56:26.387+0000 I STORAGE [initandlisten] exception in initAndListen std::exception: boost::filesystem::create_directory: No space left on device: "/data/db/journal", terminating 2016-11-25T08:56:26.388+0000 I CONTROL [initandlisten] dbexit: rc: 100

bimalm avatar Nov 25 '16 09:11 bimalm

I didn't face the issue when mount a volume to /data/db ocker run -d -p 3000:27017 -v /Users/user/work/m1:/data/db --name m1 --net mongo-net mongo mongod

Look like it has something to do with docker image

bimalm avatar Nov 25 '16 09:11 bimalm

I would guess that you are on a Mac using "Docker for Mac". I think that the VM provisioned by docker does not have enough space and so mounting your host's directory gave it the space that it needed.

yosifkit avatar Nov 28 '16 23:11 yosifkit

@yosifkit thats right. I could clean up some space by deleting unused docker instances and this error gone away

bimalm avatar Nov 29 '16 11:11 bimalm

Also works if added: --smallfiles In compose you can use: command: mongod --smallfiles

lupa18 avatar Dec 02 '16 23:12 lupa18

What I've also seen on Docker for Mac is that the available disk space can be exhausted by too many local images. Removing unused images can help then.

DonMartin76 avatar Nov 14 '18 06:11 DonMartin76

docker volume prune is worked on this error message.

nukopy avatar Nov 06 '22 16:11 nukopy

I faced the same issue and solved it on Mac, by going to the settings for Docker Desktop and increasing the allocated Resources.

flohop avatar May 21 '23 08:05 flohop