Ubuntu – debootstrap failing to mount /proc

64-bitchrootdebootstrapmountsystem-installation

I have researched this, and none of the answers (so far) on here, nor googling seem to match my problem.

Here is the situation:

I am running Xubuntu 12.04 as a base install, and am trying to set up a debootstrap chroot install of BackBox 3.01 (also a 12.04). BOTH are amd64 bit architectures and I have verified that fact backwards and forwards.

I have followed the instructions at both:

https://help.ubuntu.com/community/DebootstrapChroot
https://unix.stackexchange.com/questions/12956/how-do-i-run-32-bit-programs-on-a-64-bit-ubuntu/12957#12957 (thanks Giles!)

RTFM and fat-fingering issues aside, I have now run into an issue during the debootstrap installation where I am getting to a point and getting:

W: Failure trying to run: chroot /home/user/test/chroot mount -t proc proc /proc

The installation that lays down is not enough to schroot to, as I have tried, nor if I redo with the –foreign option does it do any better.

The research I have done seems to indicate this issue is related to:

  1. trying to put a 64 bit install in a 32 bit OS (which I am clearly NOT doing)

  2. possible issues with procfs in certain kernels, but the bug reports are unclear, and clearly this looks old

  3. a lot of virtualization related issues (which I am not doing any)

I am thinking since this is a very simple installation of a file:/// based (another) ubuntu based distro into my chroot environment (64 -> 64) that there must be something real simple in the set up steps I have left out or forgotten. Should I do something like pre-mount the /srv/chroot/backbox3_01/var/proc to something like:

sudo mount -o bind /proc /srv/chroot/backbox3_01

Any help would be appreciated.

****** UPDATE *******
So I have dug around a bit more, and I at least know what part of the issue is. The failure is coming from the fact that "mount" is an unknown "file or directory" which means that at the context point that chroot is running from there is no "mount" executable that can be called. I am guessing that:

a. Some executable context did not get brought over and "pre" set up properly during the phase before this step?

or

b. Some environment properties need to be exported prior to running this script maybe?

or

c. ??

Any help is appreciated…

*********** Further Update ***************
Apparently the Backbox installation is not getting inflated into the chroot directory anywhere near properly. Backbox 3 is a precise (Ubuntu 12.04) based distro and I just ran debootstrap on precise. I get a full installation.

When I do the same for Backbox, I only get /dev, /etc, and /var set up. Nothing else, which means "mount" doesn't exist in the chroot'ed structure. I have tried installing this from the CD and from a local copy of the CD (on my file system). I have checked the "Release" doc on the installation CD and it seems complete, but I don't see why it stops before installing the rest of the components.

So I am guessing there is something in the Backbox Distro that is not set up to allow debootstrap to properly re-inflate it – at least from the CD distro. Does anyone know of an online archive (equivalent to http://archive.ubuntu.com/ubuntu/) for Backbox? Or if not, I guess my options are going to be:

  1. Hacking the Backbox Distro to make it work, any suggestions where to start?

  2. Pulling down an Xubuntu distro and then applying the Backbox ppa… Is there a Xubuntu script available for debootstrap and does anyone have a link to an automated installer for all the BB ppa tools to get them installed quickly?

🙁

Best Answer

In my system that happens with every Ubuntu/Backbox I have tried. It seems that the CD cannot be used as a repository (see here), which makes sense: debootstrap should need a path to a repository (some local/remote folder with a predefined structure, and .deb archives) and the Ubuntu/Backbox comes with a squashfs (basically a image with a base system in it).

As Backbox seems to be just Ubuntu 12.04 (it uses as source of packages http://archive.ubuntu.com) and some additional repositories, I think you have two options here:

  1. Create a basic Ubuntu chroot and then install all the needed software: you can provide debootstrap with a script to add the PPA's, install the software, etc.

  2. Extract the squashfs: you will need to mount the ISO, then mount the squashfs in it and finally copy the root filesystem:

    sudo mount /path/to/backbox.iso <bb_mount_point>
    sudo mount -t squashfs <bb_mount_point>/casper/filesystem.squashfs <squash_mount_point>
    sudo cp -rxv <squash_mount_point> <chroot_destination>
    

I have not tried any of those so I can't assure you any will work. Also a valid way to achieve this would be install BB on a virtual machine (you can use QEMU/KVM/etc) and then copy the root filesystem to whenever you need it.

Good luck.

Related Question