Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vagrant - no space left on device error

Tags:

vagrant

I am new to vagrant. I am following the instructions at http://gettingstartedwithdjango.com/en/lessons/introduction-and-launch/

I am getting the following error on running "sudo ./postinstall.sh" script

+ apt-get -y clean
+ rm -f /var/lib/dhcp3/*
+ rm /etc/udev/rules.d/70-persistent-net.rules
rm: cannot remove `/etc/udev/rules.d/70-persistent-net.rules': Is a directory
+ mkdir /etc/udev/rules.d/70-persistent-net.rules
mkdir: cannot create directory `/etc/udev/rules.d/70-persistent-net.rules': File exists
+ rm -rf /dev/.udev/
+ rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm: cannot remove `/lib/udev/rules.d/75-persistent-net-generator.rules': No such file or directory
+ rm -f /home/vagrant/{*.iso,postinstall*.sh}
+ dd if=/dev/zero of=/EMPTY bs=1M
dd: writing `/EMPTY': No space left on device
78504+0 records in
78503+0 records out
82316406784 bytes (82 GB) copied, 105.122 s, 783 MB/s
+ rm -f /EMPTY
+ exit

But I seem to have enough space:

vagrant@precise64:~$ df -h
Filesystem                                 Size  Used Avail Use% Mounted on
/dev/mapper/precise64-root                  79G  2.3G   73G   3% /
udev                                       174M     0  174M   0% /dev
tmpfs                                       74M  272K   73M   1% /run
none                                       5.0M     0  5.0M   0% /run/lock
none                                       183M     0  183M   0% /run/shm
/dev/sda1                                  228M   25M  192M  12% /boot
/vagrant                                   220G   91G  130G  42% /vagrant
/tmp/vagrant-chef-1/chef-solo-1/cookbooks  220G   91G  130G  42% /tmp/vagrant-chef-1/chef-solo-1/cookbooks
/tmp/vagrant-chef-1/chef-solo-2/cookbooks  220G   91G  130G  42% /tmp/vagrant-chef-1/chef-solo-2/cookbooks

Can somebody please help? Thank you.

like image 220
U-L Avatar asked Nov 19 '13 20:11

U-L


People also ask

How do I allocate more memory to vagrant?

You can easily increase your VM's RAM by modifying the memory property of config. vm. provider section in your vagrant file. This allocates about 4GB of RAM to your VM.

How do you reset a vagrant VM?

Command: vagrant reload [name|id] The configured provisioners will not run again, by default. You can force the provisioners to re-run by specifying the --provision flag.

Can vagrant work without VirtualBox?

Getting Started With Vagrant Before you start, make sure you already have a virtualization solution on your system. Solutions that work with Vagrant include VirtualBox, VMware, Docker, Hyper-V, and custom solutions.

How do I get rid of vagrant VM?

Command: vagrant destroy [name|id] This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.


2 Answers

It's supposed to do this :) It's making your virtual disk as small as possible since it is thinly provisioned.

Creating a file full of zeros on the disk until it is full is clearing the blocks on the disk and as such your file representing the VMs disk will be as small as the actual data you have on the disk.

like image 161
sjbx Avatar answered Sep 23 '22 06:09

sjbx


The problem resides in the following statement:

dd if=/dev/zero of=/EMPTY bs=1M

If you don't specify count=<some value>, the dd command will continue until the end of device is reached. So basically with the above command you're trying to create a file called that spawns through the whole partition, called EMPTY under /. Thus the error.

like image 37
Emyl Avatar answered Sep 20 '22 06:09

Emyl