Outils pour utilisateurs

Outils du site


linux:btrfs (lu 1632 fois)

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
linux:btrfs [21-04-2021 14:45]
edmc73 [Passer de ext4 à btrfs]
linux:btrfs [28-04-2021 16:16] (Version actuelle)
edmc73
Ligne 189: Ligne 189:
   # or curl -L https://raw.githubusercontent.com/speed47/btrfs-list/master/btrfs-list -o btrfs-list   # or curl -L https://raw.githubusercontent.com/speed47/btrfs-list/master/btrfs-list -o btrfs-list
  
 +===== io disk =====
 +
 +-- source: https://kinvolk.io/docs/flatcar-container-linux/latest/setup/debug/btrfs-troubleshooting/
 +
 +Disable copy-on-write
 +
 +Copy-On-write isn’t ideal for workloads that create or modify many small files, such as databases. Without disabling COW, you can heavily fragment the file system as explained above.
 +
 +The best strategy for successfully running a database in a container is to disable COW on directory/volume that is mounted into the container.
 +
 +The COW setting is stored as a file attribute and is modified with a utility called chattr. To disable COW for a MySQL container’s volume, run:
 +
 +  chattr -R +C /var/lib/mysql
 +  
 +The directory /var/lib/mysql is now ready to be used by a Docker container without COW. Let’s break down the command:
 +
 +-R indicates that want to recursively change the file attribute +C means we want to set the NOCOW attribute on the file/directory
 +
 +To verify, we can run:
 +
 +<code>
 +$ lsattr /var/lib/
 +---------------- /var/lib/portage
 +---------------- /var/lib/gentoo
 +---------------- /var/lib/iptables
 +---------------- /var/lib/ip6tables
 +---------------- /var/lib/arpd
 +---------------- /var/lib/ipset
 +---------------- /var/lib/dbus
 +---------------- /var/lib/systemd
 +---------------- /var/lib/polkit-1
 +---------------- /var/lib/dhcpcd
 +---------------- /var/lib/ntp
 +---------------- /var/lib/nfs
 +---------------- /var/lib/etcd
 +---------------- /var/lib/docker
 +---------------- /var/lib/update_engine
 +---------------C /var/lib/mysql
 +</code>
linux/btrfs.txt · Dernière modification: 28-04-2021 16:16 de edmc73