Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fallocate failing inside my docker container

Tags:

linux

docker

I'm trying to run a script inside my Linux Ubuntu 14.10 Docker container which uses the fallocate command like so:

fallocate -l 10M 10meg

However, when I run this script, and even when I run the command when I have ssh'd into my container, I get the following error:

root@~$>> fallocate -l 10M 10meg
fallocate: fallocate failed: Operation not supported

Any ideas why this is failing inside my container?

like image 646
jcm Avatar asked Oct 30 '25 17:10

jcm


1 Answers

at the time of writing, fallocate() syscall is not supported by Union FS, the filesystem used by Docker. You can either use truncate as follows (recommended):

truncate -s 10M 10meg

or dd (expensive):

dd if=/dev/zero of=10meg bs=1M count=10
like image 150
Davide Guerri Avatar answered Nov 01 '25 08:11

Davide Guerri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!