github.com/a4a881d4/docker@v1.9.0-rc2/docs/articles/b2d_volume_resize.md (about) 1 <!--[metadata]> 2 +++ 3 draft = "true" 4 title = "Resizing a Boot2Docker volume " 5 description = "Resizing a Boot2Docker volume in VirtualBox with GParted" 6 keywords = ["boot2docker, volume, virtualbox"] 7 [menu.main] 8 parent = "smn_win_osx" 9 +++ 10 <![end-metadata]--> 11 12 # Getting “no space left on device” errors with Boot2Docker? 13 14 If you're using Boot2Docker with a large number of images, or the images you're 15 working with are very large, your pulls might start failing with "no space left 16 on device" errors when the Boot2Docker volume fills up. There are two solutions 17 you can try. 18 19 ## Solution 1: Add the `DiskImage` property in boot2docker profile 20 21 The `boot2docker` command reads its configuration from the `$BOOT2DOCKER_PROFILE` if set, or `$BOOT2DOCKER_DIR/profile` or `$HOME/.boot2docker/profile` (on Windows this is `%USERPROFILE%/.boot2docker/profile`). 22 23 1. View the existing configuration, use the `boot2docker config` command. 24 25 $ boot2docker config 26 # boot2docker profile filename: /Users/mary/.boot2docker/profile 27 Init = false 28 Verbose = false 29 Driver = "virtualbox" 30 Clobber = true 31 ForceUpgradeDownload = false 32 SSH = "ssh" 33 SSHGen = "ssh-keygen" 34 SSHKey = "/Users/mary/.ssh/id_boot2docker" 35 VM = "boot2docker-vm" 36 Dir = "/Users/mary/.boot2docker" 37 ISOURL = "https://api.github.com/repos/boot2docker/boot2docker/releases" 38 ISO = "/Users/mary/.boot2docker/boot2docker.iso" 39 DiskSize = 20000 40 Memory = 2048 41 CPUs = 8 42 SSHPort = 2022 43 DockerPort = 0 44 HostIP = "192.168.59.3" 45 DHCPIP = "192.168.59.99" 46 NetMask = [255, 255, 255, 0] 47 LowerIP = "192.168.59.103" 48 UpperIP = "192.168.59.254" 49 DHCPEnabled = true 50 Serial = false 51 SerialFile = "/Users/mary/.boot2docker/boot2docker-vm.sock" 52 Waittime = 300 53 Retries = 75 54 55 The configuration shows you where `boot2docker` is looking for the `profile` file. It also output the settings that are in use. 56 57 58 2. Initialise a default file to customize using `boot2docker config > ~/.boot2docker/profile` command. 59 60 3. Add the following lines to `$HOME/.boot2docker/profile`: 61 62 # Disk image size in MB 63 DiskSize = 50000 64 65 4. Run the following sequence of commands to restart Boot2Docker with the new settings. 66 67 $ boot2docker poweroff 68 $ boot2docker destroy 69 $ boot2docker init 70 $ boot2docker up 71 72 ## Solution 2: Increase the size of boot2docker volume 73 74 This solution increases the volume size by first cloning it, then resizing it 75 using a disk partitioning tool. We recommend 76 [GParted](http://gparted.sourceforge.net/download.php/index.php). The tool comes 77 as a bootable ISO, is a free download, and works well with VirtualBox. 78 79 1. Stop Boot2Docker 80 81 Issue the command to stop the Boot2Docker VM on the command line: 82 83 $ boot2docker stop 84 85 2. Clone the VMDK image to a VDI image 86 87 Boot2Docker ships with a VMDK image, which can't be resized by VirtualBox's 88 native tools. We will instead create a VDI volume and clone the VMDK volume to 89 it. 90 91 3. Using the command line VirtualBox tools, clone the VMDK image to a VDI image: 92 93 $ vboxmanage clonehd /full/path/to/boot2docker-hd.vmdk /full/path/to/<newVDIimage>.vdi --format VDI --variant Standard 94 95 4. Resize the VDI volume 96 97 Choose a size that will be appropriate for your needs. If you're spinning up a 98 lot of containers, or your containers are particularly large, larger will be 99 better: 100 101 $ vboxmanage modifyhd /full/path/to/<newVDIimage>.vdi --resize <size in MB> 102 103 5. Download a disk partitioning tool ISO 104 105 To resize the volume, we'll use [GParted](http://gparted.sourceforge.net/download.php/). 106 Once you've downloaded the tool, add the ISO to the Boot2Docker VM IDE bus. 107 You might need to create the bus before you can add the ISO. 108 109 > **Note:** 110 > It's important that you choose a partitioning tool that is available as an ISO so 111 > that the Boot2Docker VM can be booted with it. 112 113 <table> 114 <tr> 115 <td><img src="/articles/b2d_volume_images/add_new_controller.png"><br><br></td> 116 </tr> 117 <tr> 118 <td><img src="/articles/b2d_volume_images/add_cd.png"></td> 119 </tr> 120 </table> 121 122 6. Add the new VDI image 123 124 In the settings for the Boot2Docker image in VirtualBox, remove the VMDK image 125 from the SATA controller and add the VDI image. 126 127 <img src="/articles/b2d_volume_images/add_volume.png"> 128 129 7. Verify the boot order 130 131 In the **System** settings for the Boot2Docker VM, make sure that **CD/DVD** is 132 at the top of the **Boot Order** list. 133 134 <img src="/articles/b2d_volume_images/boot_order.png"> 135 136 8. Boot to the disk partitioning ISO 137 138 Manually start the Boot2Docker VM in VirtualBox, and the disk partitioning ISO 139 should start up. Using GParted, choose the **GParted Live (default settings)** 140 option. Choose the default keyboard, language, and XWindows settings, and the 141 GParted tool will start up and display the VDI volume you created. Right click 142 on the VDI and choose **Resize/Move**. 143 144 <img src="/articles/b2d_volume_images/gparted.png"> 145 146 9. Drag the slider representing the volume to the maximum available size. 147 148 10. Click **Resize/Move** followed by **Apply**. 149 150 <img src="/articles/b2d_volume_images/gparted2.png"> 151 152 11. Quit GParted and shut down the VM. 153 154 12. Remove the GParted ISO from the IDE controller for the Boot2Docker VM in 155 VirtualBox. 156 157 13. Start the Boot2Docker VM 158 159 Fire up the Boot2Docker VM manually in VirtualBox. The VM should log in 160 automatically, but if it doesn't, the credentials are `docker/tcuser`. Using 161 the `df -h` command, verify that your changes took effect. 162 163 <img src="/articles/b2d_volume_images/verify.png"> 164 165 You're done!