3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

GentooLinux Install Memo

Posted at

GentooLinux_Install Memo

準備

1)メディアブートする
wget https://bouncer.gentoo.org/fetch/root/all/releases/amd64/autobuilds/20210530T214502Z/install-amd64-minimal-20210530T214502Z.iso
2)sshd起動
/etc/init.d/sshd start;
rootパスワード設定
passwd root;
<パスワード設定>
4)ネットワーク確認(DHCPで自動設定される)
ifconfig -a;

パーティション作成

parted /dev/sda
mklabel gpt
unit mib
mkpart grub 1 3
set 1 bios_grub on
mkpart boot 3 1000
set 2 boot on
mkpart swap 1000 2000
mkpart rootfs 2000 -1

ファイルシステム作成

mkfs.ext4 /dev/sda2
mkswap /dev/sda3
swapon /dev/sda3
mkfs.ext4 /dev/sda4

マウント

mount /dev/sda4 /mnt/gentoo/
mkdir /mnt/gentoo/boot
mount /dev/sda2 /mnt/gentoo/boot/
ls /mnt/gentoo

時刻設定

date
hwclock

stage tarball ダウンロード

cd /mnt/gentoo
links https://www.gentoo.org/downloads/mirrors/
JP -> HTTP releases -> amd64 -> autobuilds -> current-stage3-amd64 -> releases -> amd64 -> autobuilds -> current-stage3-amd64 -> stage3-amd64-201XXXXXT214502Z.tar.xz
tar xvJpf stage3-amd64-20210530T214502Z.tar.xz --xattrs

マウント

cp -L /etc/resolv.conf /mnt/gentoo/etc/
mount -t proc /proc /mnt/gentoo/proc/
mount --rbind /sys /mnt/gentoo/sys/
mount --make-rslave /mnt/gentoo/sys/
mount --rbind /dev /mnt/gentoo/dev/
mount --make-rslave /mnt/gentoo/dev/

chroot

chroot /mnt/gentoo /bin/bash
source /etc/profile

portage

emerge-webrsync
emerge --sync
eselect profile list

vi インストール

USE="-X" emerge -av vim

fstab

e2label /dev/sda2 boot
e2label /dev/sda4 root
e2label /dev/sda2

swapoff /dev/sda3
mkswap -L swap /dev/sda3
swapon LABEL=swap

vi /etc/fstab
LABEL=boot    /boot       ext4    noauto,noatime  1 2
LABEL=root    /           ext4    noatime         0 1
LABEL=swap    none        swap    sw              0 0

パスワード

passwd
<パスワード設定>

locale

vi /etc/locale.gen
#C.UTF8 UTF-8
ja_JP.UTF-8 UTF-8
locale-gen
eselect locale list
eselect locale set 4

kernel

emerge -av pciutils
emerge -av gentoo-sources
cd /usr/src/linux
make menuconfig
make && make modules_install
make install

initframfs

emerge -av genkernel
genkernel --install initramfs

ブートローダ

emerge -av grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

その他のシステムツール

emerge -av metalog
rc-update add metalog default
emerge -av fcron
rc-update add fcron default
crontab /etc/crontab
emerge -av mlocate
emerge -av dhcpcd
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?