LoginSignup
4
5

More than 5 years have passed since last update.

年末なので #gentooinstallbattle 実況しつつPlay2の開発環境作ります。(その1:OSインストール編)

Last updated at Posted at 2013-12-30

年末とか関係なく恒例 #gentooinstallbattle しましょうということで、今回はVirtualBox上にGentoo Linuxをインストールし、Scala+Play2の開発環境を作る様子を実況します。
その2はこちら


追記枠


本編はこちら

Screen Shot 2013-12-30 at 2.26.50 PM.png

起動時のパラメータはこんな感じ。

Screen Shot 2013-12-30 at 2.40.29 PM.png

起動したのでネットワークの確認。

Screen Shot 2013-12-30 at 2.43.50 PM.png

無事 ping が届きました。
NAT+Host Only Adapterは、MACアドレス制限とかでBridge使えない環境でも使えるので便利。
※ちなみに Ardbeg はVM親 兼 ssh接続元 兼 Qiita更新用 端末です。

[mazgi@Ardbeg] $ ping -c 2 192.168.56.102
PING 192.168.56.102 (192.168.56.102): 56 data bytes
64 bytes from 192.168.56.102: icmp_seq=0 ttl=64 time=0.437 ms
64 bytes from 192.168.56.102: icmp_seq=1 ttl=64 time=0.365 ms

--- 192.168.56.102 ping statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.365/0.401/0.437/0.036 ms

ここでネットワークの疎通が確認できなければ net-setup を使います。

ネットワークの疎通が確認できたので sshd を起動し、手元の端末からsshログインします。
Screen Shot 2013-12-30 at 2.50.24 PM.png

[mazgi@Ardbeg] $ ssh 192.168.56.102 -lroot
The authenticity of host '192.168.56.102 (192.168.56.102)' can't be established.
RSA key fingerprint is 15:a6:2e:48:ca:6f:6a:42:06:29:ec:1b:e6:b6:df:63.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.102' (RSA) to the list of known hosts.
Password: 
Welcome to the Gentoo Linux Minimal Installation CD!

The root password on this system has been auto-scrambled for security.

If any ethernet adapters were detected at boot, they should be auto-configured
if DHCP is available on your network.  Type "net-setup eth0" to specify eth0 IP
address settings by hand.

Check /etc/kernels/kernel-config-* for kernel configuration(s).
The latest version of the Handbook is always available from the Gentoo web
site by typing "links http://www.gentoo.org/doc/en/handbook/handbook.xml".

To start an ssh server on this system, type "/etc/init.d/sshd start".  If you
need to log in remotely as root, type "passwd root" to reset root's password
to a known value.

Please report any bugs you find to http://bugs.gentoo.org. Be sure to include
detailed information about how to reproduce the bug you are reporting.
Thank you for using Gentoo Linux!

livecd ~ # 

ログイン成功!
以降はssh経由で #gentooinstallbattle を行います。

sshログインできたので早速パーティションを切ります。
今回はLVMを使ってボリュームを管理するつもりです。
そのほか細かいことは考えてません!

livecd ~ # fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

livecd ~ # fdisk /dev/sda 
Welcome to fdisk (util-linux 2.22.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa4d8a392.

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4d8a392

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 
Using default value 1
First sector (2048-83886079, default 2048): 
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-83886079, default 83886079): +512M
Partition 1 of type Linux and of size 512 MiB is set

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4d8a392

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     1050623      524288   83  Linux

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2): 
Using default value 2
First sector (1050624-83886079, default 1050624): 
Using default value 1050624
Last sector, +sectors or +size{K,M,G} (1050624-83886079, default 83886079): 
Using default value 83886079
Partition 2 of type Linux and of size 39.5 GiB is set

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): L

 0  Empty           24  NEC DOS         81  Minix / old Lin bf  Solaris        
 1  FAT12           27  Hidden NTFS Win 82  Linux swap / So c1  DRDOS/sec (FAT-
 2  XENIX root      39  Plan 9          83  Linux           c4  DRDOS/sec (FAT-
 3  XENIX usr       3c  PartitionMagic  84  OS/2 hidden C:  c6  DRDOS/sec (FAT-
 4  FAT16 <32M      40  Venix 80286     85  Linux extended  c7  Syrinx         
 5  Extended        41  PPC PReP Boot   86  NTFS volume set da  Non-FS data    
 6  FAT16           42  SFS             87  NTFS volume set db  CP/M / CTOS / .
 7  HPFS/NTFS/exFAT 4d  QNX4.x          88  Linux plaintext de  Dell Utility   
 8  AIX             4e  QNX4.x 2nd part 8e  Linux LVM       df  BootIt         
 9  AIX bootable    4f  QNX4.x 3rd part 93  Amoeba          e1  DOS access     
 a  OS/2 Boot Manag 50  OnTrack DM      94  Amoeba BBT      e3  DOS R/O        
 b  W95 FAT32       51  OnTrack DM6 Aux 9f  BSD/OS          e4  SpeedStor      
 c  W95 FAT32 (LBA) 52  CP/M            a0  IBM Thinkpad hi eb  BeOS fs        
 e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a5  FreeBSD         ee  GPT            
 f  W95 Ext'd (LBA) 54  OnTrackDM6      a6  OpenBSD         ef  EFI (FAT-12/16/
10  OPUS            55  EZ-Drive        a7  NeXTSTEP        f0  Linux/PA-RISC b
11  Hidden FAT12    56  Golden Bow      a8  Darwin UFS      f1  SpeedStor      
12  Compaq diagnost 5c  Priam Edisk     a9  NetBSD          f4  SpeedStor      
14  Hidden FAT16 <3 61  SpeedStor       ab  Darwin boot     f2  DOS secondary  
16  Hidden FAT16    63  GNU HURD or Sys af  HFS / HFS+      fb  VMware VMFS    
17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fc  VMware VMKCORE 
18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fd  Linux raid auto
1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid fe  LANstep        
1c  Hidden W95 FAT3 75  PC/IX           be  Solaris boot    ff  BBT            
1e  Hidden W95 FAT1 80  Old Minix      
Hex code (type L to list codes): 8e
Changed system type of partition 2 to 8e (Linux LVM)

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4d8a392

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     1050623      524288   83  Linux
/dev/sda2         1050624    83886079    41417728   8e  Linux LVM

Command (m for help): a
Partition number (1-4): 1

Command (m for help): p

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4d8a392

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624    83886079    41417728   8e  Linux LVM

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
livecd ~ # fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xa4d8a392

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624    83886079    41417728   8e  Linux LVM

/dev/sda だけ物理パーティションで /boot にmountして、その他は全部LVM管理するつもりです。
仮想マシン上の物理パーティションとかややこしいですね、どうでもいい話ですけど。

とりあえず /boot だけ先にフォーマットします。

livecd ~ # mkfs.ext2 /dev/sda1 
mke2fs 1.42.7 (21-Jan-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768 inodes, 131072 blocks
6553 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=134217728
4 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done

/boot にジャーナルなんて必要ない!」主義者なのでext2でフォーマットします。

唯一の物理パーティションのフォーマットが終わったので、次はLVMさんに管理してもらうパーティションを作っていきます。

まずVG(VolumeGroup)を作ります。
VGっていきなり作れるんだっけ…?なんかPV(PhysicalVolume)が先に必要だったような・・・

livecd ~ # vgcreate -h
  vgcreate: Create a volume group

vgcreate
    [-A|--autobackup {y|n}] 
    [--addtag Tag] 
    [--alloc AllocationPolicy] 
    [-c|--clustered {y|n}] 
    [-d|--debug]
    [-h|--help]
    [-l|--maxlogicalvolumes MaxLogicalVolumes]
    [-M|--metadatatype 1|2] 
    [--[vg]metadatacopies #copies] 
    [-p|--maxphysicalvolumes MaxPhysicalVolumes] 
    [-s|--physicalextentsize PhysicalExtentSize[bBsSkKmMgGtTpPeE]] 
    [-t|--test] 
    [-v|--verbose]
    [--version] 
    [-y|--yes]
    [ PHYSICAL DEVICE OPTIONS ] 
    VolumeGroupName PhysicalDevicePath [PhysicalDevicePath...]

あ、やっぱりVG作るときにはPVが存在してなくちゃいけないんですね、そうですよね。
ってことで、さっき fdisk で作った /dev/sda2 を丸っとPVにします。

livecd ~ # pvcreate /dev/sda2 
  Physical volume "/dev/sda2" successfully created

PVにした /dev/sda2 を指定してVGを作ります。

livecd ~ # vgcreate VG00 /dev/sda2 
  Volume group "VG00" successfully created

VGができたらひたすらLV(LogicalVolume)を作ります。
このLVが1つ1つのパーティションに相当します。
今回は、

  • / (LV名: Gentoo)
  • /var (LV名: Var)
  • /usr/portage (LV名: Portage)
  • /home (LV名: Home)
  • swapが1つ (LV名: SWAP00)

くらいでいいかなーと思ってます。

livecd ~ # lvcreate -nGentoo -L8G VG00
  Logical volume "Gentoo" created
livecd ~ # lvcreate -nVar -L8G VG00
  Logical volume "Var" created
livecd ~ # lvcreate -nPortage -L8G VG00
  Logical volume "Portage" created
livecd ~ # lvcreate -nHome -L4G VG00
  Logical volume "Home" created
livecd ~ # lvcreate -nSWAP00 -L1G VG00
  Logical volume "SWAP00" created
livecd ~ # lvdisplay -c
  /dev/VG00/Gentoo:VG00:3:1:-1:0:16777216:2048:-1:0:-1:253:0
  /dev/VG00/Var:VG00:3:1:-1:0:16777216:2048:-1:0:-1:253:1
  /dev/VG00/Portage:VG00:3:1:-1:0:16777216:2048:-1:0:-1:253:2
  /dev/VG00/Home:VG00:3:1:-1:0:8388608:1024:-1:0:-1:253:3
  /dev/VG00/SWAP00:VG00:3:1:-1:0:2097152:256:-1:0:-1:253:4

こんなもんでいいでしょう。

LV(==パーティション)ができたのでフォーマットしていきます。
XFS使おうかなーと思ってたのですが、LXCを使いたくなったときにXFSではUser namespaceが使えないことに気づき、JFSを使ってみることにしました。
ちなみに私がプライベートでファイルシステム選ぶときの規準は、

  • inode割当が固定ではないこと
  • オンラインで拡張可能なこと

くらいです。

まずはSWAPパーティションをSWAPにします。

livecd ~ # mkswap /dev/VG00/SWAP00 
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=d981c01b-4e87-4f64-b9aa-b4e248d97a90

続いて各LVをJFSでフォーマットします。
JFS使ってみるの何年ぶりだろ・・・

livecd ~ # mkfs.jfs /dev/VG00/Gentoo 
mkfs.jfs version 1.1.15, 04-Mar-2011
Warning!  All data on device /dev/VG00/Gentoo will be lost!

Continue? (Y/N) y
   \

Format completed successfully.

8388608 kilobytes total disk space.
livecd ~ # mkfs.jfs /dev/VG00/       
Gentoo   Home     Portage  SWAP00   Var      
livecd ~ # mkfs.jfs /dev/VG00/Home 
mkfs.jfs version 1.1.15, 04-Mar-2011
Warning!  All data on device /dev/VG00/Home will be lost!

Continue? (Y/N) y
   /

Format completed successfully.

4194304 kilobytes total disk space.
livecd ~ # mkfs.jfs /dev/VG00/Portage 
mkfs.jfs version 1.1.15, 04-Mar-2011
Warning!  All data on device /dev/VG00/Portage will be lost!

Continue? (Y/N) y
   \

Format completed successfully.

8388608 kilobytes total disk space.
livecd ~ # mkfs.jfs /dev/VG00/Var     
mkfs.jfs version 1.1.15, 04-Mar-2011
Warning!  All data on device /dev/VG00/Var will be lost!

Continue? (Y/N) y
   \

Format completed successfully.

8388608 kilobytes total disk space.

LVがフォーマットできたのでmountしていきます。
まず / をmountします。
(「 /mnt/gentoo じゃね?」と思われるかもしれませんが、あとでここにchrootするのです)

livecd ~ # mount /dev/VG00/Gentoo /mnt/gentoo/

/ がmountできたら、mount pointに移動して、他のLVをmountするmount pointを作ります。

livecd ~ # cd /mnt/gentoo/
livecd gentoo # mkdir -p boot var usr/portage home 
livecd gentoo # mount /dev/sda1 boot/
livecd gentoo # mount /dev/VG00/Var var/
livecd gentoo # mount /dev/VG00/Portage usr/portage/
livecd gentoo # mount /dev/VG00/Home home/
livecd gentoo # lvdisplay -c
  /dev/VG00/Gentoo:VG00:3:1:-1:1:16777216:2048:-1:0:-1:253:0
  /dev/VG00/Var:VG00:3:1:-1:1:16777216:2048:-1:0:-1:253:1
  /dev/VG00/Portage:VG00:3:1:-1:1:16777216:2048:-1:0:-1:253:2
  /dev/VG00/Home:VG00:3:1:-1:1:8388608:1024:-1:0:-1:253:3
  /dev/VG00/SWAP00:VG00:3:1:-1:0:2097152:256:-1:0:-1:253:4
livecd gentoo # mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=505710,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on / type tmpfs (rw,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
/dev/loop0 on /mnt/livecd type squashfs (ro,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,size=405296k,mode=755)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /mnt/livecd/lib64/firmware type tmpfs (rw)
tmpfs on /mnt/livecd/usr/portage type tmpfs (rw)
/dev/mapper/VG00-Gentoo on /mnt/gentoo type jfs (rw)
/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)
/dev/mapper/VG00-Var on /mnt/gentoo/var type jfs (rw)
/dev/mapper/VG00-Portage on /mnt/gentoo/usr/portage type jfs (rw)
/dev/mapper/VG00-Home on /mnt/gentoo/home type jfs (rw)

各LVがmountできたので、 Stage3 と呼ばれるファイルをダウンロードします。
Mirrorの一覧から近そうなミラーサイトを選びます。

Screen Shot 2013-12-30 at 4.03.15 PM.png

IIJ様、JAIST様、平素お世話になっておりますm(__)m

あ、name属性付いてましたね。

Screen Shot 2013-12-30 at 4.11.15 PM.png

今回はStage3のtarballを http://ftp.iij.ad.jp/pub/linux/gentoo/releases/amd64/current-stage3/ からいただいてきます。
ついでにportageのsnapshotも http://ftp.iij.ad.jp/pub/linux/gentoo/snapshots/ からダウンロードしておきます。

livecd gentoo # curl -LO http://ftp.iij.ad.jp/pub/linux/gentoo/releases/amd64/current-stage3/stage3-amd64-20131226.tar.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  169M  100  169M    0     0  3010k      0  0:00:57  0:00:57 --:--:-- 3516k
livecd gentoo # cur -LO ftp://ftp.iij.ad.jp/pub/linux/gentoo/snapshots/portage-latest.tar.bz2
-bash: cur: command not found
livecd gentoo # curl -LO ftp://ftp.iij.ad.jp/pub/linux/gentoo/snapshots/portage-latest.tar.bz2
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 65.1M  100 65.1M    0     0  5164k      0  0:00:12  0:00:12 --:--:-- 4301k

ダウンロードが終わったのでStage3とportage snapshotを展開します。
カレントディレクトリが /mnt/gentoo であることを確認します。

livecd gentoo # pwd
/mnt/gentoo
livecd gentoo # ll
total 240516
drwxr-xr-x 3 root root      4096 Dec 30 06:03 boot
drwxr-xr-x 2 root root       256 Dec 30 06:36 home
-rw-r--r-- 1 root root  68359311 Dec 30 07:16 portage-latest.tar.bz2
-rw-r--r-- 1 root root 177921008 Dec 30 07:15 stage3-amd64-20131226.tar.bz2
drwxr-xr-x 3 root root         8 Dec 30 06:56 usr
drwxr-xr-x 2 root root       256 Dec 30 06:37 var

まずStage3から。
Stage3 tarballを展開するときは tar コマンドに p (preserve-permissions)オプションを指定します。

livecd gentoo # tar xfp stage3-amd64-20131226.tar.bz2 

続いてportage shapshotを展開します。
tar コマンドの -C (change to directory)オプションで usr/ を指定します。

livecd gentoo # tar xf portage-latest.tar.bz2 -C usr/

展開できました。
Linuxの / っぽくディレクトリが配置されたことが確認できます。

livecd gentoo # ls -1 
bin
boot
dev
etc
home
lib
lib32
lib64
media
mnt
opt
portage-latest.tar.bz2
proc
root
run
sbin
stage3-amd64-20131226.tar.bz2
sys
tmp
usr
var

Stage3によって最小限+αのファイルが配置されたので、あといくつか必要なディレクトリをmountしてchrootします。

livecd gentoo # mount -t proc none proc/
livecd gentoo # mount --rbind /dev/ dev/
livecd gentoo # mount --rbind /sys/ sys/

・・・と思ったんですが、やっぱり先にいくつかの設定ファイルを編集します。
理由は、chrootしてしまうと vi がないので。
ただし busybox vi は使えます。参考: https://twitter.com/naota344/status/243999768831983616

まずは make.conf

livecd gentoo # vi etc/portage/make.conf
livecd gentoo # grep -vE '^\w*(^#|$)' etc/portage/make.conf
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="bindist mmx sse sse2"
USE="$USE bash-completion zsh-completion vim-syntax"
USE="$USE git"
USE="$USE -introspection"
USE="$USE dbus avahi"
MAKEOPTS="-j8"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
GENTOO_MIRRORS="ftp://ftp.iij.ad.jp/pub/linux/gentoo/ http://ftp.iij.ad.jp/pub/linux/gentoo/ rsync://ftp.iij.ad.jp/pub/linux/gentoo/"

続いて locale.gen ファイル。

livecd gentoo # vi etc/locale.gen 
livecd gentoo # grep -vE '^\w*(^#|$)' etc/locale.gen 
en_US ISO-8859-1
en_US.UTF-8 UTF-8
ja_JP.EUC-JP EUC-JP
ja_JP.UTF-8 UTF-8
ja_JP EUC-JP

fstab も今書き換えておきます。

livecd gentoo # vi etc/fstab 
livecd gentoo # grep -vE '^\w*(^#|$)' etc/fstab      
/dev/sda1       /boot       ext2        noatime     1 2
/dev/VG00/Gentoo    /       jfs     noatime     0 1
/dev/VG00/Portage   /usr/portage    jfs     noatime     0 1
/dev/VG00/Var       /var        jfs     noatime     0 1
/dev/VG00/Home      /home       jfs     noatime     0 1
/dev/VG00/SWAP00    none        swap        sw      0 0
/dev/cdrom      /mnt/cdrom  auto        noauto,ro   0 0
/dev/fd0        /mnt/floppy auto        noauto      0 0

おっと、 resolv.conf のコピー忘れてました。

livecd gentoo # cp -L /etc/resolv.conf etc/

SSHの鍵ペアもコピーしちゃいます。

livecd gentoo # cp -v /etc/ssh/ssh_*_key* etc/ssh/ 
'/etc/ssh/ssh_host_dsa_key' -> 'etc/ssh/ssh_host_dsa_key'
'/etc/ssh/ssh_host_dsa_key.pub' -> 'etc/ssh/ssh_host_dsa_key.pub'
'/etc/ssh/ssh_host_rsa_key' -> 'etc/ssh/ssh_host_rsa_key'
'/etc/ssh/ssh_host_rsa_key.pub' -> 'etc/ssh/ssh_host_rsa_key.pub'

なにか忘れてる気もしないでもないですけど、思い出したら編集なりコピーなりすればいいやということで。

念のためmount状況を確認して、

livecd gentoo # mount
rootfs on / type rootfs (rw)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=505710,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on / type tmpfs (rw,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
/dev/loop0 on /mnt/livecd type squashfs (ro,relatime)
/dev/sr0 on /mnt/cdrom type iso9660 (ro,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,size=405296k,mode=755)
shm on /dev/shm type tmpfs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
tmpfs on /mnt/livecd/lib64/firmware type tmpfs (rw)
tmpfs on /mnt/livecd/usr/portage type tmpfs (rw)
/dev/mapper/VG00-Gentoo on /mnt/gentoo type jfs (rw)
/dev/sda1 on /mnt/gentoo/boot type ext2 (rw)
/dev/mapper/VG00-Var on /mnt/gentoo/var type jfs (rw)
/dev/mapper/VG00-Portage on /mnt/gentoo/usr/portage type jfs (rw)
/dev/mapper/VG00-Home on /mnt/gentoo/home type jfs (rw)
none on /mnt/gentoo/proc type proc (rw)
/dev on /mnt/gentoo/dev type none (rw,bind,rbind)
/sys on /mnt/gentoo/sys type none (rw,bind,rbind)

いざchroot!

livecd gentoo # chroot /mnt/gentoo/ /bin/bash
livecd / # env-update 
>>> Regenerating /etc/ld.so.cache...
livecd / # source /etc/profile
livecd / # export PS1="(chroot)$PS1"
(chroot)livecd / # pwd
/

chrootして / に居ますね。よしよし♪
("外"からみると /mnt/gentoo に居ます)

chrootできたのでportageのリポジトリを更新します。

(chroot)livecd / # emerge --sync -q

 * IMPORTANT: 6 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

リポジトリが更新できたので必要そうなものをインストールします。
vim とか zsh のような(自分のとっての)必須パッケージをいくつか選択してLet's emerge!
ちなみに q (quiet)オプションと v (verbose)オプションを両方指定できるのは不思議な気もしますが、 q を指定するとビルド中の詳細表示が省略され、 v を指定すると各パッケージ毎のUSEフラグが表示されるので矛盾や衝突はないです。

(chroot)livecd / # emerge -uavq vim zsh lvm2 jfsutils grub:0 gentoo-sources genkernel gentoolkit

 * IMPORTANT: 6 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

[ebuild  N    ] dev-libs/libyaml-0.1.4  USE="-doc -examples -static-libs {-test}" 
[ebuild  N    ] app-arch/cpio-2.11  USE="nls" 
[ebuild  N    ] dev-util/boost-build-1.52.0-r1  USE="-examples -python {-test}" 
[ebuild  N    ] app-admin/eselect-ruby-20100603 
[ebuild  N    ] app-admin/eselect-vi-1.1.7-r1 
[ebuild  N    ] sys-devel/bc-1.06.95  USE="readline -libedit -static" 
[ebuild  N    ] app-emulation/emul-linux-x86-baselibs-20131008-r6  USE="development" ABI_X86="(-32)" 
[ebuild  N    ] dev-libs/boost-1.52.0-r6  USE="nls threads -debug -doc -icu -mpi -python -static-libs -tools" PYTHON_TARGETS="python2_7 python3_3 -python2_6 -python3_2" 
[ebuild  N    ] app-admin/eselect-ctags-1.14 
[ebuild  N    ] dev-util/ragel-6.7-r1  USE="vim-syntax" 
[ebuild  N    ] app-shells/zsh-5.0.2-r3  USE="gdbm pcre unicode -caps -debug -doc -examples -maildir -static" 
[ebuild  N    ] sys-kernel/genkernel-3.4.45.1  USE="crypt -cryptsetup (-ibm) (-selinux)" 
[ebuild  N    ] dev-lang/ruby-1.8.7_p374  USE="berkdb gdbm ipv6 ncurses readline ssl -debug -doc -examples -libedit -rubytests -socks5 -threads -tk -xemacs" 
[ebuild  N    ] dev-util/ctags-5.8  USE="-ada" 
[ebuild  N    ] sys-fs/jfsutils-1.1.15  USE="-static" 
[ebuild  N    ] sys-boot/grub-0.97-r12  USE="ncurses -custom-cflags -netboot -static" 
[ebuild  N    ] sys-kernel/gentoo-sources-3.10.17  USE="-build -deblob -experimental -symlink" 
[ebuild  N    ] dev-lang/ruby-2.0.0_p353  USE="berkdb gdbm ipv6 ncurses rdoc readline ssl -debug -doc -examples -rubytests -socks5 -tk -xemacs" 
[ebuild  N    ] sys-block/thin-provisioning-tools-0.2.8 
[ebuild  N    ] sys-fs/lvm2-2.02.103  USE="lvm1 readline thin udev (-clvm) (-cman) -lvm2create_initrd (-selinux) -static -static-libs" 
[ebuild  N    ] dev-lang/ruby-1.9.3_p484  USE="berkdb gdbm ipv6 ncurses rdoc readline ssl yaml -debug -doc -examples -rubytests -socks5 -tk -xemacs" 
[ebuild  N    ] dev-ruby/rubygems-2.0.3  USE="-server {-test}" RUBY_TARGETS="ruby18 ruby19 ruby20 -jruby" 
[ebuild  N    ] virtual/rubygems-6  RUBY_TARGETS="(ruby20)" 
[ebuild  N    ] virtual/rubygems-4  RUBY_TARGETS="(ruby19)" 
[ebuild  N    ] virtual/rubygems-1  RUBY_TARGETS="(ruby18)" 
[ebuild  N    ] dev-ruby/rake-0.9.6  USE="-doc {-test}" RUBY_TARGETS="ruby18 ruby19 ruby20 -jruby" 
[ebuild  N    ] dev-ruby/json-1.8.0  USE="-doc {-test}" RUBY_TARGETS="ruby18 ruby19 ruby20 -jruby" 
[ebuild  N    ] dev-ruby/racc-1.4.9  USE="-doc {-test}" RUBY_TARGETS="ruby18 ruby19 ruby20 -jruby" 
[ebuild  N    ] dev-ruby/rdoc-4.0.1-r1  USE="-doc {-test}" RUBY_TARGETS="ruby18 ruby19 ruby20 -jruby" 
[ebuild  N    ] dev-lang/python-exec-2.0.1  PYTHON_TARGETS="(jython2_5) (jython2_7) (pypy2_0) (python2_6) (python2_7) (python3_2) (python3_3)" 
[ebuild  N    ] virtual/python-argparse-1  PYTHON_TARGETS="python2_7 python3_3 (-pypy2_0) -python2_6 -python3_2" 
[ebuild  N    ] app-portage/gentoolkit-0.3.0.8-r2  PYTHON_TARGETS="python2_7 python3_3 (-pypy2_0) -python2_6 -python3_2" 
[ebuild  N    ] dev-lang/python-exec-0.3.1  PYTHON_TARGETS="(jython2_5) (jython2_7) (pypy2_0) (python2_6) (python2_7) (python3_2) (python3_3)" 
[ebuild  N    ] dev-python/python-exec-10000.2  PYTHON_TARGETS="(jython2_5) (jython2_7) (pypy2_0) (python2_6) (python2_7) (python3_2) (python3_3)" 
[ebuild  N    ] dev-python/python-exec-10000.1  PYTHON_TARGETS="(jython2_5) (jython2_7) (pypy2_0) (python2_6) (python2_7) (python3_2) (python3_3)" 
[ebuild  N    ] app-editors/vim-core-7.3.762  USE="acl nls -livecd" 
[ebuild  N    ] app-editors/vim-7.3.762  USE="acl nls -X -cscope -debug -gpm -minimal -perl -python -ruby -vim-pager" 
[ebuild  N    ] app-vim/gentoo-syntax-20130619  USE="-ignore-glep31" 

Would you like to merge these packages? [Yes/No] 
>>> Verifying ebuild manifests
>>> Emerging (1 of 38) dev-libs/libyaml-0.1.4
>>> Jobs: 0 of 38 complete, 1 running               Load avg: 0.58, 0.24, 0.13

さて、コーヒー淹れてきます。

 * IMPORTANT: 8 news items need reading for repository 'gentoo'.
 * Use eselect news to read news items.

done.

そういえばchrootした環境のrootパスワードを設定してなかったですね。

(chroot)livecd / # passwd 
New password: 
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password: 
passwd: password updated successfully

よくパスワード設定忘れて泣くので設定しておきます。

必要なパッケージがインストールされたのでgenkernelを使ってkernelをビルドします。

symlinkが張られていることを確かめてgenkernelを --menuconfig オプションと --lvm オプション付きで実行します。

(chroot)livecd / # ls -l /usr/src/
total 8
lrwxrwxrwx  1 root root   20 Dec 30 08:33 linux -> linux-3.10.17-gentoo
drwxr-xr-x 24 root root 4096 Dec 30 08:33 linux-3.10.17-gentoo
(chroot)livecd / # genkernel --menuconfig --lvm all

こんな感じでmenuconfigしてベーグルこねてきます。

Screen Shot 2013-12-30 at 6.14.41 PM.png

(chroot)livecd / # genkernel --menuconfig --lvm all
* Gentoo Linux Genkernel; Version 3.4.45.1
* Running with options: --menuconfig --lvm all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* Linux Kernel 3.10.17-gentoo for x86_64...
* .. with config file /usr/share/genkernel/arch/x86_64/kernel-config
* kernel: Using config from /usr/share/genkernel/arch/x86_64/kernel-config
* kernel: >> Running mrproper...
*         >> Running oldconfig...
* kernel: >> Cleaning...
* kernel: >> Invoking menuconfig...
configuration written to .config

*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.

*         >> Compiling 3.10.17-gentoo bzImage...
*         >> Not installing firmware as it's included in the kernel already (CONFIG_FIRMWARE_IN_KERNEL=y)...
*         >> Compiling 3.10.17-gentoo modules...
*         >> Generating module dependency data...
* Copying config for successful build to /etc/kernels/kernel-config-x86_64-3.10.17-gentoo
* busybox: >> Applying patches...
*           - 1.18.1-openvt.diff
*           - busybox-1.20.1-mdstart.patch
*           - busybox-1.20.2-glibc-sys-resource.patch
*           - busybox-1.7.4-signal-hack.patch
* busybox: >> Configuring...
* busybox: >> Compiling...
* busybox: >> Copying to cache...
* initramfs: >> Initializing...
*         >> Appending base_layout cpio data...
*         >> Appending auxilary cpio data...
*         >> Copying keymaps
*         >> Appending busybox cpio data...
*         >> Appending lvm cpio data...
*           LVM: Adding support (compiling binaries)...
* lvm: >> Applying patches...
*           - lvm2-2.02.72-no-export-dynamic.patch
* lvm: >> Configuring...
* lvm: >> Compiling...
*       >> Copying to bincache...
*         >> Appending modules cpio data...
*         >> Appending blkid cpio data...
*         >> Appending modprobed cpio data...
*         >> Compressing cpio data (.xz)...
* 
* Kernel compiled successfully!
* 
* Required Kernel Parameters:
*     root=/dev/$ROOT
* 
*     Where $ROOT is the device node for your root partition as the
*     one specified in /etc/fstab
* 
* If you require Genkernel's hardware detection features; you MUST
* tell your bootloader to use the provided INITRAMFS file.

* WARNING... WARNING... WARNING...
* Additional kernel cmdline arguments that *may* be required to boot properly...
* add "dolvm" for lvm support
* With support for several ext* filesystems available, it may be needed to
* add "rootfstype=ext3" or "rootfstype=ext4" to the list of boot parameters.

* Do NOT report kernel bugs as genkernel bugs unless your bug
* is about the default genkernel configuration...
* 
* Make sure you have the latest ~arch genkernel before reporting bugs.

genkernelを --menuconfig オプション付きで実行すると、menuconfig後勝手にkernelをコンパイルしてinitramfsまで作ってくれます。楽ちん♪
今回のconfigは https://gist.github.com/mazgi/8179974 に置いておきます。

kernelとinitramfsができたのでgrubを設定します。
まず /boot に移動してgenkernelさんが作ってくれたkernelとinitramfsを確認します。

(chroot)livecd / # cd /boot/
(chroot)livecd boot # ls -al
total 9896
drwxr-xr-x  4 root root    4096 Dec 30 10:05 .
drwxr-xr-x 20 root root    4096 Dec 26 05:17 ..
-rw-r--r--  1 root root       0 Dec 26 02:19 .keep
-rw-r--r--  1 root root 2263637 Dec 30 09:54 System.map-genkernel-x86_64-3.10.17-gentoo
lrwxrwxrwx  1 root root       1 Dec 30 08:30 boot -> .
drwxr-xr-x  2 root root    4096 Dec 30 08:30 grub
-rw-r--r--  1 root root 3642736 Dec 30 10:05 initramfs-genkernel-x86_64-3.10.17-gentoo
-rw-r--r--  1 root root 4177872 Dec 30 09:54 kernel-genkernel-x86_64-3.10.17-gentoo
drwx------  2 root root   16384 Dec 30 06:03 lost+found

configとkernelやinitramfsがいつ何の目的で作ったか分かるように名前を変えておきます。

(chroot)livecd boot # cp /etc/kernels/kernel-config-x86_64-3.10.17-gentoo .
(chroot)livecd boot # mv kernel-config-x86_64-3.10.17-gentoo kernel-config-x86_64-3.10.17-gentoo.install
(chroot)livecd boot # mv System.map-genkernel-x86_64-3.10.17-gentoo System.map-genkernel-x86_64-3.10.17-gentoo.install
(chroot)livecd boot # mv initramfs-genkernel-x86_64-3.10.17-gentoo initramfs-genkernel-x86_64-3.10.17-gentoo.install
(chroot)livecd boot # mv kernel-genkernel-x86_64-3.10.17-gentoo kernel-genkernel-x86_64-3.10.17-gentoo.install

私はkernelの差し替えは、 grub.conf はあまり編集せずにsymlinkを張り替えて運用しています。
今回もsymlinkを張って、それを grub.conf で指定することにします。

(chroot)livecd boot # ln -s kernel-genkernel-x86_64-3.10.17-gentoo.install gentoo-stable.kernel
(chroot)livecd boot # ln -s initramfs-genkernel-x86_64-3.10.17-gentoo.install gentoo-stable.initramfs
(chroot)livecd boot # ls -al
total 10000
drwxr-xr-x  4 root root    4096 Dec 30 10:16 .
drwxr-xr-x 20 root root    4096 Dec 26 05:17 ..
-rw-r--r--  1 root root       0 Dec 26 02:19 .keep
-rw-r--r--  1 root root 2263637 Dec 30 09:54 System.map-genkernel-x86_64-3.10.17-gentoo.install
lrwxrwxrwx  1 root root       1 Dec 30 08:30 boot -> .
lrwxrwxrwx  1 root root      49 Dec 30 10:16 gentoo-stable.initramfs -> initramfs-genkernel-x86_64-3.10.17-gentoo.install
lrwxrwxrwx  1 root root      46 Dec 30 10:16 gentoo-stable.kernel -> kernel-genkernel-x86_64-3.10.17-gentoo.install
drwxr-xr-x  2 root root    4096 Dec 30 08:30 grub
-rw-r--r--  1 root root 3642736 Dec 30 10:05 initramfs-genkernel-x86_64-3.10.17-gentoo.install
-rw-r--r--  1 root root  100666 Dec 30 10:15 kernel-config-x86_64-3.10.17-gentoo.install
-rw-r--r--  1 root root 4177872 Dec 30 09:54 kernel-genkernel-x86_64-3.10.17-gentoo.install
drwx------  2 root root   16384 Dec 30 06:03 lost+found

一通りsymlinkを張り終えたら grub.conf を編集します。

(chroot)livecd boot # vi grub/grub.conf 
(chroot)livecd boot # grep -vE '^\w*(^#|$)' grub/grub.conf 
default 0
timeout 4
title Gentoo Linux (Stable)
root (hd0,0)
kernel /boot/gentoo-stable.kernel root=/dev/ram0 real_root=/dev/VG00/Gentoo dolvm
initrd /boot/gentoo-stable.initramfs

流れと全く関係ないですが、 locale-gen の実行を忘れていたので実行しておきます。

(chroot)livecd boot # locale-gen 
 * Generating 5 locales (this might take a while) with 1 jobs
 *  (1/5) Generating en_US.ISO-8859-1 ... [ ok ]
 *  (2/5) Generating en_US.UTF-8 ... [ ok ]
 *  (3/5) Generating ja_JP.EUC-JP ... [ ok ]
 *  (4/5) Generating ja_JP.UTF-8 ... [ ok ]
 *  (5/5) Generating ja_JP.EUC-JP ... [ ok ]
 * Generation complete

次はネットワークインタフェースの設定をします。
といっても net.lo のsymlinkを張るだけですが。

(chroot)livecd boot # cd /etc/init.d/
(chroot)livecd init.d # ifconfig 
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe79:d010  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:79:d0:10  txqueuelen 1000  (Ethernet)
        RX packets 373104  bytes 513951323 (490.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 178062  bytes 10732032 (10.2 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::a00:27ff:fe4d:3e18  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:4d:3e:18  txqueuelen 1000  (Ethernet)
        RX packets 14676  bytes 1177032 (1.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11652  bytes 4398350 (4.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 2  bytes 140 (140.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2  bytes 140 (140.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

(chroot)livecd init.d # ln -s net.lo net.enp0s3
(chroot)livecd init.d # ln -s net.lo net.enp0s8

symlinkを張ったらOS起動時にネットワークインタフェースがアクティブになるようにします。
ついでにsshdも起動するようにしておきます。

(chroot)livecd init.d # rc-update add net.enp0s3 boot
 * service net.enp0s3 added to runlevel boot
(chroot)livecd init.d # rc-update add net.enp0s8 boot
 * service net.enp0s8 added to runlevel boot
(chroot)livecd init.d # rc-update add sshd default
 * service sshd added to runlevel default

OS起動時に一緒に起動するサービスはこんな感じです。

(chroot)livecd init.d # rc-update show
             bootmisc | boot                         
                devfs |                       sysinit
                dmesg |                       sysinit
                 fsck | boot                         
             hostname | boot                         
              hwclock | boot                         
              keymaps | boot                         
            killprocs |              shutdown        
                local |      default                 
           localmount | boot                         
             loopback | boot                         
              modules | boot                         
             mount-ro |              shutdown        
                 mtab | boot                         
           net.enp0s3 | boot                         
           net.enp0s8 | boot                         
             netmount |      default                 
               procfs | boot                         
                 root | boot                         
            savecache |              shutdown        
                 sshd |      default                 
                 swap | boot                         
            swapfiles | boot                         
               sysctl | boot                         
                sysfs |                       sysinit
         termencoding | boot                         
         tmpfiles.dev |                       sysinit
       tmpfiles.setup | boot                         
                 udev |                       sysinit
           udev-mount |                       sysinit
              urandom | boot                         

さっき grub.conf を編集したのになぜかgrubのインストールを忘れていたのでインストールします。

(chroot)livecd init.d # grub
Probing devices to guess BIOS drives. This may take a long time.

    GNU GRUB  version 0.97  (640K lower / 9216K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]

grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0)"...  20 sectors are embedded.
succeeded
 Running "install /boot/grub/stage1 (hd0) (hd0)1+20 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit

以上でとりあえずHDDから起動できるようにはなったと思われるのでrebootします。

(chroot)livecd init.d # exit
exit
livecd gentoo # reboot 

Broadcast message from root@livecd (pts/0) (Mon Dec 30 10:37:00 2013):

The system is going down for reboot NOW!

・・・起動デバイスのオーダーを間違えてまたCDイメージから起動してしまいました。
VirtualBoxの設定でオーダーを変えておきます。

Screen Shot 2013-12-30 at 7.38.06 PM.png

気を取り直して起動!
bootloaderはちゃんとインストールされているようです。

Screen Shot 2013-12-30 at 7.39.39 PM.png

OSもちゃんと起動しました。

Screen Shot 2013-12-30 at 7.40.36 PM.png

sshログインもOK。

[mazgi@Ardbeg] $ ssh 192.168.56.102 -lroot
Password: 
localhost ~ # ifconfig 
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::a00:27ff:fe79:d010  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:79:d0:10  txqueuelen 1000  (Ethernet)
        RX packets 4  bytes 1325 (1.2 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10  bytes 1269 (1.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255
        inet6 fe80::a00:27ff:fe4d:3e18  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:4d:3e:18  txqueuelen 1000  (Ethernet)
        RX packets 44  bytes 6789 (6.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 35  bytes 5590 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 0  (Local Loopback)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

続きます

4
5
1

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
4
5