HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pivot_root — Change the root filesystem to a new directory and move the current root to a subdirectory of the new

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandnewpivot_rootclichangefilesystemroot
linux

Problem

How to use the pivot_root command: Change the root filesystem to a new directory and move the current root to a subdirectory of the new root. Commonly used during system initialization (e.g., in initramfs) to switch from a temporary root to the real root filesystem. More information: <https://manned.org/pivot_root.8>.

Solution

pivot_root — Change the root filesystem to a new directory and move the current root to a subdirectory of the new root. Commonly used during system initialization (e.g., in initramfs) to switch from a temporary root to the real root filesystem. More information: <https://manned.org/pivot_root.8>.

Make /new_root the new root (/) and move current root to a subdirectory of it:
sudo pivot_root {{path/to/new_root}} {{path/to/new_root/old_root}}


Display help:
pivot_root {{[-h|--help]}}

Code Snippets

Make `/new_root` the new root (`/`) and move current root to a subdirectory of it

sudo pivot_root {{path/to/new_root}} {{path/to/new_root/old_root}}

Display help

pivot_root {{[-h|--help]}}

Context

tldr-pages: linux/pivot_root

Revisions (0)

No revisions yet.