Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-29-2007, 05:01 AM   #1
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Rep: Reputation: 30
chroot query.

I found this example of chroot usage and was wondering if anyone could kindly answer my question in order for me to understand the command and its workings.


this isn't the only way to change the root password on a system.

This way kind of mixes both of the methods described on this page:

You can boot using a LiveCD, then via a root terminal, you can chroot into your system after mounting it:

sudo su
mkdir /mnt/hd
mount /dev/hda2 -t ext3 /mnt/hd
chroot /mnt/hd

Once you've filled in your password, it's done. Your root password is changed.
So once you've chrooted to a system you are using the commands found on that system and not the commands on your liveCD ? For example if there is a binary called in the system's /usr/bin directory I could execute that if I was chrooted into the system ?
Would "breaking out" of the above chroot simply involve unmouting the system ? One could easily carry on unaware that the system in chrooted and then wonder why certain commands which are housed on liveCD are not able to run.

Thanks again,

Last edited by uncle-c; 11-29-2007 at 06:24 AM.
Old 11-29-2007, 07:29 AM   #2
LQ 5k Club
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
You have a quoted one main use of a live cd.

On RIP live issue "exit' command to terminate the chroot environment and then and only then can you umount the relevant hard drive partition.

by defination, a person in chroot can not umount what is currently mounted....they can only work from within their new set of rules....the chroot environment knows nothing about the fact you mounted some partition under /mnt/hd or / all looks like / to it.

To repeat you can not break out....except on a live cd...try exit.

2) what you are probably thinking about is chroot jails on hard drive systems


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql use output of one query in another query secretlydead Programming 2 11-19-2007 01:25 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
help with mysql query: return nth rows in query hawarden Programming 2 07-31-2006 06:36 PM
mount command not working in chroot. and now chroot not working mohit.jain Linux From Scratch 5 07-14-2006 03:57 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration