Install Gentoo on a bootable USB stick/ko

USB 메모리 스틱으로 젠투를 부팅하는 방법은 정말 쉽습니다. 주로 해볼만한 과정은 모든 머신에서 젠투를 부팅할 수 있게 초기화 램 디스크를 설정하는 부분입니다. 이 글에서는 어떤 컴퓨터에서든 USB 메모리 스틱으로 젠투를 설치하는 방법을 설명합니다. 이 설치 과정은 보통의 데스크톱 설치 과정과 유사하며 이렇게 바꾼 내용은 계속 남아있습니다.

준비
몇가지 꾸러미를 설치하는 과정으로 시작하겠습니다. 여기서 중요한 대부분의 요소는 커널과 꾸러미입니다.

꾸러미별 USE 플래그를 추가하려면 에 새 파일을 만드십시오:

이제 꾸러미를 설치하십시오:

커널 컴파일
커널에 필요한 설정을 적용하고 컴파일 하십시오. 과정상 자세한 내용은커널 설정과 커널 설정 안내서를 참고하십시오. 여기서는 일반 커널이 더 많은 머신에서 부팅할 테므로 일반 커널을 활용하는게 좋음을 확실히 기억해두십시오.

During the configuration, it is of course possible to compile modules as these will be included in the initramfs and loaded at boot.

The above command will take some time as it will build the default kernel, create a ramdisk and then copy all files into.

USB 메모리 스틱 준비
Create 2 partitions on the drive (assuming the installation will have a and a  (root) partition). We assume that the USB stick is at (run dmesg immediately after plugging in the USB stick to see which device is being used).

첫번째 분할 공간을 부팅이 가능하게(명령으로 부팅 플래그 상태를 바꿈)했는지 확인하십시오

Now format the new partitions. In the example we use the ext2 file system but another file system for the partition can be used if it is supported in the kernel. Notice that during the formatting operation, a label is assigned to the partitions. This is important because it will be how the root file system is detected later as the USB stick can be booted on systems where the drive letter allocation is completely different. This is related to the  option of the genkernel command line earlier.

젠투 스테이지 3 설치
With the kernel, ramdisk and file systems ready, we now need the minimal installation to be performed. This includes a fresh stage3 as well as a Portage tree snapshot.


 * current-stage3
 * portage-latest

For this example and  are used. This next bit is the same as in the handbook for installing Gentoo.

The sections below cover those aspects of a Gentoo Linux installation that are specific to installing on an USB stick. It is recommended to use the Gentoo handbook instructions while keeping an eye on this article.

부트로더
In order to boot the new system, install a bootloader on the USB stick.

The below sections give example configurations for lilo and syslinux.

lilo
lilo를 (chroot 한 상태에서) 이머지하십시오:

파일을 편집하여 올바른 정보가 들어가도록 하십시오.

The lines after image are all easy but the append line contains some interesting options.


 * will use the label of the disk instead of which is important because these device numbers move around depending on the number of hard disks in the computer or number of USB disk drives.
 * Also important for USB booting is the  option, as USB devices need a little time to be detected by the kernel; that is what this option is for. When there are lots of modules booting takes a long time so it probably does not matter, but if there are only a few modules loaded then it is important, because the system could have booted before the kernel detects the USB device. Also, on newer machines with USB3 controllers it is necessary to add the xhci_hcd driver (built into the kernel or as a module).

이제 LILO(및 설정)를 USB 메모리 스틱에 설치하십시오:

The first warning is to be expected as we are not installing the boot loader onto the hard disk in the computer. The second warning will only cause a problem on machines that are old; if it is a problem try cutting down the kernel by removing modules.

syslinux
Put the boot sector onto the USB stick.

이제 부트로더를 설정하겠습니다.

Next install syslinux onto the USB stick. The  option is not absolutely necessary though.

요령
Although it is possible to use the system just made as a standard Gentoo system, it might be worthwhile to compile binary packages on a host and then installing them on the USB stick. Or if the system has enough memory just mount to a tmpfs, as compilation will be much quicker that way anyway!