{"action":"created","comment":{"url":"https://api.github.com/repos/resin-io/docs/pulls/comments/147237753","pull_request_review_id":72305785,"id":147237753,"diff_hunk":"@@ -0,0 +1,56 @@\n+---\n+title: Update process details\n+excerpt: Details of the self-service update process\n+---\n+\n+# What happens during a resin host OS update?\n+\n+The ability to remotely update the entire host operating system (OS) of your device, rather than just the user application, is a core feature of resin.io. Performing updates may feel like an opaque process, so we thought it would be useful to break it down. \n+\n+Since **resinOS** 1.x and 2.x behave somewhat differently in how they manage updates, we'll examine the three main use cases. In all three cases, an update script gets transferred to the device to handle the updater process, as described in detail below.\n+\n+## Upgrading between resinOS 2.x versions\n+\n+The first step the updater script performs includes a number of sanity checks, so that an update does not progress if something isn't right. The checks include, among other things, whether the device is running a **resinOS** version that it can work with (i.e., not on 1.x), whether the script is running on the right device type, whether it can reach the **Docker** registry to get the target **resinOS** image, and whether that image exists.\n+\n+Next, the supervisor is stopped so it does not inadvertently interfere with the update process. The user application is kept running to minimize downtime. he updater then uses **Docker** to pull the new **resinOS** image. When the pull succeeds, the spare root partition is formatted and the contents of the image are exported onto that partition. The modifications to the boot partition are also applied.\n+\n+The updater script checks to see if the new **resinOS** version ships with a newer supervisor version than what the device currently runs, and, if so, the supervisor is updated.\n+\n+Finally, the boot settings are modified so that on the next reboot the new root file system is used. As a last step, the device is rebooted.\n+\n+## Upgrading from resinOS 1.x to 2.x\n+\n+There are quite a few [changes between **resinOS** 1.x and 2.x][changes], which makes this type of update the most complex of the three. The main differences that the updater has to account for are a different partition layout, a different **Docker** file system, and the switch from **ConnMan** to **NetworkManager**.\n+\n+As mentioned above, the updater script starts with a number of cross-checks, the most important being whether the device is using from the main or the secondary root partition. The latter would happen if the device has already been updated between 1.x versions. If it's running from the secondary root partition, as a first step the script stops the user application, switches to read only mode, copies over the data to the main partition, switches the boot settings, and reboots the device to run from the main partition. It is then ready to retry the update process.\n+\n+After the checks are run, both the supervisor and the user application are stopped and the containers and images are removed.\n+\n+Next, the script downloads a couple of binary tools that are not present in 1.x systems but are required for the transition (mainly tools handling the ext4 file system).\n+\n+The contents of the `resin-data` folder, where the contents of your application’s `/data` folder are stored, are backed up on the secondary root partition temporarily. This limits the amount of data that can be backed up automatically to about 170MB (compressed). If there's more data than this, the update process will stop, but the device hasn't been materially modified yet.\n+\n+Next, the device’s file system is modified to match the setup required by **resinOS** 2.x. **Docker** is then restarted and pulls a new **resinOS** image, which is exported into a compressed archive. Finally, the new rootfs is populated, and `resin-data` is restored.\n+\n+\n+The WiFi settings are then migrated from the 1.x setup (in `config.json`) to the 2.x setup (as **NetworkManager** files). The migration also tries to create configurations from any [**WiFi Connect**][wifi-connect] settings found.\n+\n+The boot settings are switched so that the next time the device boots, it will do so from the **resinOS** 2.x system. The supervisor version is checked, and if the target **resinOS** version has a newer supervisor, then the device is marked for a supervisor update as well\n+\n+Finally, the device is rebooted. On the first boot it will necessarily come online without any **Docker** images (as the update process needed to remove the images).o when the device starts, it will first redownload the required supervisor, which then redownloads the user application. After this all the heavy lifting is done you should have a brand new **resinOS** 2.x device, with all the improvements from its former life as a 1.x device.","path":"pages/updates/update-process.md","position":41,"original_position":41,"commit_id":"b43352c962ce9528f500ee20bc291152c2e1b85c","original_commit_id":"b43352c962ce9528f500ee20bc291152c2e1b85c","user":{"login":"alisondavis17","id":20308284,"avatar_url":"https://avatars1.githubusercontent.com/u/20308284?v=4","gravatar_id":"","url":"https://api.github.com/users/alisondavis17","html_url":"https://github.com/alisondavis17","followers_url":"https://api.github.com/users/alisondavis17/followers","following_url":"https://api.github.com/users/alisondavis17/following{/other_user}","gists_url":"https://api.github.com/users/alisondavis17/gists{/gist_id}","starred_url":"https://api.github.com/users/alisondavis17/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alisondavis17/subscriptions","organizations_url":"https://api.github.com/users/alisondavis17/orgs","repos_url":"https://api.github.com/users/alisondavis17/repos","events_url":"https://api.github.com/users/alisondavis17/events{/privacy}","received_events_url":"https://api.github.com/users/alisondavis17/received_events","type":"User","site_admin":false},"body":"Missing a space and \"S\" in second sentence (\"So when the device starts...\")","created_at":"2017-10-26T19:04:37Z","updated_at":"2017-10-26T19:05:37Z","html_url":"https://github.com/resin-io/docs/pull/613#discussion_r147237753","pull_request_url":"https://api.github.com/repos/resin-io/docs/pulls/613","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/resin-io/docs/pulls/comments/147237753"},"html":{"href":"https://github.com/resin-io/docs/pull/613#discussion_r147237753"},"pull_request":{"href":"https://api.github.com/repos/resin-io/docs/pulls/613"}}},"pull_request":{"url":"https://api.github.com/repos/resin-io/docs/pulls/613","id":149007775,"html_url":"https://github.com/resin-io/docs/pull/613","diff_url":"https://github.com/resin-io/docs/pull/613.diff","patch_url":"https://github.com/resin-io/docs/pull/613.patch","issue_url":"https://api.github.com/repos/resin-io/docs/issues/613","number":613,"state":"open","locked":false,"title":"New documentation for self-service updates","user":{"login":"zwalchuk","id":8054407,"avatar_url":"https://avatars0.githubusercontent.com/u/8054407?v=4","gravatar_id":"","url":"https://api.github.com/users/zwalchuk","html_url":"https://github.com/zwalchuk","followers_url":"https://api.github.com/users/zwalchuk/followers","following_url":"https://api.github.com/users/zwalchuk/following{/other_user}","gists_url":"https://api.github.com/users/zwalchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/zwalchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zwalchuk/subscriptions","organizations_url":"https://api.github.com/users/zwalchuk/orgs","repos_url":"https://api.github.com/users/zwalchuk/repos","events_url":"https://api.github.com/users/zwalchuk/events{/privacy}","received_events_url":"https://api.github.com/users/zwalchuk/received_events","type":"User","site_admin":false},"body":"Added information on self-service updates through the dashboard, including details of the update process. Moved the \"Moving to resinOS 2.0\" section into a new \"Updating resinOS\" header.","created_at":"2017-10-26T18:14:48Z","updated_at":"2017-10-26T19:05:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65ad7e37314ca27a2be460e53e43e7e7f862f7bf","assignee":null,"assignees":[],"requested_reviewers":[{"login":"imrehg","id":38863,"avatar_url":"https://avatars0.githubusercontent.com/u/38863?v=4","gravatar_id":"","url":"https://api.github.com/users/imrehg","html_url":"https://github.com/imrehg","followers_url":"https://api.github.com/users/imrehg/followers","following_url":"https://api.github.com/users/imrehg/following{/other_user}","gists_url":"https://api.github.com/users/imrehg/gists{/gist_id}","starred_url":"https://api.github.com/users/imrehg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imrehg/subscriptions","organizations_url":"https://api.github.com/users/imrehg/orgs","repos_url":"https://api.github.com/users/imrehg/repos","events_url":"https://api.github.com/users/imrehg/events{/privacy}","received_events_url":"https://api.github.com/users/imrehg/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/resin-io/docs/pulls/613/commits","review_comments_url":"https://api.github.com/repos/resin-io/docs/pulls/613/comments","review_comment_url":"https://api.github.com/repos/resin-io/docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/resin-io/docs/issues/613/comments","statuses_url":"https://api.github.com/repos/resin-io/docs/statuses/b43352c962ce9528f500ee20bc291152c2e1b85c","head":{"label":"resin-io:self-service","ref":"self-service","sha":"b43352c962ce9528f500ee20bc291152c2e1b85c","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":21133508,"name":"docs","full_name":"resin-io/docs","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/docs","description":"Documentation for the resin.io platform.","fork":false,"url":"https://api.github.com/repos/resin-io/docs","forks_url":"https://api.github.com/repos/resin-io/docs/forks","keys_url":"https://api.github.com/repos/resin-io/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/docs/teams","hooks_url":"https://api.github.com/repos/resin-io/docs/hooks","issue_events_url":"https://api.github.com/repos/resin-io/docs/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/docs/events","assignees_url":"https://api.github.com/repos/resin-io/docs/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/docs/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/docs/tags","blobs_url":"https://api.github.com/repos/resin-io/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/docs/languages","stargazers_url":"https://api.github.com/repos/resin-io/docs/stargazers","contributors_url":"https://api.github.com/repos/resin-io/docs/contributors","subscribers_url":"https://api.github.com/repos/resin-io/docs/subscribers","subscription_url":"https://api.github.com/repos/resin-io/docs/subscription","commits_url":"https://api.github.com/repos/resin-io/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/docs/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/docs/merges","archive_url":"https://api.github.com/repos/resin-io/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/docs/downloads","issues_url":"https://api.github.com/repos/resin-io/docs/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/docs/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/docs/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/docs/deployments","created_at":"2014-06-23T16:26:36Z","updated_at":"2017-10-25T15:10:44Z","pushed_at":"2017-10-26T18:36:03Z","git_url":"git://github.com/resin-io/docs.git","ssh_url":"git@github.com:resin-io/docs.git","clone_url":"https://github.com/resin-io/docs.git","svn_url":"https://github.com/resin-io/docs","homepage":"https://docs.resin.io/","size":135516,"stargazers_count":18,"watchers_count":18,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":162,"forks":61,"open_issues":162,"watchers":18,"default_branch":"master"}},"base":{"label":"resin-io:master","ref":"master","sha":"b8ee86ccd2947a31012233830b64d565f05b17be","user":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"repo":{"id":21133508,"name":"docs","full_name":"resin-io/docs","owner":{"login":"resin-io","id":6157842,"avatar_url":"https://avatars1.githubusercontent.com/u/6157842?v=4","gravatar_id":"","url":"https://api.github.com/users/resin-io","html_url":"https://github.com/resin-io","followers_url":"https://api.github.com/users/resin-io/followers","following_url":"https://api.github.com/users/resin-io/following{/other_user}","gists_url":"https://api.github.com/users/resin-io/gists{/gist_id}","starred_url":"https://api.github.com/users/resin-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/resin-io/subscriptions","organizations_url":"https://api.github.com/users/resin-io/orgs","repos_url":"https://api.github.com/users/resin-io/repos","events_url":"https://api.github.com/users/resin-io/events{/privacy}","received_events_url":"https://api.github.com/users/resin-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/resin-io/docs","description":"Documentation for the resin.io platform.","fork":false,"url":"https://api.github.com/repos/resin-io/docs","forks_url":"https://api.github.com/repos/resin-io/docs/forks","keys_url":"https://api.github.com/repos/resin-io/docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/resin-io/docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/resin-io/docs/teams","hooks_url":"https://api.github.com/repos/resin-io/docs/hooks","issue_events_url":"https://api.github.com/repos/resin-io/docs/issues/events{/number}","events_url":"https://api.github.com/repos/resin-io/docs/events","assignees_url":"https://api.github.com/repos/resin-io/docs/assignees{/user}","branches_url":"https://api.github.com/repos/resin-io/docs/branches{/branch}","tags_url":"https://api.github.com/repos/resin-io/docs/tags","blobs_url":"https://api.github.com/repos/resin-io/docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/resin-io/docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/resin-io/docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/resin-io/docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/resin-io/docs/statuses/{sha}","languages_url":"https://api.github.com/repos/resin-io/docs/languages","stargazers_url":"https://api.github.com/repos/resin-io/docs/stargazers","contributors_url":"https://api.github.com/repos/resin-io/docs/contributors","subscribers_url":"https://api.github.com/repos/resin-io/docs/subscribers","subscription_url":"https://api.github.com/repos/resin-io/docs/subscription","commits_url":"https://api.github.com/repos/resin-io/docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/resin-io/docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/resin-io/docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/resin-io/docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/resin-io/docs/contents/{+path}","compare_url":"https://api.github.com/repos/resin-io/docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/resin-io/docs/merges","archive_url":"https://api.github.com/repos/resin-io/docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/resin-io/docs/downloads","issues_url":"https://api.github.com/repos/resin-io/docs/issues{/number}","pulls_url":"https://api.github.com/repos/resin-io/docs/pulls{/number}","milestones_url":"https://api.github.com/repos/resin-io/docs/milestones{/number}","notifications_url":"https://api.github.com/repos/resin-io/docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/resin-io/docs/labels{/name}","releases_url":"https://api.github.com/repos/resin-io/docs/releases{/id}","deployments_url":"https://api.github.com/repos/resin-io/docs/deployments","created_at":"2014-06-23T16:26:36Z","updated_at":"2017-10-25T15:10:44Z","pushed_at":"2017-10-26T18:36:03Z","git_url":"git://github.com/resin-io/docs.git","ssh_url":"git@github.com:resin-io/docs.git","clone_url":"https://github.com/resin-io/docs.git","svn_url":"https://github.com/resin-io/docs","homepage":"https://docs.resin.io/","size":135516,"stargazers_count":18,"watchers_count":18,"language":"CSS","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":61,"mirror_url":null,"archived":false,"open_issues_count":162,"forks":61,"open_issues":162,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/resin-io/docs/pulls/613"},"html":{"href":"https://github.com/resin-io/docs/pull/613"},"issue":{"href":"https://api.github.com/repos/resin-io/docs/issues/613"},"comments":{"href":"https://api.github.com/repos/resin-io/docs/issues/613/comments"},"review_comments":{"href":"https://api.github.com/repos/resin-io/docs/pulls/613/comments"},"review_comment":{"href":"https://api.github.com/repos/resin-io/docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/resin-io/docs/pulls/613/commits"},"statuses":{"href":"https://api.github.com/repos/resin-io/docs/statuses/b43352c962ce9528f500ee20bc291152c2e1b85c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alisondavis17"}}