Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

How to upgrade boot2docker on device? #391

Open
zhangqianliang opened this issue Jun 11, 2014 · 6 comments
Open

How to upgrade boot2docker on device? #391

zhangqianliang opened this issue Jun 11, 2014 · 6 comments
Labels
question Usability question, not directly related to an error with Boot2Docker

Comments

@zhangqianliang
Copy link

I install boot2docker(v0.9.1) on /dev/sda1(size: 50), and I try to update to v1.0.0. I found it rewrite the disk, /dev/sda2 was missing.

So, how should I upgrade boot2docker to version 1.0.0, and keep data alive meanwhile?

Thanks!

@SvenDowideit
Copy link
Contributor

@charleyzhang From 0.9.1 its complicated, as there are quite a number of changes in virtual machine setup - including a change in Docker engine port number to 2375.

you can try

docker stop
docker download

and then add a second network interface - host only.

this won't set up the ssh key magic, and you'll need to work out how to change the port forwarding.

mmm - or maybe, you could make a copy of the virtualbox disk, then boot2docker delete , create a new vm with the new boot2docker, and later copy the virtual box disk back (losing only the ssh key auto-login)

@zhangqianliang
Copy link
Author

@SvenDowideit My situation was in bare metal. I found this way work:

  1. Re-fdisk, and keep the size of /dev/sda1 same with its previous. Rest to be /dev/sda2(also same as its previous).
  2. Install boot2docker v1.0.0 into /dev/sda2, and then reboot. The result: my data are still there.

@SvenDowideit
Copy link
Contributor

@charleyzhang interesting - so how are you 'installing'? I'd love to have a better upgrade process for bare metal too..

@zhangqianliang
Copy link
Author

@SvenDowideit Here is my steps:

  1. First time to install boot2docker(v0.12.0) with CDROM:
    a) $ dd if=/dev/cdrom of=/dev/sda
    b) fdisk disk with 2 primary partitions:
    $ sudo fdisk /dev/sda
    $ n
    $ p
    $ 2
    $ ENTER
    $ ENTER
    $ w
    c) format sda2: $ sudo mkfs.ext4 /dev/sda2
    d) mount into /mnt/: $ sudo mkdir -p /mnt/sda2 $ sudo mount /dev/sda2 /mnt/sda2
    e) Add some private files into /mnt/sda2, like pulling some docker images, or other test files.
    f) reboot.
  2. Update to boot2docker v1.0.0 with CDROM, same steps as 1 a) b) , and then reboot, after rebooting, you will find the data added in /mnt/sda2 was still there.

@SvenDowideit
Copy link
Contributor

excellent :) I thought I tested that, but iirc, i had a much more complicated disk layout, so decided it was a more risk than I wanted. So I still boot from usb :)

@zhangqianliang
Copy link
Author

@SvenDowideit lol, if I had a much more complicated disk layout, I would boot from usb too.

@wglambert wglambert added the question Usability question, not directly related to an error with Boot2Docker label Jun 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Usability question, not directly related to an error with Boot2Docker
Projects
None yet
Development

No branches or pull requests

3 participants