Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Setup CHROOT
- # =============
- ## copy 7 commands below then paste:
- ## Change /dev/sdxY to actual partition value eg. /dev/sda5
- sudo mount /dev/sdxY /mnt/
- sudo mount --bind /dev /mnt/dev
- sudo mount --bind /proc /mnt/proc
- sudo mount --bind /sys /mnt/sys
- sudo mount --bind /dev/pts /mnt/dev/pts
- If networking is needed: Open a new terminal and ->
- sudo cp /mnt/etc/hosts /mnt/etc/hosts.old
- sudo cp /etc/hosts /mnt/etc/hosts
- sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
- exit
- (The exit command at the end closes the new tab/window.)
- sudo chroot /mnt/ /bin/bash
- # =============
- # Remove CHROOT
- # =============
- ## Ctrl+d to exit chroot,
- ## copy 6 commands below then paste.
- to restore the old hosts file if networking were inabled ->
- cp /etc/hosts.old /etc/hosts
- sudo umount /mnt/dev/pts
- sudo umount /mnt/sys
- sudo umount /mnt/proc
- sudo umount /mnt/dev
- sudo umount /mnt
- *side note :/etc/resolv.conf is nowadays managed by resolvconf, it'll automatically be generated when using NetworkManager and can safely be removed using rm /etc/resolv.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement