Talk:Change root

From ArchWiki
Revision as of 12:54, 12 July 2013 by Doru001 (talk | contribs) (Example)
Jump to: navigation, search


I posted an example of a chroot in a home directory. If you can complete it or correct it, please do. If you can't, please don't remove it.

The example has been modified from /usr/bin/bash to /bin/bash, even though:

$ which bash

How is it on your system, /bin/bash or /usr/bin/bash?

Very well, this is quite amazing:

$ ls -l /bin/bash /usr/bin/bash
-rwxr-xr-x 1 root root 713872 Jun  1 03:26 /bin/bash
-rwxr-xr-x 1 root root 713872 Jun  1 03:26 /usr/bin/bash
$ cmp /bin/bash /usr/bin/bash
$ echo $?

--Doru001 (talk) 11:09, 10 July 2013 (UTC)

I changed this because you cannot use /usr/bin/bash as the user's shell (useradd -s command) in normal circumstances. The user would not be able to login because /usr/bin/bash is not in /etc/shells by default. In a chroot it may not matter (assuming the useradd command even works, I know chsh will not let you change to a shell not in /etc/shells but not sure about useradd), but there's no reason to use /usr/bin/bash and it can cause problems for anyone coming across the command and using it for something else. /bin/bash is the correct way to access bash is most circumstances.
--Scimmia (talk) 13:43, 10 July 2013 (UTC)
Very well, I still don't understand this /etc/shells completely, but what you say makes sense. Doru001 (talk) 16:12, 11 July 2013 (UTC)
The big thing is, /usr/bin/bash was not coming from me, but from 13:06, 4 June 2013‎ Wide-eye. Doru001 (talk) 12:54, 12 July 2013 (UTC)


  • Is it possible to have multiple Chroots on the same target device? --unknown
  • Is the "Run graphical chrooted applications" section really necessary? I have chrooted from an x86_64 distribution (Parted Magic) into my current i686 Arch system and running graphical applications worked just fine. All I had to do was to start them from the chroot terminal. Seems like an unnecessary piece of information to me. --DSpider (talk) 10:02, 19 August 2012 (UTC)
  • Can chroot be used to update the entire root file system? After the chroot, running the mount command reports /dev/root on / type ext3 with /dev/root being a symbolic link to /dev/mmcblk0p2. Unmounting /dev/root and /dev/mmcblk0p2 both report invalid argument. Rereading the partition table using blockdev --rereadpt /dev/mmcblk0 reports device or resource busy. My guess it mmcblk0 is busy because /dev/mmcblk0p2 is still the root file system under the changed root file system I am using now. Before doing a chroot, I kills all the applications but the shell used to run chroot. Any suggestions on how I can successfully reread the partition table in this use model? --Tfischer