ubuntu22 环境
1.dd if=/dev/zero of=btrfs.img bs=1m count=2000
2.losetup /dev/loop16 btrfs.img
3.apt install btrfs-progs
4.mkfs.btrfs -f /dev/loop16
5.mount -t btrfs /dev/loop16 /var/lib/docker
6. root@nmx-virtual-machine:/home/nmx# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
tmpfs tmpfs 798784 2044 796740 1% /run
/dev/sda3 ext4 204793864 10625228 183692912 6% /
tmpfs tmpfs 3993904 0 3993904 0% /dev/shm
tmpfs tmpfs 5120 4 5116 1% /run/lock
/dev/sda2 vfat 524252 6220 518032 2% /boot/efi
tmpfs tmpfs 798780 92 798688 1% /run/user/1000
/dev/sr0 iso9660 129448 129448 0 100% /media/nmx/CDROM
/dev/loop16 btrfs 2048000 5920 1825792 1% /var/lib/docker
7.配置文件
root@nmx-virtual-machine:/home/nmx# cat /etc/docker/daemon.json { "storage-driver": "btrfs" }
8. docker info
Client: Version: 24.0.5 Context: default Debug Mode: false Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 24.0.5 Storage Driver: btrfs Btrfs: Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 runc Default Runtime: runc Init Binary: docker-init containerd version: runc version: init version: Security Options: apparmor seccomp Profile: builtin cgroupns Kernel Version: 6.5.0-21-generic Operating System: Ubuntu 22.04.4 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 7.618GiB Name: nmx-virtual-machine ID: 7f487ac8-8469-45d4-a55a-99b08f4ab9e9 Docker Root Dir: /var/lib/docker Debug Mode: false Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false
标签:存储,btrfs,nmx,runc,dev,docker,tmpfs From: https://www.cnblogs.com/rincloud/p/18033087