Want to subscribe to topics you're interested in?
Become a Member

Docker Discuss Using Docker on CentOS 7 ? Choose EXT4 over XFS

Discussion in 'Centmin Mod Docker Development' started by eva2000, Aug 6, 2017.

  1. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    Another gotcha moment I came across playing with Docker on CentOS 7 in that new Docker versions will need d_type support enabled in filesystem. Docker requires CentOS 7 to use and CentOS /RHEL 7 by default create XFS filesystems with d_type=0 disabled instead of d_type=1. CentOS 7 though creates EXT4 filesystems with d_type=1 enabled by default. See explanation at What is d_type and why Docker overlayfs need it - Linuxer Pro.

    Worse thing is you can't fix it on existing CentOS 7 created XFS partitions. You need to recreate the filesystem if you setup CentOS 7 filesystem with XFS partitions !

    Docker info command error when d_type=0 and status on CentOS 7.3 virtualbox install
    Code (Text):
    docker info
    Containers: 0
     Running: 0
     Paused: 0
     Stopped: 0
    Images: 0
    Server Version: 17.06.0-ce
    Storage Driver: overlay
     Backing Filesystem: xfs
     Supports d_type: false
    

    Code (Text):
    WARNING: overlay: the backing xfs filesystem is formatted without d_type support, which leads to incorrect behavior.
            Reformat the filesystem with ftype=1 to enable d_type support.
            Running without d_type support will not be supported in future releases.
    

    Docker info command when d_type=1 enabled on CentOS 7.3 system with EXT4 filesystem
    Code (Text):
    docker info
    Containers: 1
     Running: 0
     Paused: 0
     Stopped: 1
    Images: 4
    Server Version: 17.06.0-ce
    Storage Driver: overlay
     Backing Filesystem: extfs
     Supports d_type: true
    
     
    Last edited: Aug 7, 2017
  2. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    Guess one solution is if you have free unallocated disk space, you can create a filesystem with d_type=1 enabled and change Docker's default data directory path from /var/lib/docker to point to the new filesystem
    i.e. setting up custom settings in /etc/docker/daemon.json
    default Docker root directory where data is located
    Code (Text):
    docker info 2>&1 | grep Root
    Docker Root Dir: /var/lib/docker
    


    from Fix strange chown error during Discourse bootstrap or rebuild - Linuxer Pro

     
    Last edited: Aug 7, 2017
  3. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    Mentioned in RHEL 7.2 preview docs for overlayfs filesystem though Chapter 21. File Systems

     
  4. bassie

    bassie Active Member

    568
    124
    43
    Apr 29, 2016
    Ratings:
    +376
    Local Time:
    5:32 AM
    @eva2000 Already sent a ticket to Centos bug tracker?
     
  5. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    Last edited: Aug 7, 2017
  6. bassie

    bassie Active Member

    568
    124
    43
    Apr 29, 2016
    Ratings:
    +376
    Local Time:
    5:32 AM
  7. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah but could be argued it's in Docker documentation Use the OverlayFS storage driver so if you use Docker ensure XFS filesystem uses ftype=1 or use EXT4 I guess.

    Guess it's partly on me not reading the latest version of the documentation heh.
    Good news is from checking, DigitalOcean, Vultr, and Linode all default to using EXT4 filesystem for CentOS 7 instead of CentOS 7 default XFS. Guess it's for resizing downward support. So CentOS 7 on these VPS providers will be fine with Docker and overlayfs usage as ftype=1 is set.

    Which means only folks inconvenienced would mainly be non-vps/cloud dedicated server uses who most likely will partition their own drives etc. So should properly partition or leave unallocated space at initial install time to be facilitate creating a XFS ftype=1 enabled filesystem(s) for their Docker usage.
     
    Last edited: Aug 7, 2017
  8. eva2000

    eva2000 Administrator Staff Member

    30,947
    6,915
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,413
    Local Time:
    2:32 PM
    Nginx 1.13.x
    MariaDB 5.5
    example of this issue playing out when folks try to use Discourse on CentOS 7 via docker when XFS filesystem created with ftype=0 / d_type disabled