Results 1 to 2 of 2

Thread: Problems using chroot into bt rc2 (Probably just me...)

  1. #1
    Member Israel213's Avatar
    Join Date
    Apr 2008

    Default Problems using chroot into bt rc2 (Probably just me...)

    Had a problem the other day. For some reason I couldn't install an app with removing some packages and lost X. Being that I'm impatient I thought it might be easier to re-install bt4 than try and trouble shoot why I have no desktop. Anyway, I didn't realize when I re-installed I overwrote my drivers. One of which (I really need for internet) I have to get from debian. But only seems to work if I briefly edit my apt sources.list. Alone dpkg -i just throws erros. But since I have no internet I thought I'd pop out a debian livecd(where my card is automatically detected) and use chroot to get a shell in bt and get the driver in question.

    My problem:
    So I used "chroot /mnt/bt" and things seemed to be working great until I tried to actuall install with apt-get:

    dpkg-preconfigure: unable to re-open stdin: 
    Can not write log, openpty() failed (/dev/pts not mounted?)
    I remembered coming across this and thought from the debian shell I could use this to fix it:
    # mount --bind /dev/pts /mnt/bt/dev/pts
    mount: mount point /mnt/bt/dev/pts does not exist
    Seeing the directory didn't exist I looked inside /dev/ only to find "null"
    # mount --bind /dev/pts /mnt/bt/dev/pts
    mount: mount point /mnt/bt/dev/pts does not exist
    I'm thinking I must be missing something, but the first step from the ubuntu tutorial I linked didn't seem to work either. Any help, much appreciated.

  2. #2
    Senior Member iproute's Avatar
    Join Date
    Jan 2010
    Midwest, USA

    Default Re: Problems using chroot into bt rc2 (Probably just me...)

    Perhaps consider looking at the gentoo installation handbook. When chrooting during gentoo installation, you have some mounting to do like /dev and /proc as well as updating your environment variables. I'm not sure how different the process with BT might be, but it should be relatively similar.

    6. Installing the Gentoo Base System

    6.a. Chrooting

    Optional: Selecting Mirrors

    In order to download source code quickly it is recommended to select a fast mirror. Portage will look in your make.conf file for the GENTOO_MIRRORS variable and use the mirrors listed therein. You can surf to our mirror list and search for a mirror (or mirrors) close to you (as those are most frequently the fastest ones), but we provide a nice tool called mirrorselect which provides you with a nice interface to select the mirrors you want.

    Code Listing 1.1: Using mirrorselect for the GENTOO_MIRRORS variable
    # mirrorselect -i -o >> /mnt/gentoo/etc/make.conf
    A second important setting is the SYNC setting in make.conf. This variable contains the rsync server you want to use when updating your Portage tree (the collection of ebuilds, scripts containing all the information Portage needs to download and install software). Although you can manually enter a SYNC server for yourself, mirrorselect can ease that operation for you:

    Code Listing 1.2: Selecting an rsync mirror using mirrorselect
    # mirrorselect -i -r -o >> /mnt/gentoo/etc/make.conf
    After running mirrorselect it is adviseable to double-check the settings in /mnt/gentoo/etc/make.conf !

    Note: If you want to manually set a SYNC server in make.conf, you should check out the community mirrors list for the mirrors closest to you. We recommend choosing a rotation, such as, rather than choosing a single mirror. This helps spread out the load and provides a failsafe in case a specific mirror is offline.
    Copy DNS Info

    One thing still remains to be done before we enter the new environment and that is copying over the DNS information in /etc/resolv.conf. You need to do this to ensure that networking still works even after entering the new environment. /etc/resolv.conf contains the nameservers for your network.

    Code Listing 1.3: Copy over DNS information
    (The "-L" option is needed to make sure we don't copy a symbolic link)
    # cp -L /etc/resolv.conf /mnt/gentoo/etc/
    Mounting the /proc and /dev Filesystems

    Mount the /proc filesystem on /mnt/gentoo/proc to allow the installation to use the kernel-provided information within the chrooted environment, and then mount-bind the /dev filesystem.

    Code Listing 1.4: Mounting /proc and /dev
    # mount -t proc none /mnt/gentoo/proc
    # mount -o bind /dev /mnt/gentoo/dev
    Entering the new Environment

    Now that all partitions are initialized and the base environment installed, it is time to enter our new installation environment by chrooting into it. This means that we change from the current installation environment (Installation CD or other installation medium) to your installation system (namely the initialized partitions).

    This chrooting is done in three steps. First we will change the root from / (on the installation medium) to /mnt/gentoo (on your partitions) using chroot. Then we will create a new environment using env-update, which essentially creates environment variables. Finally, we load those variables into memory using source.

    Code Listing 1.5: Chrooting into the new environment
    # chroot /mnt/gentoo /bin/bash
    # env-update
    >> Regenerating /etc/
    # source /etc/profile
    # export PS1="(chroot) $PS1"
    Congratulations! You are now inside your own Gentoo Linux environment. Of course it is far from finished, which is why the installation still has some sections left :-)
    Bear in mind I'm using the gentoo example simply because I know it works and have done it many times. Copying the DNS info shouldnt be needed in your scenario I think, and mirrorselect is not relevant to backtrack. I'm hazarding a guess that only the directory structures will likely be different. The other commands should really all be core linux stuff.
    Last edited by iproute; 02-06-2011 at 10:01 PM.

Similar Threads

  1. Replies: 2
    Last Post: 07-19-2010, 11:54 AM
  2. chroot error ....??
    By imported_fridash in forum OLD BackTrack 3 Final
    Replies: 2
    Last Post: 12-25-2008, 06:57 AM
  3. Chroot error - can't find /bin/bash
    By Smickus in forum OLD Newbie Area
    Replies: 3
    Last Post: 12-21-2008, 04:43 PM
  4. chroot problem solved................
    By manjurainbow123 in forum OLD Newbie Area
    Replies: 1
    Last Post: 09-08-2008, 11:02 PM
  5. chroot
    By calypso in forum OLD Newbie Area
    Replies: 4
    Last Post: 08-31-2008, 01:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts