Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cdb9627

Browse files
author
Mary Anthony
committed
Carries and closes 13361
Signed-off-by: Mary Anthony <[email protected]> (cherry picked from commit 2c5e044)
1 parent 3a836fa commit cdb9627

1 file changed

Lines changed: 119 additions & 62 deletions

File tree

docs/articles/b2d_volume_resize.md

Lines changed: 119 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,97 +11,154 @@ parent = "smn_win_osx"
1111
# Getting “no space left on device” errors with Boot2Docker?
1212

1313
If you're using Boot2Docker with a large number of images, or the images you're
14-
working with are very large, your pulls might start failing with "no space left
15-
on device" errors when the Boot2Docker volume fills up. The solution is to
16-
increase the volume size by first cloning it, then resizing it using a disk
17-
partitioning tool.
14+
working with are very large, your pulls might start failing with "no space left
15+
on device" errors when the Boot2Docker volume fills up. There are two solutions
16+
you can try.
1817

19-
We recommend [GParted](http://gparted.sourceforge.net/download.php/index.php).
20-
The tool comes as a bootable ISO, is a free download, and works well with
21-
VirtualBox.
18+
## Solution 1: Add the `DiskImage` property in boot2docker profile
19+
20+
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`).
21+
22+
1. View the existing configuration, use the `boot2docker config` command.
23+
24+
$ boot2docker config
25+
# boot2docker profile filename: /Users/mary/.boot2docker/profile
26+
Init = false
27+
Verbose = false
28+
Driver = "virtualbox"
29+
Clobber = true
30+
ForceUpgradeDownload = false
31+
SSH = "ssh"
32+
SSHGen = "ssh-keygen"
33+
SSHKey = "/Users/mary/.ssh/id_boot2docker"
34+
VM = "boot2docker-vm"
35+
Dir = "/Users/mary/.boot2docker"
36+
ISOURL = "https://api.github.com/repos/boot2docker/boot2docker/releases"
37+
ISO = "/Users/mary/.boot2docker/boot2docker.iso"
38+
DiskSize = 20000
39+
Memory = 2048
40+
CPUs = 8
41+
SSHPort = 2022
42+
DockerPort = 0
43+
HostIP = "192.168.59.3"
44+
DHCPIP = "192.168.59.99"
45+
NetMask = [255, 255, 255, 0]
46+
LowerIP = "192.168.59.103"
47+
UpperIP = "192.168.59.254"
48+
DHCPEnabled = true
49+
Serial = false
50+
SerialFile = "/Users/mary/.boot2docker/boot2docker-vm.sock"
51+
Waittime = 300
52+
Retries = 75
53+
54+
The configuration shows you where `boot2docker` is looking for the `profile` file. It also output the settings that are in use.
55+
56+
57+
2. Initialise a default file to customize using `boot2docker config > ~/.boot2docker/profile` command.
58+
59+
3. Add the following lines to `$HOME/.boot2docker/profile`:
2260

23-
## 1. Stop Boot2Docker
61+
# Disk image size in MB
62+
DiskSize = 50000
2463

25-
Issue the command to stop the Boot2Docker VM on the command line:
64+
4. Run the following sequence of commands to restart Boot2Docker with the new settings.
2665

27-
$ boot2docker stop
66+
$ boot2docker poweroff
67+
$ boot2docker destroy
68+
$ boot2docker init
69+
$ boot2docker up
2870

29-
## 2. Clone the VMDK image to a VDI image
71+
## Solution 2: Increase the size of boot2docker volume
3072

31-
Boot2Docker ships with a VMDK image, which can’t be resized by VirtualBox’s
32-
native tools. We will instead create a VDI volume and clone the VMDK volume to
33-
it.
73+
This solution increases the volume size by first cloning it, then resizing it
74+
using a disk partitioning tool. We recommend
75+
[GParted](http://gparted.sourceforge.net/download.php/index.php). The tool comes
76+
as a bootable ISO, is a free download, and works well with VirtualBox.
3477

35-
Using the command line VirtualBox tools, clone the VMDK image to a VDI image:
78+
1. Stop Boot2Docker
3679

37-
$ vboxmanage clonehd /full/path/to/boot2docker-hd.vmdk /full/path/to/<newVDIimage>.vdi --format VDI --variant Standard
80+
Issue the command to stop the Boot2Docker VM on the command line:
3881

39-
## 3. Resize the VDI volume
82+
$ boot2docker stop
4083

41-
Choose a size that will be appropriate for your needs. If you’re spinning up a
42-
lot of containers, or your containers are particularly large, larger will be
43-
better:
84+
2. Clone the VMDK image to a VDI image
4485

45-
$ vboxmanage modifyhd /full/path/to/<newVDIimage>.vdi --resize <size in MB>
86+
Boot2Docker ships with a VMDK image, which can't be resized by VirtualBox's
87+
native tools. We will instead create a VDI volume and clone the VMDK volume to
88+
it.
4689

47-
## 4. Download a disk partitioning tool ISO
90+
3. Using the command line VirtualBox tools, clone the VMDK image to a VDI image:
4891

49-
To resize the volume, we'll use [GParted](http://gparted.sourceforge.net/download.php/).
50-
Once you've downloaded the tool, add the ISO to the Boot2Docker VM IDE bus.
51-
You might need to create the bus before you can add the ISO.
92+
$ vboxmanage clonehd /full/path/to/boot2docker-hd.vmdk /full/path/to/<newVDIimage>.vdi --format VDI --variant Standard
5293

53-
> **Note:**
54-
> It's important that you choose a partitioning tool that is available as an ISO so
55-
> that the Boot2Docker VM can be booted with it.
94+
4. Resize the VDI volume
5695

57-
<table>
58-
<tr>
59-
<td><img src="/articles/b2d_volume_images/add_new_controller.png"><br><br></td>
60-
</tr>
61-
<tr>
62-
<td><img src="/articles/b2d_volume_images/add_cd.png"></td>
63-
</tr>
64-
</table>
96+
Choose a size that will be appropriate for your needs. If you're spinning up a
97+
lot of containers, or your containers are particularly large, larger will be
98+
better:
6599

66-
## 5. Add the new VDI image
100+
$ vboxmanage modifyhd /full/path/to/<newVDIimage>.vdi --resize <size in MB>
67101

68-
In the settings for the Boot2Docker image in VirtualBox, remove the VMDK image
69-
from the SATA controller and add the VDI image.
102+
5. Download a disk partitioning tool ISO
70103

71-
<img src="/articles/b2d_volume_images/add_volume.png">
104+
To resize the volume, we'll use [GParted](http://gparted.sourceforge.net/download.php/).
105+
Once you've downloaded the tool, add the ISO to the Boot2Docker VM IDE bus.
106+
You might need to create the bus before you can add the ISO.
72107

73-
## 6. Verify the boot order
108+
> **Note:**
109+
> It's important that you choose a partitioning tool that is available as an ISO so
110+
> that the Boot2Docker VM can be booted with it.
74111
75-
In the **System** settings for the Boot2Docker VM, make sure that **CD/DVD** is
76-
at the top of the **Boot Order** list.
112+
<table>
113+
<tr>
114+
<td><img src="/articles/b2d_volume_images/add_new_controller.png"><br><br></td>
115+
</tr>
116+
<tr>
117+
<td><img src="/articles/b2d_volume_images/add_cd.png"></td>
118+
</tr>
119+
</table>
77120

78-
<img src="/articles/b2d_volume_images/boot_order.png">
121+
6. Add the new VDI image
79122

80-
## 7. Boot to the disk partitioning ISO
123+
In the settings for the Boot2Docker image in VirtualBox, remove the VMDK image
124+
from the SATA controller and add the VDI image.
81125

82-
Manually start the Boot2Docker VM in VirtualBox, and the disk partitioning ISO
83-
should start up. Using GParted, choose the **GParted Live (default settings)**
84-
option. Choose the default keyboard, language, and XWindows settings, and the
85-
GParted tool will start up and display the VDI volume you created. Right click
86-
on the VDI and choose **Resize/Move**.
126+
<img src="/articles/b2d_volume_images/add_volume.png">
87127

88-
<img src="/articles/b2d_volume_images/gparted.png">
128+
7. Verify the boot order
89129

90-
Drag the slider representing the volume to the maximum available size, click
91-
**Resize/Move**, and then **Apply**.
130+
In the **System** settings for the Boot2Docker VM, make sure that **CD/DVD** is
131+
at the top of the **Boot Order** list.
92132

93-
<img src="/articles/b2d_volume_images/gparted2.png">
133+
<img src="/articles/b2d_volume_images/boot_order.png">
94134

95-
Quit GParted and shut down the VM. Remove the GParted ISO from the IDE controller
96-
for the Boot2Docker VM in VirtualBox.
135+
8. Boot to the disk partitioning ISO
97136

98-
## 8. Start the Boot2Docker VM
137+
Manually start the Boot2Docker VM in VirtualBox, and the disk partitioning ISO
138+
should start up. Using GParted, choose the **GParted Live (default settings)**
139+
option. Choose the default keyboard, language, and XWindows settings, and the
140+
GParted tool will start up and display the VDI volume you created. Right click
141+
on the VDI and choose **Resize/Move**.
142+
143+
<img src="/articles/b2d_volume_images/gparted.png">
144+
145+
9. Drag the slider representing the volume to the maximum available size.
146+
147+
10. Click **Resize/Move** followed by **Apply**.
148+
149+
<img src="/articles/b2d_volume_images/gparted2.png">
150+
151+
11. Quit GParted and shut down the VM.
152+
153+
12. Remove the GParted ISO from the IDE controller for the Boot2Docker VM in
154+
VirtualBox.
99155

100-
Fire up the Boot2Docker VM manually in VirtualBox. The VM should log in
101-
automatically, but if it doesn't, the credentials are `docker/tcuser`. Using
102-
the `df -h` command, verify that your changes took effect.
156+
13. Start the Boot2Docker VM
103157

104-
<img src="/articles/b2d_volume_images/verify.png">
158+
Fire up the Boot2Docker VM manually in VirtualBox. The VM should log in
159+
automatically, but if it doesn't, the credentials are `docker/tcuser`. Using
160+
the `df -h` command, verify that your changes took effect.
105161

106-
You’re done!
162+
<img src="/articles/b2d_volume_images/verify.png">
107163

164+
You're done!

0 commit comments

Comments
 (0)