On 5 February 2016 at 12:49, Michael Fothergill <
[email protected]> wrote:

>
>
> On 5 February 2016 at 12:30, Mirko Parthey <[email protected]> wrote:
>
>> On Thu, Feb 04, 2016 at 06:05:50PM -0600, Dutch Ingraham wrote:
>> > I'm not sure debootstrap is what you are looking for here.  If you just
>> > want to chroot into your Ubuntu,on the same disk, these are the steps:
>> >
>> > 1. Make a mount point, say /mnt/ubuntu;
>> >
>> > 2. Mount the partition Ubuntu is on, e.g., <mount /dev/sda3
>> /mnt/ubuntu>;
>> >
>> > 3. Change directory to /mnt/ubuntu;
>> >
>> > 4. <mount -t proc proc proc/>;
>> >
>> > 5. <mount --rbind /sys sys/>;
>> >
>> > 6. <mount --rbind /dev dev/>;
>> >
>> > 7. <mount --rbind /run run/>;
>> >
>> > 8. <cp /etc/resolv.conf etc/resolv.conf>;
>> >
>> > 9. <chroot /mnt/ubuntu /bin/bash>;
>> >
>> > 10. <source /etc/profile>;
>> >
>> > 11. <source ~/.bashrc>;
>> >
>> > 12. <export PS1="(chroot) $PS1"
>> >
>> > Of course, you will need to determine certain things up front and
>> modify for
>> > your particular needs, i.e., which partition Ubuntu is currently
>> residing on,
>> > whether you need network access, etc.
>
>
​If wanted a network connection could I add in /sbin/dhcpd as a command
etc?​

​MF​

Some of these commands will need to
>> > be customized/omitted based upon those needs.
>>
>> This is good advice, and these steps can be automated with the schroot
>> package.
>>
>> For any non-trivial operations inside your guest systems, such as
>> installing packages or running daemons, I can recommend Linux containers
>> (lxc or libvirt-lxc).
>
>
> ​I want to install openrc in an install where it can't boot up because I
> deleted it by mistake.  If I use e.g. lxc how many of the above commands do
> I need to enter into it - does it sniff out existing partitions and create
> appropriate mount points by itself etc?​
>
> ​Many thanks for helping me with this.
>
> MF​
>
>
>
>> They look like a fully booted Linux system, but
>> have low virtualization overhead because they use the host's kernel,
>> still they have better isolation from the host system compared to the
>> chroot solution.
>>
>> Regards,
>> Mirko
>>
>>
>
>
>
>
>
>


-- 
Climostat Ltd

Rm 5169
The Heath Business & Technical Park
The Heath
Runcorn
Cheshire
WA7 4QX

Tel. 01 928 515 015

Reply via email to