{"id":3168,"date":"2022-12-20T16:43:41","date_gmt":"2022-12-20T19:43:41","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/switch_root-man8\/"},"modified":"2022-12-20T16:43:41","modified_gmt":"2022-12-20T19:43:41","slug":"switch_root-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/switch_root-man8\/","title":{"rendered":"SWITCH_ROOT (man8)"},"content":{"rendered":"<h1 align=\"center\">SWITCH_ROOT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a><br \/> <a href=\"#AUTHORS\">AUTHORS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#AVAILABILITY\">AVAILABILITY<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">switch_root \u2212 switch to another filesystem as the root of the mount tree<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>switch_root<\/b> [<b>\u2212hV<\/b>]<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>switch_root<\/b> <i>newroot init<\/i> [<i>arg<\/i>&#8230;]<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>switch_root<\/b> moves already mounted \/proc, \/dev, \/sys and \/run to <i>newroot<\/i> and makes <i>newroot<\/i> the new root filesystem and starts <i>init<\/i> process.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>WARNING: switch_root removes recursively all files and directories on the current root filesystem.<\/b><\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>\u2212h, \u2212\u2212help<\/b><\/p>\n<p style=\"margin-left:22%;\">Display help text and exit.<\/p>\n<p style=\"margin-left:11%;\"><b>\u2212V, \u2212\u2212version<\/b><\/p>\n<p style=\"margin-left:22%;\">Display version information and exit.<\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>switch_root<\/b> returns 0 on success and 1 on failure.<\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">switch_root will fail to function if <b>newroot<\/b> is not the root of a mount. If you want to switch root into a directory that does not meet this requirement then you can first use a bind-mounting trick to turn any directory into a mount point:<\/p>\n<p style=\"margin-left:22%; margin-top: 1em\">mount &#8211;bind $DIR $DIR<\/p>\n<h2>AUTHORS <a name=\"AUTHORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Peter Jones <pjones@redhat.com> Jeremy Katz <katzj@redhat.com> <br \/> Karel Zak <kzak@redhat.com><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>chroot<\/b>(2), <b>init<\/b>(8), <b>mkinitrd<\/b>(8), <b>mount<\/b>(8)<\/p>\n<h2>AVAILABILITY <a name=\"AVAILABILITY\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The switch_root command is part of the util-linux package and is available from https:\/\/www.kernel.org\/pub\/linux\/utils\/util-linux\/.<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  switch_root \u2212 switch to another filesystem as the root of the mount tree <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,4,311],"class_list":["post-3168","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-man8","tag-switch_root"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3168"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3168\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}