2016年12月7日水曜日

★★ UEFI + btrfs で ハードディスクへインストール




数学は 神の言葉である


ノーベル賞をもらえるくらいの英語の文学を書こうとすると 相当の英語力が必要とされる。 高校英語では 英語で皮肉はいえない。

量子力学を展開しようとすると 片言数学(算数)ではなく、高度な数学が必要だ。
物理学にとって数学は言葉だ。
数学を流暢に喋れないと 物理にならない。

任意の角度を定規とコンパスだけで三等分ができないことは数学で証明されている。
従って神様でも定規とコンパスだけで任意の角度を3等分することはできない。
もっとも神様は 別の方法でやすやすと3等分してしまうけど。

宇宙のはじまりが 何か 有から始まったとしたら
その 有は 何から始まったかという無限の問におちいってしまう。
従って 宇宙は 無 から始まらなければならない。
無 そして インフレーション そして ビッグバンだ。


今までずっと人類の先祖がどうやってであったかわからなかった
先祖が生きていた時には氷河期であって海面は今より50メートル下であった
氷河期で寒いので冷蔵庫のなかのようにカラカラに乾燥し 世界は砂漠化していた
したがってアフリカで住むところは限られていた
だから 人類の男女はであえた
そしてアフリカの東南部で発生した祖先は紅海を島伝いにわたり(海面は今より50メートル下)イエメンに入った。
そこから3つの方角にわかれた
ヨーロッパに行ったもの(白人cocasian コーカサス山脈)
モンゴルに行ったもの (黄色人種)
マレーシアからオーストラリアに行ったもの (オーストリアの原住民アポリジア)

さらにユーラシア大陸からベーリング海峡を通ってアメリカ大陸に渡って行ったもの(海面は今より50メートル下)
もちろんアフリカに残ったものを忘れてはいけない。

アフリカでは 日差しがきついので 皮膚の色をメラニンにて黒くしないと日光で葉酸が破壊されてしまう、
また スウェーデンなどでは日差しがよわいので メラニンを薄くして光を通すようにしないと ビタミンDがつくれない。
黄色人種は 放熱を防ぐために 手足を短くし顔の凹凸をなくした耐寒仕様か


http://ameblo.jp/djdjysk/entry-11347755909.html より
日本が勝って清国と交わした、日清講和条約の第一条 
清国は、朝鮮国が完全無欠なる独立自主の国であること」を確認し、
独立自主を損害するような
「朝鮮国から清国に対する貢(みつぎもの)・献上・典礼等」永遠に廃止する。

淸國ハ 「朝鮮國ノ完全無缺ナル獨立自主ノ國タルコト」ヲ確認ス
因テ
右獨立自主ヲ損害スヘキ
「朝鮮國ヨリ淸國ニ對スル貢獻典禮等」ハ將來全ク之ヲ廢止スヘシ



さて本論です。


あとで 解説しますが、 宣伝として
btrfs fi balance start / -dusage=5 して
snapper -c root list  すると


Type   | #   | Pre # | Date                     | User | Cleanup | Description         | Userdata
-------+-----+-------+--------------------------+------+---------+---------------------+---------
single | 0   |       |                          | root |         | current             |         
post   | 334 | 333   | Thu Feb 23 10:54:34 2017 | root | number  | pacman -Syu         |         
pre    | 335 |        | Thu Feb 23 15:07:44 2017 | root | number  | pacman -Rsc blueman |   
post   | 336 | 335   | Thu Feb 23 15:07:50 2017 | root | number  | pacman -Rsc blueman |         
pre    | 337 |        | Fri Feb 24 09:56:38 2017 | root | number  | pacman -Sy blueman  |         
post   | 338 | 337   | Fri Feb 24 09:56:42 2017 | root | number  | pacman -Sy blueman  |
です・

ここで  snapper -c root undochange 337..338
すると  Feb 23 の過去に もどれるかな?
これが btrfs + snapper の絶大な威力で 
したがって UEFI +btrfsが 巨大データサーバーに 必要な所以かな?。

過ちを取り消すことができるかな?


this page is written in japanese !
so i put english translation (by google's machine translation)
                                             at the end of this URL .



manjorolinuxでは 簡単に UEFI + btrfs ができました。


しかし archlinux で UEFI + btrfs については くぐると
 gummiboot とかsyslinux とかを使ってできたのがありますが、試みるとダメです。
よって 自分で歩き たどり着きました。
最初 USBハードディスクで成功し、その成功は sataハードディスクでもOKでした。


注意:最新のISOをつかわないと駄目です



しかし犠牲もありました。
あなたはこのフォーラム(日本のarchlinux)に対するアクセスが制限されています。
以下はアクセスを制限した管理者またはモデレータのメッセージです。
本家フォーラムでも行動規範に反するような投稿をしているようなので永久BANとします

これおかしいと思います。
法による支配ではないですし、もともとlinuxは
http://cruel.org/freeware/cathedral.html#1からですが

引用開始------>
前略

Linux コミュニティはむしろ、いろんな作業やアプローチが渦を巻く、でかい騒がしいバザールに似ているみたいだった(これをまさに象徴しているのが Linux のアーカイブサイトで、ここはどこのだれからでもソフトを受け入れてしまう)
そしてそこから一貫した安定なシステムが出てくる なんて、
奇跡がいくつも続かなければ不可能に思えた。
<------引用終了 伽藍がお好みなら、openbsdがいい。 テオ神とその天使たちより 福音がおりてくる。圧倒的力量の差がある。

ですからね。


http://qiita.com/sion_cojp/items/c8e015db39ddbf43012eによると
     最大ファイルサイズ    最大ボリュームサイズ
ext4         16TiB      1EiB
btrfs         16EiB      16EiB
なので これから超巨大データベース(例えば映像)をつくるには 
btrfs でしょう 1 EiB = 2の60乗B = 1,152,921,504,606,846,976 B

また uefiでないと 2.2TB以上のバーティションから 起動できないですしね。



A)まず 最初は USB ハードディスクに btrfs + UEFI で arhlinuxをいれます。
 全く同じ方法で PC内蔵ハードディスクにインストールできます。
 B)では PC内蔵ハードディスクにインストールした結果を載せてます
  内蔵ハードディスクの場合はsdbをsdaに置き換えてください

その前に sata ハードディスクにある ntfs , vfat などの microsoft file system はのけとかないといけないとおもいます。
これがあると UEFIが USB ハードディスクでなく sata ハードディスクの方にいっちゃいます。
おそらく UEFIの仕様のためではないかと 自分は想像します。



他のPCから archlinux にはいります。
つまり
ssh -l root 192.168.80.116

root@archiso ~ # fdisk -l /dev/sda  <-----------ここです ntfs , vfat はないですね
Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda2  *      1050624 614402047 613351424 292.5G 83 Linux
/dev/sda3       614404094 874369023 259964930   124G  5 Extended
/dev/sda4       874371072 976773119 102402048  48.8G a6 OpenBSD
/dev/sda5       614404096 622792703   8388608     4G 82 Linux swap / Solaris
/dev/sda6       622794752 874369023 251574272   120G 83 Linux



root@archiso ~ # gdisk  /dev/sda




root@archiso ~ # gdisk  /dev/sda 
GPT fdisk (gdisk) version 1.0.3

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
Model: FB080C4080      
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): ABC1DAE2-2A33-4625-8743-F674621D4D3F
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 156301454
Partitions will be aligned on 2048-sector boundaries
Total free space is 2157 sectors (1.1 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  EFI System
   2         1050624         3147775   1024.0 MiB  8200  Linux swap
   3         3147776       156301311   73.0 GiB    8300  Linux filesystem

Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y

Command (? for help): n
Partition number (1-128, default 1): 
First sector (34-156301454, default = 2048) or {+-}size{KMGTP}: 
Last sector (2048-156301454, default = 156301454) or {+-}size{KMGTP}: +512M
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EF00
Changed type of partition to 'EFI System'

Command (? for help): n
Partition number (2-128, default 2): 
First sector (34-156301454, default = 1050624) or {+-}size{KMGTP}: 
Last sector (1050624-156301454, default = 156301454) or {+-}size{KMGTP}: +4G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8200
Changed type of partition to 'Linux swap'

Command (? for help): n
Partition number (3-128, default 3): 
First sector (34-156301454, default = 9439232) or {+-}size{KMGTP}: 
Last sector (9439232-156301454, default = 156301454) or {+-}size{KMGTP}: 
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 
Changed type of partition to 'Linux filesystem'

Command (? for help): p
Disk /dev/sda: 156301488 sectors, 74.5 GiB
Model: FB080C4080      
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 248024E5-B5F3-43C1-BFF5-ECA8B8E5DA59
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 156301454
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048         1050623   512.0 MiB   EF00  EFI System
   2         1050624         9439231   4.0 GiB     8200  Linux swap
   3         9439232       156301454   70.0 GiB    8300  Linux filesystem

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sda.
The operation has completed successfully.


これにて


Number  Start (sector)    End (sector)  Size       Code  Name

   1            2048         1050623   512.0 MiB   EF00  EFI System

   2         1050624         9439231   4.0 GiB     8200  Linux swap

   3         9439232       156301454   70.0 GiB    8300  Linux filesyste



そして
#  mkfs.fat -F32    /dev/sda1

# mkswap /dev/sda2
# swapon /dev/sda2

 
# mkfs.btrfs -f -L arch /dev/sda3
# mount /dev/sda3 /mnt
# cd /mnt
# btrfs subvolume create /mnt/ROOT
# cd /
# umount /mnt
# mount -o defaults,compress=lzo,subvol=ROOT /dev/sda3 /mnt


# mkdir -p /mnt/boot
# mount   /dev/sda1 /mnt/boot 


# nano /etc/pacman.d/mirrorlist  

Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
をミラーリストの一番上に書き加えます

# pacstrap /mnt base  base-devel btrfs-progs



genfstab  -p /mnt >> /mnt/etc/fstab

and 
rewrite  /mnt/etc/fstab <------------ sda1,2,3 をつかうと状況によっては変なのにつながるのでUUIDに変えます


arch-chroot /mnt


echo 'arch-pc' >  /etc/hostname

rm /etc/localtime
# ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime 


# nano /etc/locale.gen 


一番上に次を書き加える
ja_JP.UTF-8 UTF-8
en_US.UTF-8 UTF-8



 そして
# locale-gen



 /etc/locale.conf を
LANG=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8





# passwd

# useradd -m -G wheel -s /bin/bash taro
# passwd  taro

# pacman -S net-tools dnsutils  openssh dialog wpa_supplicant

systemctl enable dhcpcd.service
systemctl enable sshd.service
systemctl enable dhcpcd.service

<   ここからが キモですので 省略せず書いてます  > 
# pacman -S dosfstools efibootmgr grub

# grub-install --target=x86_64-efi --efi-directory=/boot  --bootloader-id=arch_grub --recheck
Installing for x86_64-efi platform.
Installation finished. No error reported.


# mkdir /boot/EFI/boot
# cp /boot/EFI/arch_grub/grubx64.efi /boot/EFI/boot/bootx64.efi


[root@archiso /]# grub-mkconfig > kg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-linux
Found initrd image(s) in /boot: initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
done
[root@archiso /]# cp kg /boot/grub/grub.cfg
私の癖です。普通は -o ですよね。

[root@archiso /]# exit
exit
arch-chroot /mnt  8.03s user 1.75s system 1% cpu 8:52.70 total

root@archiso / # umount -R /mnt

root@archiso / # halt -p


やっと USBハードディスクで archlinixを立ち上げます


そして 他のパソコンからここにはいります
[yu@DELL ~]$ ssh -l taro 192.168.80.116
The authenticity of host '192.168.80.116 (192.168.80.116)' can't be 
established.
ECDSA key fingerprint is 
SHA256:re8IllqmOJaI4BNrUdp0OqA4aK5wZnIh1k2lXVklZVo.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.80.116' (ECDSA) to the list of known 
hosts.
taro@192.168.80.116's password: 



[taro@arch-pc ~]$ su
Password: 
と入りました


以下はきちんと USBハードディスクにはいったかの確認です
[root@arch-pc taro]# cat /etc/fstab 
# 
# /etc/fstab: static file system information
#
# <file system> <dir> <type> <options> <dump> <pass>
# UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 LABEL=arch
UUID=df5ce463-a907-40f8-9021-bb3f565c48d6            /          
btrfs      
rw,relatime,compress=lzo,space_cache,subvolid=257,subvol=/ROOT,subvol=ROOT 
0 0

# UUID=479C-992A LABEL=arch
UUID=479C-992A            /boot      vfat       
rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 
0 2

# UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816 LABEL=arch
UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816            none       
swap       defaults   0 0
/ も /boot も swap もはいってます




[root@arch-pc taro]# df
Filesystem     1K-blocks    Used Available Use% Mounted on
dev               965852       0    965852   0% /dev
run               970420     820    969600   1% /run
/dev/sdb3      153668420 1008028 150647300   1% /
tmpfs             970420       0    970420   0% /dev/shm
tmpfs             970420       0    970420   0% /sys/fs/cgroup
tmpfs             970420       0    970420   0% /tmp
/dev/sdb1         523248   43740    479508   9% /boot
tmpfs             194084       0    194084   0% /run/user/1000

と USBハードディスクのしかマウントされてません。


[root@arch-pc taro]# btrfs filesystem show
Label: 'arch'  uuid: df5ce463-a907-40f8-9021-bb3f565c48d6
 Total devices 1 FS bytes used 934.87MiB
 devid    1 size 146.55GiB used 3.02GiB path /dev/sdb3
これ USBハードディスクのルートです

Label: 'arch'  uuid: 8c2be69a-433e-4816-92a9-b28b23256eb1
 Total devices 1 FS bytes used 76.50GiB
 devid    1 size 119.96GiB used 113.95GiB path /dev/sda6
これは 今回はかんけいないのですが sata ハードディスクの分も感知されてます。


[root@arch-pc taro]# cat /boot/grub/grub.cfg ここですよね
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
set root='hd1,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 
--hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3  
df5ce463-a907-40f8-9021-bb3f565c48d6
else
  search --no-floppy --fs-uuid --set=root 
df5ce463-a907-40f8-9021-bb3f565c48d6
fi
    font="/ROOT/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu 
--class os $menuentry_id_option 
'gnulinux-simple-df5ce463-a907-40f8-9021-bb3f565c48d6' {
 load_video
 set gfxpayload=keep
 insmod gzio
 insmod part_gpt
 insmod fat
 set root='hd1,gpt1'  <ーーーーーーーーーーーーーーーーーーーーーーここ
 if [ x$feature_platform_search_hint = xy ]; then
   search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 
--hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  479C-992A
 else
   search --no-floppy --fs-uuid --set=root 479C-992A
 fi
 echo 'Loading Linux linux ...'
 linux /vmlinuz-linux 
root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT  <ーーーーーーーーーーーーーーーーーーーーーーここ
quiet
 echo 'Loading initial ramdisk ...'
 initrd  /initramfs-linux.img <ーーーーーーーーーーーーーーーーーーーーーーここ
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 
'gnulinux-advanced-df5ce463-a907-40f8-9021-bb3f565c48d6' {
 menuentry 'Arch Linux, with Linux linux' --class arch --class 
gnu-linux --class gnu --class os $menuentry_id_option 
'gnulinux-linux-advanced-df5ce463-a907-40f8-9021-bb3f565c48d6' {
  load_video
  set gfxpayload=keep
  insmod gzio
  insmod part_gpt
  insmod fat
  set root='hd1,gpt1'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root 
--hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  
479C-992A
  else
    search --no-floppy --fs-uuid --set=root 479C-992A
  fi
  echo 'Loading Linux linux ...'
  linux /vmlinuz-linux 
root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT  
quiet
  echo 'Loading initial ramdisk ...'
  initrd  /initramfs-linux.img
 }
 menuentry 'Arch Linux, with Linux linux (fallback initramfs)' 
--class arch --class gnu-linux --class gnu --class os 
$menuentry_id_option 
'gnulinux-linux-fallback-df5ce463-a907-40f8-9021-bb3f565c48d6' {
  load_video
  set gfxpayload=keep
  insmod gzio
  insmod part_gpt
  insmod fat
  set root='hd1,gpt1'
  if [ x$feature_platform_search_hint = xy ]; then
    search --no-floppy --fs-uuid --set=root 
--hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  
479C-992A
  else
    search --no-floppy --fs-uuid --set=root 479C-992A
  fi
  echo 'Loading Linux linux ...'
  linux /vmlinuz-linux 
root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT  
quiet
  echo 'Loading initial ramdisk ...'
  initrd  /initramfs-linux-fallback.img
 }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply 
type the
# menu entries you want to add after this comment.  Be careful not to 
change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###




[root@arch-pc taro]# du /boot/
3176 /boot/grub/x86_64-efi
3736 /boot/grub/locale
2872 /boot/grub/themes/starfield
2876 /boot/grub/themes
2356 /boot/grub/fonts
12168 /boot/grub
124 /boot/EFI/arch_grub
124 /boot/EFI/boot
252 /boot/EFI
43740 /boot/
な ふうにUEFIがはいってます。
やっと manjoroとおなじく UEFI+btrfsができたようです。

以下は 単なる空想なのですが
--------------------------
鳥の巣をつくって 木にかけます。
すると しばらくすると 鳥がすみつきます。

これの比喩で ntfs , fat32のパーティションをつくると
UEFI鳥は これをキャッチしてここに住みつきますが、 まず sata木 次に USB木の順番に 察知するんじゃないでしょうか。
これは UEFIの仕様かと そうイマジンします。
--------------------------

もう新しいPCは 99%以上は UEFI仕様でしょう。
そして 巨大サーバーマシンは 2.2TB以上のパーティションからたちあがるのでしょう。
こうなると UEFIしか対応できません。

そして 超巨大データベースに対応するには oracleの創始したbtrfsしかないでしょう。



あとは

pacman  -S openntpd
systemctl enable  openntpd
systemctl start   openntpd
でまず 時間合わせをします。



genisoimage     <- pacman -S cdrkit
growisofs       <-   pacman -S dvd+rw-tools






5) X
http://hanjuku-am2.blogspot.jp/2013/05/vaio-type-parch-linux-2.html
をみて

pacman -S xorg xorg-xinit  xfce4



nano /home/taro/.xinitrc
startxfce4



pacman -S sddm
sddm --example-config > /etc/sddm.conf
systemctl enable sddm





日本語fontは

pacman -S otf-ipafont

   
 
pae対応してない非力なPCでは fcitxはおすすめできません
pacman -S fcitx-im fcitx-configtool fcitx-mozc

nano /home/taro/.xprofile
export XMODIFIERS=@im=fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx






音です


http://opamp.hatenablog.jp/entry/20110829/1314619739 より

# pacman -S alsa-utils




14)cups は 


そのため

the step is the following .
--------------------------------
1) pacman -S cups ghostscript


systemctl enable org.cups.cupsd.service わすれてはいけません!


以上です。





https://www.howtoforge.com/a-beginners-guide-to-btrfs
https://www.howtoforge.com/a-beginners-guide-to-btrfs-p2
は素晴らしいbtrfsの解説サイトです。 何度も読み直さないと理解できません。
特に
we can create subvolumes in volumes or other subvolumes
は btrfs のキモは subvolume



B) PC内蔵ハードディスクにインストールした結果です
動画は  https://www.youtube.com/watch?v=3jYST5ziVos


gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:

  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 63CDA5C0-46C7-4190-B788-AA95162889CF
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name

   1            2048         1050623   512.0 MiB   EF00  EFI System
   2         1050624       614404095   292.5 GiB   8300  Linux filesystem
   5       614404096       622792703   4.0 GiB     8200  Linux swap

   6       622792704       976773119   168.8 GiB   8300  Linux filesystem

2は btrfs + UEFI なarchlinux です

6は btrfs    だけの archlinux です





 /etc/fstab
/dev/sda2           /         btrfs     rw,relatime,compress=lzo,space_cache,subvolid=257,subvol=/ROOT,subvol=ROOT 0 0

/dev/sda1           /boot     vfat       rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2

/dev/sda5           none       swap       defaults   0 0


btrfs filesystem df /
Data, single: total=99.01GiB, used=97.96GiB
System, DUP: total=8.00MiB, used=16.00KiB
Metadata, DUP: total=1.00GiB, used=466.41MiB
GlobalReserve, single: total=134.91MiB, used=0.00B


# btrfs filesystem show
Label: 'arch'  uuid: ee2c052d-0e7c-4685-a34a-5890f2528008
Total devices 1 FS bytes used 98.42GiB
devid    1 size 292.47GiB used 101.02GiB path /dev/sda2

Label: 'arch'  uuid: 8c2be69a-433e-4816-92a9-b28b23256eb1
Total devices 1 FS bytes used 105.80GiB
devid    1 size 168.79GiB used 110.95GiB path /dev/sda6




/boot/grub/grub.cfg
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi
function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}
function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}
if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod part_gpt
insmod btrfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  ee2c052d-0e7c-4685-a34a-5890f2528008
else
  search --no-floppy --fs-uuid --set=root ee2c052d-0e7c-4685-a34a-5890f2528008
fi
    font="/ROOT/usr/share/grub/unicode.pf2"
fi
if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
else
  set timeout=5
fi
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-ee2c052d-0e7c-4685-a34a-5890f2528008' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod fat
set root='hd0,gpt1'
if [ x$feature_platform_search_hint = xy ]; then
 search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  7220-A86F
else
 search --no-floppy --fs-uuid --set=root 7220-A86F
fi
echo 'Loading Linux linux ...'
linux /vmlinuz-linux root=UUID=ee2c052d-0e7c-4685-a34a-5890f2528008 rw rootflags=subvol=ROOT  quiet
echo 'Loading initial ramdisk ...'
initrd  /initramfs-linux.img
}




















english english english



Install on hard disk with UEFI + btrfs


This page is written in japanese!
In manjorolinux it was easy to create UEFI + btrfs.


But in archlinux we go through UEFI + btrfs
There are things you could do with gummiboot or syslinux, but if you try it, it will not work.
So I got to walk by myself.
First successfully with USB hard disk, its success was OK on sata hard disk.


Attention: You must use the latest ISO



But there was sacrifice.
You are limited access to this forum (Japanese archlinux). 
The following is an administrator or moderator message that restricted access.
It seems that you are making posts that go against the Code of Conduct even in the Honkei Forum so it will be permanent BAN

I think it is strange.
It is not dominance by law, originally linux
It's from http://cruel.org/freeware/cathedral.html#1

Start quoting ------>
Abbreviation

Rather, the Linux community seemed to resemble a big noisy bazaar where various tasks and approaches swirled ( This is the archival site of Linux, which is exactly what symbolizes this, accepting software from anyone anywhere ) .
And from that there is a consistent and stable system comes out , 
It seemed impossible unless many miracles continued.
<------ End of quote If you like cathedral, openbsd is good. Gospel comes from Teo God and its angels.There is a difference in overwhelming competence.

That's why.


According to http://qiita.com/sion_cojp/items/c8e015db39ddbf43012e
Maximum file size Maximum volume size 
Ext 4   16TiB   1 EiB
Btrfs   16 EiB   16 EiB
So from now on to create a huge database (eg video)
Btrfs 1 EiB = 2 to the 60th power B = 1,152,921,504,606,846,976 B.

Also, unless you are uefi, you can not boot from the 2.2 TB or higher version.



A) First of all, you can put btrfs + arflinux on UEFI on the USB hard disk.
You can install it on the PC internal hard disk in exactly the same way.
  B) I put the result of installation on the PC internal hard disk

Before that, I think that it is necessary to have a microsoft file system such as ntfs, vfat etc. on sata hard disk. 
With this, UEFI will go to the sata hard disk instead of the USB hard disk. 
I imagine it probably because of UEFI specifications.


他のぱそこんから archlinux にはいります。 つまりssh -l root 192.168.80.116 root@archiso ~ # fdisk -l /dev/ sda <-----------ここです ntfs , vfat はないですねDevice Boot Start End Sectors Size Id Type /dev/sda2 * 1050624 614402047 613351424 292.5G 83 Linux /dev/sda3 614404094 874369023 259964930 124G 5 Extended /dev/sda4 874371072 976773119 102402048 48.8G a6 OpenBSD /dev/sda5 614404096 622792703 8388608 4G 82 Linux swap / Solaris /dev/sda6 622794752 874369023 251574272 120G 83 Linux root@archiso ~ # gdisk -l /dev/sdb Number Start (sector) End (sector) Size Code Name 1 2048 1050623 512.0 MiB EF00 EFI System 2 1050624 5244927 2.0 GiB 8200 Linux swap 3 5244928 312581774 146.5 GiB 8300 Linux filesystemといふうに USBハードディスクを調整します。 そしてroot@archiso ~ # mkfs.fat -F32 /dev/sdb1 mkfs.fat 4.0 (2016-05-06) # mkswap /dev/sdb2 # swapon /dev/sdb2 swapon /dev/sd   
 # mkfs.btrfs -f -L arch /dev/sdb3 # mount /dev/sdb3 /mnt # cd /mnt # btrfs subvolume create /mnt/ROOT # cd / # umount /mnt # mount -o defaults,compress=lzo,subvol=ROOT /dev/sdb3 /mnt 
 

 # mkdir -p /mnt/boot # mount /dev/sdb1 /mnt/boot 
 # nano /etc/pacman.d/mirrorlist 

Server = http://ftp.jaist.ac.jp/pub/Linux/ArchLinux/$repo/os/$arch
To the top of the mirror list
 # pacstrap /mnt base base-devel btrfs-progs genfstab -p /mnt >> /mnt/etc/fstab and rewrite /mnt/etc/fstab <-------------------- sdb1,2,3 をつかうと状況によっては変なのにつながるのでUUIDに変えます# # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> # UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 LABEL=arch UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 / btrfs rw,relatime,compress=lzo,space_cache,subvolid=257,subvol=/ROOT,subvol=ROOT 0 0 # UUID=479C-992A LABEL=arch UUID=479C-992A /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2 # UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816 LABEL=arch UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816 none swap defaults 0 0 arch-chroot /mnt echo 'arch-pc' > /etc/hostname # ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

 # nano /etc/locale.gen を操作してから 
 

一番上に次を書き加える 
En_US.UTF - 8 UTF - 8
Ja_JP.UTF - 8 UTF - 8
 
  
 # locale-gen Generating locales... en_US.UTF-8... done ja_JP.UTF-8... done Generation complete.と発生させます# passwd # useradd -m -G wheel -s /bin/bash taro # passwd taro # pacman -S net-tools dnsutils openssh dialog wpa_supplicant systemctl enable dhcpcd.service systemctl enable sshd.service systemctl enable dhcpcd.service < ここからが キモですので 省略せず書いてます > # pacman -S dosfstools efibootmgr grub # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=arch_grub --recheck Installing for x86_64-efi platform. Installation finished. No error reported. # mkdir /boot/EFI/boot # cp /boot/EFI/arch_grub/grubx64.efi /boot/EFI/boot/bootx64.efi [root@archiso /] # grub-mkconfig > kg Generating grub configuration file ... Found linux image: /boot/vmlinuz-linux Found initrd image(s) in /boot: initramfs-linux.img Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img done [root@archiso /]# cp kg /boot/grub/grub.cfg私の癖です。普通は -o ですよね。 [root@archiso /]# exit exit arch-chroot /mnt 8.03s user 1.75s system 1% cpu 8:52.70 total root@archiso / # umount -R /mnt root@archiso / # halt -p やっと USBハードディスクで archlinixを立ち上げますそして 他のパソコンからここにはいります[yu@DELL ~]$ ssh -l taro 192.168.80.116 The authenticity of host '192.168.80.116 (192.168.80.116)' can't be established. ECDSA key fingerprint is SHA256:re8IllqmOJaI4BNrUdp0OqA4aK5wZnIh1k2lXVklZVo. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.80.116' (ECDSA) to the list of known hosts. taro@192.168.80.116's password: [taro@arch-pc ~]$ su Password:と入りました以下はきちんと USBハードディスクにはいったかの確認です[root@arch-pc taro]# cat /etc/fstab # # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> # UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 LABEL=arch UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 / btrfs rw,relatime,compress=lzo,space_cache,subvolid=257,subvol=/ROOT,subvol=ROOT 0 0 # UUID=479C-992A LABEL=arch UUID=479C-992A /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2 # UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816 LABEL=arch UUID=a35045d7-d17b-401f-a14b-9ffb1ff37816 none swap defaults 0 0 / も /boot も swap もはいってます[root@arch-pc taro]#  df Filesystem 1K-blocks Used Available Use% Mounted on dev 965852 0 965852 0% /dev run 970420 820 969600 1% /run /dev/sdb3 153668420 1008028 150647300 1% / tmpfs 970420 0 970420 0% /dev/shm tmpfs 970420 0 970420 0% /sys/fs/cgroup tmpfs 970420 0 970420 0% /tmp /dev/sdb1 523248 43740 479508 9% /boot tmpfs 194084 0 194084 0% /run/user/1000と USBハードディスクのしかマウントされてません。 [root@arch-pc taro]# btrfs filesystem show Label: 'arch' uuid: df5ce463-a907-40f8-9021-bb3f565c48d6 Total devices 1 FS bytes used 934.87MiB devid 1 size 146.55GiB used 3.02GiB path /dev/sdb3これ USBハードディスクのルートです Label: 'arch' uuid: 8c2be69a-433e-4816-92a9-b28b23256eb1 Total devices 1 FS bytes used 76.50GiB devid 1 size 119.96GiB used 113.95GiB path /dev/sda6これは 今回はかんけいないのですが sata ハードディスクの分も感知されてます。 [root@arch-pc taro]# cat /boot/grub/grub.cfg ここですよね# # DO NOT EDIT THIS FILE # # It is automatically generated by grub-mkconfig using templates # from /etc/grub.d and settings from /etc/default/grub # ### BEGIN /etc/grub.d/00_header ### insmod part_gpt insmod part_msdos if [ -s $prefix/grubenv ]; then load_env fi if [ "${next_entry}" ] ; then set default="${next_entry}" set next_entry= save_env next_entry set boot_once=true else set default="0" fi if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi export menuentry_id_option if [ "${prev_saved_entry}" ]; then set saved_entry="${prev_saved_entry}" save_env saved_entry set prev_saved_entry= save_env prev_saved_entry set boot_once=true fi function savedefault { if [ -z "${boot_once}" ]; then saved_entry="${chosen}" save_env saved_entry fi } function load_video { if [ x$feature_all_video_module = xy ]; then insmod all_video else insmod efi_gop insmod efi_uga insmod ieee1275_fb insmod vbe insmod vga insmod video_bochs insmod video_cirrus fi } if [ x$feature_default_font_path = xy ] ; then font=unicode else insmod part_gpt insmod btrfs set root='hd1,gpt3' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt3 --hint-efi=hd1,gpt3 --hint-baremetal=ahci1,gpt3 df5ce463-a907-40f8-9021-bb3f565c48d6 else search --no-floppy --fs-uuid --set=root df5ce463-a907-40f8-9021-bb3f565c48d6 fi font="/ROOT/usr/share/grub/unicode.pf2" fi if loadfont $font ; then set gfxmode=auto load_video insmod gfxterm set locale_dir=$prefix/locale set lang=en_US insmod gettext fi terminal_input console terminal_output gfxterm if [ x$feature_timeout_style = xy ] ; then set timeout_style=menu set timeout=5 # Fallback normal timeout code in case the timeout_style feature is # unavailable. else set timeout=5 fi ### END /etc/grub.d/00_header ### ### BEGIN /etc/grub.d/10_linux ### menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-df5ce463-a907-40f8-9021-bb3f565c48d6' { load_video set gfxpayload=keep insmod gzio insmod part_gpt insmod fat set root='hd1,gpt1' <ーーーーーーーーーーーーーーーーーーーーーーここ if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 479C-992A else search --no-floppy --fs-uuid --set=root 479C-992A fi echo 'Loading Linux linux ...' linux /vmlinuz-linux root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT <ーーーーーーーーーーーーーーーーーーーーーーここquiet echo 'Loading initial ramdisk ...' initrd /initramfs-linux.img <ーーーーーーーーーーーーーーーーーーーーーーここ} submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-df5ce463-a907-40f8-9021-bb3f565c48d6' { menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-df5ce463-a907-40f8-9021-bb3f565c48d6' { load_video set gfxpayload=keep insmod gzio insmod part_gpt insmod fat set root='hd1,gpt1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 479C-992A else search --no-floppy --fs-uuid --set=root 479C-992A fi echo 'Loading Linux linux ...' linux /vmlinuz-linux root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT quiet echo 'Loading initial ramdisk ...' initrd /initramfs-linux.img } menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-df5ce463-a907-40f8-9021-bb3f565c48d6' { load_video set gfxpayload=keep insmod gzio insmod part_gpt insmod fat set root='hd1,gpt1' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1 479C-992A else search --no-floppy --fs-uuid --set=root 479C-992A fi echo 'Loading Linux linux ...' linux /vmlinuz-linux root=UUID=df5ce463-a907-40f8-9021-bb3f565c48d6 rw rootflags=subvol=ROOT quiet echo 'Loading initial ramdisk ...' initrd /initramfs-linux-fallback.img } } ### END /etc/grub.d/10_linux ### ### BEGIN /etc/grub.d/20_linux_xen ### ### END /etc/grub.d/20_linux_xen ### ### BEGIN /etc/grub.d/30_os-prober ### ### END /etc/grub.d/30_os-prober ### ### BEGIN /etc/grub.d/40_custom ### # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above. ### END /etc/grub.d/40_custom ### ### BEGIN /etc/grub.d/41_custom ### if [ -f ${config_directory}/custom.cfg ]; then source ${config_directory}/custom.cfg elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then source $prefix/custom.cfg; fi ### END /etc/grub.d/41_custom ### [root@arch-pc taro]#  du /boot/ 3176 /boot/grub/x86_64-efi 3736 /boot/grub/locale 2872 /boot/grub/themes/starfield 2876 /boot/grub/themes 2356 /boot/grub/fonts 12168 /boot/grub 124 /boot/EFI/arch_grub 124 /boot/EFI/boot 252 /boot/EFI 43740 /boot/な ふうにUEFIがはいってます。 
Finally it seems that UEFI + btrfs has been created just like manjoro. 


The following is just fantasy 
-------------------------- 
I make a bird's nest and put it on a tree. 
Then a bird will cling to a little while.
When we create a partition of ntfs, fat32 with a metaphor of this 
The UEFI bird catches this and plays here, but first of all we will notice the sata tree next to the US tree in order. 
This is a UEFI specification and so imagine. 
--------------------------
More than 99% of new PCs will be UEFI specifications. 
And huge server machines will be built from partitions of 2.2 TB or more. 
In this way, only UEFI can correspond.
And to deal with super-huge databases, there will be only btrfs created by oracle.



later

Pacman -S openntpd
Systemctl enable openntpd
Systemctl start openntpd
First we will set the time.


Genisoimage <- pacman - S cdrkit
Growisofs <- pacman - S dvd + rw - tools






5) X
Http://hanjuku-am2.blogspot.jp/2013/05/vaio-type-parch-linux-2.html
Look at

Pacman - S xorg xorg - xinit x fce 4



Nano / home / arch /.xinitrc
Startxfce4


Pacman - S slim
Systemctl enable slim







Japanese font

Pacman- S otf-ipafont

   

Fcitx is not recommended for non-powerful PCs that do not support pae
Pacman - S fcitx - im fcitx - configtool fcitx - mozc

Nano / home / arch /. Xprofile
Export XMODIFIERS = @ im = fcitx
Export GTK_IM_MODULE = fcitx
Export QT_IM_MODULE = fcitx





It is a sound.


From http://opamp.hatenablog.jp/entry/20110829/1314619739

Pacman -S alsa-utils



14) cups is


for that reason

The step is the following. 
-------------------------------------------------- 
1) pacman -S cups ghostscript

Systemctl enable org.cups.cupsd.service Do not forget!


that's all.





Https://www.howtoforge.com/a-beginners-guide-to-btrfs
Https://www.howtoforge.com/a-beginners-guide-to-btrfs-p2

Is a nice btrfs commentary site. I can not understand it unless I read it again and again.

Especially
We can create subvolumes in volumes or other subvolumes
Is btrfs kimo is subvolume



B) It is the result of installation on PC internal hard disk
Videos are   Https://www.youtube.com/watch?v=3jYST5ziVos

Gdisk -l / dev / sda
GPT fdisk (gdisk) version 1.0.1

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk / dev / sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 63 CDA 5 C 0 - 46 C 7 - 4190 - B 788 - A A 95162889 CF
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00 EFI System
2 1050624 614404095 292.5 GiB 8300 Linux filesystem
5 614404096 622792703 4.0 GiB 8200 Linux swap

6 622792704 976773119 168.8 GiB 8300 Linux filesystem

2 is btrfs + UEFI archlinux
6 is archlinux only btrfs





/ Etc / fstab
/ Dev / sda 2   /   Btrfs   Rw, relatime, compress = lzo, space_cache, subvolid = 257, subvol = / ROOT, subvol = ROOT   0 0

/ Dev / sda 1   / Boot   Vfat   Rw, relatime, fmask = 0022, dmask = 0022, codepage = 437, iocharset = iso8859-1, shortname = mixed, errors = remount-ro   0 2

/ Dev / sda 5   None   Swap   Defaults   0 0


Btrfs filesystem df /
Data, single: total = 99.01 GiB, used = 97.96 GiB
System, DUP: total = 8.00 MiB, used = 16.00 KiB
Metadata, DUP: total = 1.00 Gi B, used = 466.41 M i B
GlobalReserve, single: total = 134.91 MiB, used = 0.00 B


# Btrfs filesystem show
Label: 'arch' uuid: ee 2 c 052 d - 0 e 7 c - 4685 - a 34 a - 5890 f 2528 007
 Total devices 1 FS bytes used 98.42 GiB
 Devid 1 size 292.47 GiB used 101.02 GiB path / dev / sda 2

Label: 'arch' uuid: 8 c 2 be 69 a - 433 e - 4816 - 92 a 9 - b 28 b 23255 eb 1
 Total devices 1 FS bytes used 105.80 GiB
 Devid 1 size 168.79 GiB used 110.95 GiB path / dev / sda 6




/boot/grub/grub.cfg
Insmod part_gpt
Insmod part_msdos
If [- s $ prefix / grubenv]; then
Load_env
Fi
If ["$ {next_entry}"]; then
Set default = "$ {next_entry}"
Set next _entry =
Save_env next_entry
Set boot_once = true
Else
Set default = "0"
Fi
If [x "$ {feature_menuentry_id}" = xy]; then
Menuentry_id_option = "- id"
Else
Menuentry_id_option = ""
Fi
Export menuentry_id_option
If ["$ {prev_saved_entry}"]; then
Set saved_entry = "$ {prev_saved_entry}"
Save_env saved_entry
Set prev_saved_entry =
Save_env prev_saved_entry
Set boot_once = true
Fi
Function savedefault {
If [- z "$ {boot_once}"]; then
Saved_entry = "$ {chosen}"
Save_env saved_entry
Fi
}
Function load_video {
If [x $ feature_all_video_module = xy]; then
Insmod all_video
Else
Insmod efi_gop
Insmod efi_uga
Insmod ieee 1275_fb
Insmod vbe
Insmod vga
Insmod video_bochs
Insmod video_cirrus
Fi
}
If [x $ feature_default_font_path = xy]; then
Font = unicode
Else
Insmod part_gpt
Insmod btrfs
Set root = 'hd 0, gpt 2'
If [x $ feature_platform_search_hint = xy]; then
Search - no - floppy - fs - uuid - set = root - hint - bios = hd 0, gpt 2 - hint - efi = hd 0, gpt 2 - hint - baremetal = ahci 0, gpt 2 ee 2 c 0 5 2 d - 0 e 7 c - 4685 - a 34 a -5890f 2528008
Else
Search - no - floppy - fs - uuid - set = root ee 2 c 0 5 2 d - 0 e 7 c - 4685 - a 34 a - 5890 f 2528 007
Fi
Font = "/ ROOT / usr / share / grub / unicode.pf 2"
Fi
If loadfont $ font; then
Set gfxmode = auto
Load_video
Insmod gfxterm
Set locale_dir = $ prefix / locale
Set lang = en_US
Insmod gettext
Fi
Terminal_input console
Terminal_output gfxterm
If [x $ feature_timeout_style = xy]; then
Set timeout_style = menu
Set timeout = 5
Else
Set timeout = 5
Fi
Menuentry 'Arch Linux' --class arch --class gnu - linux --class gnu --class os $ menuentry_id_option 'gnulinux - simple - ee2c052d - 0e7c - 4685 - a34a - 5890f 2528008'
 Load_video
 Set gfxpayload = keep
 Insmod gzio
 Insmod part_gpt
 Insmod fat
 Set root = 'hd 0, gpt 1'
 If [x $ feature_platform_search_hint = xy]; then
 Search - no - floppy - fs - uuid - set = root - hint - bios = hd 0, gpt 1 - hint - efi = hd 0, gpt 1 - hint - baremetal = ahci 0, gpt 1 7220 - A 86 F
 Else
 Search - no - floppy - fs - uuid - set = root 7220 - A 86 F
 Fi
 Echo   'Loading Linux linux ...'
 Linux   / Vmlinuz - linux root = UUID = ee 2 c 0 5 2 d - 0 e 7 c - 4685 - a 34 a - 5890 f 2528 007 rw rootflags = subvol = ROOT quiet
 Echo   'Loading initial ramdisk ...'
 Initrd /initramfs-linux.img
}




C) Cloning to a smaller disk


The bigger one is / deb / sdb
The smaller one is called / dev / sdc
will do.
For the sake of clarity / deb / sdb has only / dev / sdb 1


First make / deb / sdb gparted smaller than the capacity of / dev / sdc

next
Dd if = / dev / sdb of = / dev / sdc bs = 512 count = 10000

then
Dd if = / dev / sdb 1 of = / dev / sdc 1 bs = 32 K

That's all.





D) coping with btrfs and then increasing /.snapshots


Https://www.suse.com/documentation/sles11/stor_admin/data/trbl_btrfs_volfull.html#b15tk0m4

is.
In particular

$ Su
Password:

# Btrfs filesystem show
Label: 'arch' uuid: db 4 ef 4 b 9 - d 89 a - 4 bf 6 - a 5 cb - 9 a 48 d 734 e f 18
 Total devices 1 FS bytes used 38.34 GiB
 Devid 1 size 53.90 GiB used 40.02 GiB path / dev / sda 1


# Df
Filesystem 1K-blocks Used Available Use% Mounted on
Dev 2989216 0 2989216 0% / dev
Run 2993808 772 2993036 1% / run
/ Dev / sda 1 56516608 4116865 6 1509 2 9 12 74% /
Tmpfs 2993808 3384 2990424 1% / dev / shm
Tmpfs 2993808 0 2993808 0% / sys / fs / cgroup
Tmpfs 2993808 8 299 3800 1% / tmp
Tmpfs 598760 4 598756 1% / run / user / 1000



# Btrfs fi balance start / - dusage = 5
Done, had to relocate 0 out of 41 chunks


Snapper -c root list | more


Snapper - c root delete 3 - 100


Df
Filesystem 1K-blocks Used Available Use% Mounted on
Dev 2989216 0 2989216 0% / dev
Run 2993808 780 2993028 1% / run
/ Dev / sda 1 565 16 60 8 25 75 5 13 6 29 4 48 8 32 47%
Tmpfs 2993808 3404 2990404 1% / dev / shm
Tmpfs 2993808 0 2993808 0% / sys / fs / cgroup
Tmpfs 2993808 8 299 3800 1% / tmp
Tmpfs 598760 4 598756 1% / run / user / 1000

And I was able to afford it!

after
Automatic timeline snapshot is started by activating / enabling snapper-timeline.timer. In addition, when snapper-cleanup.timer is started and activated, old snapshots are erased regularly.
Because of that, we also need the following
Systemctl enable snapper-timeline.timer
# Systemctl enable snapper-cleanup.timer