Help us understand the problem. What is going on with this article?

Cent OS 7 の docker を overlay 対応させる方法

More than 1 year has passed since last update.

cent で ftype=1 のdiskを /var/lib/docker にマウントする方法

fedora系はdocker のoverlay対応がいまいち。原因はdisk formatがいまいち。このせいでどうでもいいハマりがなくならない。

Use the OverlayFS storage driver | Docker Documentation

xfs (RHEL 7.2 and higher), but only with d_type=true enabled. Use xfs_info to verify that the ftype option is set to 1. To format an xfs filesystem correctly, use the flag -n ftype=1.

いろいろ調べると、cent installerは ftype=1 のフォーマットができないので /var/lib/docker にだけ違うパーティションを作るのがいいらしい。

docker 的には d_type = true で redhat的には ftype=1 らしい。同じものを示すらしい。

  1. ESXi(virtual boxとか) で全パーティション合計容量のハードディスクを1つマウントしたVMを用意
  2. cent installerでパーティション自分で作るを選ぶ
  3. 自動生成を選んで /, /boot, /swap を作ってもらう
  4. / の容量を減らす
  5. パーティションを追加して /var/lib/docker を作る(残り容量が勝手に当たる)
    1. このやり方だと / も /var/lib/docker もlvmになるので後から追加可能になる
  6. os install
  7. 起動したら /var/lib/docker をフォーマットし直す
   df -hT
   umount /var/lib/docker
   mkfs.xfs -f -n ftype=1 /dev/centos/var_lib_docker 
   mount -a
   df -hT
   xfs_info /var/lib/docker/ | grep ftype=1

参考

https://docs.docker.com/storage/storagedriver/overlayfs-driver/

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.2_release_notes/technology-preview-file_systems

http://man7.org/linux/man-pages/man8/mkfs.xfs.8.html

https://superuser.com/questions/1321926/recreating-an-xfs-file-system-with-ftype-1

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away