0

I have an Ubuntu 14.04 LiveCD and the full Ubuntu 14.04 install on a bootable USB hard drive. I have g++ installed on the hard drive, but I need to use the hard drive for sneakernet. Is there a way to run g++ off the hard drive when I've booted off the CD?

Edit: if it makes any difference, gcc is included with Ubuntu but g++ isn't, so I installed build-essentials to the hard drive.

2 Answers 2

1

Since you have the exact same same Ubuntu version installed on both the liveCD and external USB device ... you might be able to get away with the following:

  1. Mount your USB device somewhere (for the example I'm using /mnt/your_USB_device though it will probably be somewhere on /media...)

  2. Then, from a root terminal:

for f in dev dev/pts proc sys; do mount -o bind /$f /mnt/your_USB_device/$f; done

chroot /mnt/your_USB_device /bin/bash

You'll have a root prompt that's essentially running Linux from your external drive. Try running g++ and see if it works. Good luck.

0

I'm trusting that the hard drive is also Linux.

You can mount the hard drive as a directory to your live CD. You must mount it somewhat like this:

mount /dev/sda1 /mnt

But the actual values will vary with your hardware. Then, you have to declare the path to mnt/usr/bin to be part of the executable search path, and then you have to declare the path to gcc's libraries as part of the search path for libraries.

In short: it's not entirely easy. And it might not even work, if there are major incompatibilities between the gcc version and your Live CD.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .