chroot command is useful when we would like to enter an os that mounted into some directory without a real boot at it. For example, my os is damaged. I can’t boot into it. I use cd installation for helping me run the computer. I am talking slackware cd installation and slackware os.
after I got to the prompt, rather than I re-installed the os I just created a directory named sugi. Then I mounted /dev/sda1 (my slackware partition) to sugi
#mount /dev/sda1 sugi
It is time to use chroot
Now i am inside the slackware os. I might do something like re-write the boot manager (lilo.conf) into the MBR. Or in Ubuntu, we might updating the repository.
How about the internet connection when we need it?
Basically the internet is on. But we can not just use it. We need to edit /etc/resolv.conf with the dns in the host OS. For example I use opendns os 126.96.36.199
ctrl+o to save the change
Test the connection with ping to somewhere like www.google.com.
The internet is now work.