• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

Chroot A Boot Disk

August 19, 2019

Here’s a quick way to chroot another boot disk. Attach the rescued boot disk first. Run lsblk and mount.

lsblk
mount -t xfs -o nouuid /dev/xvdf2 /mnt
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
mount --bind /dev /mnt/dev
chroot /mnt
cd /mnt
exit

lsblk mount -t xfs -o nouuid /dev/xvdf2 /mnt mount --bind /proc /mnt/proc mount --bind /sys /mnt/sys mount --bind /dev /mnt/dev chroot /mnt cd /mnt exit

Unmount when done.

umount /mnt/proc
umount /mnt/dev
umount /mnt/sys
umount /mnt

umount /mnt/proc umount /mnt/dev umount /mnt/sys umount /mnt

Filed Under: Cloud, Linux Tagged With: attach, chroot, disk, rescue

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023