What to do after changing the root directory (chroot).

Hi all,

Using a USB Flash device installation, I mark the my HDD.
For example, I have identified one large slice.
Code:
/dev/gpt/f9boot    freebsd-boot
/dev/gpt/f9swap    freebsd-swap
/dev/gpt/f9root    freebsd-ufs

Now, I format and I connect the root partition.
Code:
# newfs -j /dev/gpt/f9root
# mkdir -p /mnt/f9
# mount /dev/gpt/f9root /mnt/f9

Now I install the OS.
Code:
# cd /usr/freebsd-dist/
# cat base.txz | tar --unlink -xpJf - -C /mnt/f9/
# cat kernel.txz | tar --unlink -xpJf - -C /mnt/f9/

Create /mnt/f9/etc/fstab.
Now, if I will restart my computer, my OS will work!

But I do not want to restart the computer. I want to continue to settings my Os.

In Linux Gentoo I've done this:
Code:
# chroot /mnt/gentoo /bin/bash
# env-update
>> Regenerating /etc/ld.so.cache...
# source /etc/profile

Now I'm trying to do with FreeBSD.
Code:
# chroot /mnt/f9 /bin/sh

I check the result.
Code:
# vi /etc/fstab
- yes opened my fstab that I wrote earlier how /mnt/f9/etc/fstab. The root directory changed successfully!

In Gentoo, we update the environment variables, and began to work with the new root directory.
Code:
# env-update

I'm trying to do this:
Code:
# rehash
rehash: not found

This means that I have not started the new OS. How to fix it?
How to continue to work without restarting my computer? Is it possible?
 
In principle, I can work and so (though limited, although it is said in the textbooks: "chroot(8) allows you to run applications in a limited environment").
I recommend another plug /dev slice,
Code:
# mount -t devfs /dev /mnt/f9/dev
# chroot /mnt/f9 /bin/sh

- After, I spend my internet settings and install programs (now successfully setting the Internet, but the program has not yet set. I should first install the ports collection).

In this matter I have considered: env, printenv, set, setenv. But analog Gentoo env-update and have not found.
 
doorways said:
Code:
# chroot /mnt/f9 /bin/sh

I check the result.
Code:
# vi /etc/fstab
- yes opened my fstab that I wrote earlier how /mnt/f9/etc/fstab. The root directory changed successfully!

I'm trying to do this:
Code:
# rehash
rehash: not found

rehash is for csh(1), but you ran sh(1).

This means that I have not started the new OS.

chroot(8) does not start the new OS, it merely changes how the currently running OS sees directories.
 
wblock @, I'm sorry that is not on the subject. I see that you have written under the nick-name "FreeBSD Developer" - perhaps you can help me with this topic.
 
Back
Top