github.com/feiyang21687/docker@v1.5.0/docs/sources/articles/b2d_volume_resize.md (about)

     1  page_title: Resizing a Boot2Docker Volume	
     2  page_description: Resizing a Boot2Docker Volume in VirtualBox with GParted
     3  page_keywords: boot2docker, volume, virtualbox
     4  
     5  # Getting “no space left on device” errors with Boot2Docker?
     6  
     7  If you're using Boot2Docker with a large number of images, or the images you're
     8  working with are very large, your pulls might start failing with "no space left 
     9  on device" errors when the Boot2Docker volume fills up. The solution is to 
    10  increase the volume size by first cloning it, then resizing it using a disk 
    11  partitioning tool. 
    12  
    13  We recommend [GParted](http://gparted.sourceforge.net/download.php/index.php).
    14  The tool comes as a bootable ISO, is a free download, and works well with 
    15  VirtualBox.
    16  
    17  ## 1. Stop Boot2Docker
    18  
    19  Issue the command to stop the Boot2Docker VM on the command line:
    20  
    21      $ boot2docker stop
    22  
    23  ## 2. Clone the VMDK image to a VDI image
    24  
    25  Boot2Docker ships with a VMDK image, which can’t be resized by VirtualBox’s 
    26  native tools. We will instead create a VDI volume and clone the VMDK volume to 
    27  it. 
    28  
    29  Using the command line VirtualBox tools, clone the VMDK image to a VDI image:
    30  
    31      $ vboxmanage clonehd /full/path/to/boot2docker-hd.vmdk /full/path/to/<newVDIimage>.vdi --format VDI --variant Standard
    32  
    33  ## 3. Resize the VDI volume
    34  
    35  Choose a size that will be appropriate for your needs. If you’re spinning up a 
    36  lot of containers, or your containers are particularly large, larger will be 
    37  better:
    38  
    39      $ vboxmanage modifyhd /full/path/to/<newVDIimage>.vdi --resize <size in MB>
    40  
    41  ## 4. Download a disk partitioning tool ISO 
    42  
    43  To resize the volume, we'll use [GParted](http://gparted.sourceforge.net/download.php/). 
    44  Once you've downloaded the tool, add the ISO to the Boot2Docker VM IDE bus. 
    45  You might need to create the bus before you can add the ISO. 
    46  
    47  > **Note:** 
    48  > It's important that you choose a partitioning tool that is available as an ISO so 
    49  > that the Boot2Docker VM can be booted with it.
    50  
    51  <table>
    52  	<tr>
    53  		<td><img src="/articles/b2d_volume_images/add_new_controller.png"><br><br></td>
    54  	</tr>
    55  	<tr>
    56  		<td><img src="/articles/b2d_volume_images/add_cd.png"></td>
    57  	</tr>
    58  </table>
    59  
    60  ## 5. Add the new VDI image 
    61  
    62  In the settings for the Boot2Docker image in VirtualBox, remove the VMDK image 
    63  from the SATA contoller and add the VDI image.
    64  
    65  <img src="/articles/b2d_volume_images/add_volume.png">
    66  
    67  ## 6. Verify the boot order
    68  
    69  In the **System** settings for the Boot2Docker VM, make sure that **CD/DVD** is 
    70  at the top of the **Boot Order** list.
    71  
    72  <img src="/articles/b2d_volume_images/boot_order.png">
    73  
    74  ## 7. Boot to the disk partitioning ISO
    75  
    76  Manually start the Boot2Docker VM in VirtualBox, and the disk partitioning ISO 
    77  should start up. Using GParted, choose the **GParted Live (default settings)** 
    78  option. Choose the default keyboard, language, and XWindows settings, and the 
    79  GParted tool will start up and display the VDI volume you created. Right click 
    80  on the VDI and choose **Resize/Move**. 
    81  
    82  <img src="/articles/b2d_volume_images/gparted.png">
    83  
    84  Drag the slider representing the volume to the maximum available size, click 
    85  **Resize/Move**, and then **Apply**. 
    86  
    87  <img src="/articles/b2d_volume_images/gparted2.png">
    88  
    89  Quit GParted and shut down the VM. Remove the GParted ISO from the IDE controller 
    90  for the Boot2Docker VM in VirtualBox.
    91  
    92  ## 8. Start the Boot2Docker VM 
    93  
    94  Fire up the Boot2Docker VM manually in VirtualBox. The VM should log in 
    95  automatically, but if it doesn't, the credentials are `docker/tcuser`. Using 
    96  the `df -h` command, verify that your changes took effect.
    97  
    98  <img src="/articles/b2d_volume_images/verify.png">
    99  
   100  You’re done!
   101