Saving%20Your%20Ass(ets)%20with%20chroot - PowerPoint PPT Presentation

About This Presentation
Title:

Saving%20Your%20Ass(ets)%20with%20chroot

Description:

Normally you're out of luck, to a degree, or need to deal with accessing things ... env-update # gentoo only. update environment settings. How To Use chroot 4 ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 14
Provided by: nyet
Learn more at: http://www.nyetwork.org
Category:

less

Transcript and Presenter's Notes

Title: Saving%20Your%20Ass(ets)%20with%20chroot


1
Saving Your Ass(ets) with chroot
  • Alan Bailward ltalan_at_ufies.orggt
  • April 15, 2004
  • For the Fraser Valley Linux Users Group

2
What is chroot?
  • Allows running of commands with an arbitrary root
    directory
  • Syntax chroot NEWROOT command
  • Used to jail applications
  • Mostly used for security applications
  • i.e. servers

3
Getting in Trouble
  • Easy to have Linux problems
  • Errors on install
  • Broken kernel
  • Broken lilo
  • Normally youre out of luck, to a degree, or need
    to deal with accessing things from a BootCD

4
Getting Out of Trouble
  • The old way

5
The Old way
  • Get to your system
  • Floppy
  • BootCD
  • Fix it
  • Mess with lilo/lilo.conf
  • Compile kernel, hope it works

6
Getting Out of Trouble
  • The New Way

7
Using chroot
  • Lets you access your system as it was
  • Full access to accurate /proc and /dev
  • No funky pathing
  • Easy to jump in and out of

8
How To Use chroot 1
  • Boot with BootCD
  • mkdir /mnt/new
  • mount /dev/hda1 /mnt/new
  • mount /dev/hda2 /mnt/new/boot
  • mount /dev/hda3 /mnt/new/var

9
How To Use chroot 2
  • mount -o bind /proc /mnt/new/proc/
  • link the real /proc into your new file
    structure
  • mount -o bind /dev /mnt/new/dev/
  • ditto for /dev (only for devfs systems)

10
How To Use chroot 3
  • cp /etc/resolv.conf /mnt/new/etc/
  • need accurate network info
  • chroot /mnt/new /bin/bash
  • enter the system
  • env-update gentoo only
  • update environment settings

11
How To Use chroot 4
  • You are now in a shell that is your old system
  • cd / puts you in your old / (really /mnt/new/)
  • Can run lilo, compile kernels, etc
  • To exit, type exit to exit, then unmount disks
    and reboot

12
Live Demo
13
Questions?
Write a Comment
User Comments (0)
About PowerShow.com