Difference between revisions of "Talk:BTRFS Fun"

From Funtoo Linux
Jump to: navigation, search
(SHow free blocks in btrfs: new section)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<en_francais>
+
Does btrfs-zero-log work only on a single partition or can it handle BTRFS filesystems spanned across several devices?
Regarde mon expérience
+
  
 +
== LVM functionality is only partially replaced by BTRFS ==
  
 +
One thing about LVM Volumes in contrast to btrfs sub volumes is quota's.
 +
Every LVM VOlume has a hard quota and if it runs out of space other volumes are not running out of disk space.
 +
This is one functionality that btrfs has not (yet) implemeted.
  
<pre>
+
For this reasson I stil use LVM, but with btrfs filesystems in the volumes and not with ext4 (anymore).
root@sylvain-VirtualBox:~# mkdir /mnt/backup
+
  
root@sylvain-VirtualBox:~# mount /dev/sda5 /mnt/backup/ -o subvolid=0
+
== SHow free blocks in btrfs ==
  
root@sylvain-VirtualBox:~# cd /mnt/backup/
+
The other day I had a btrfs FS that was running out of disk space.
 
+
But df -h showed that there was still 20% free (subvolumes a presumably not calculated since they are seperately mounted?).
root@sylvain-VirtualBox:/mnt/backup# ls
+
And du -s works the other way around (this also calculated subvolumes and sums, so it counts the unaltered blocks in snapshot sunbvolumes extra).
@  @home
+
Is there a way to find out how much free blocks there are available in a btrfs filesystem?
 
+
root@sylvain-VirtualBox:/mnt/backup# btrfs subvolume snapshot @ @live-root
+
Create a snapshot of '@' in './@live-root'
+
root@sylvain-VirtualBox:/mnt/backup# ls -la
+
total 4
+
dr-xr-xr-x 1 root root  32 1969-12-31 19:00 .
+
drwxr-xr-x 1 root root  12 2011-05-28 23:14 ..
+
drwxr-xr-x 1 root root 194 2011-05-22 15:39 @
+
drwxr-xr-x 1 root root  14 2011-05-22 15:28 @home
+
drwxr-xr-x 1 root root 194 2011-05-22 15:39 @live-root
+
 
+
root@sylvain-VirtualBox:/mnt/backup# btrfs subvolume snapshot /mnt/backup/ @toute
+
 
+
Create a snapshot of '/mnt/backup/' in './@toute'
+
root@sylvain-VirtualBox:/mnt/backup# ls
+
@  @home  @live-root  @toute
+
 
+
root@sylvain-VirtualBox:/mnt/backup# cd @toute/
+
 
+
root@sylvain-VirtualBox:/mnt/backup/@toute# ls
+
@  @home  @live-root
+
root@sylvain-VirtualBox:/mnt/backup/@toute#
+
 
+
</pre>
+
 
+
Bref, voilà pourquoi on ne devrait pas snapshoter une racine :P, mais bien utiliser les snapshots de subvolumes, car là @toute contient un snapshot d'un snapshot(@live-root):P
+
 
+
---
+
 
+
Effectivement la frontière d'un snapshot (c'est assez évident si on pense 5 secondes mais les notes ne le mentionnent pas encore) est le subvolume dont il est issu donc si tu snapshotes ton subvolume qui en compte 10 autres c'est l'ensemble qui sera "copié" (avec le CoW ce n'est pas un drame côté espace disque). Tes explications sont exactement la raison pour laquelle je mentionne plus loin dans l'article qu'il est préférable de ne pas utiliser le subvolume 0, cependant et à moins que les outil de la distribution ne le prenne en charge bien des gens qui vont essayer BTRFS vont utiliser le subvolume 0 directement.
+
 
+
Mais bon fondamentalement utiliser X ou Y ne change pas grand chose c'est juste que tu devras passer par une copie de fichiers (potentiellement lourde) pour restaurer ton système dans le cas ou ce que tu veux restaurer réside dans le volid 0 et faire attention à ne pas faire dégâts dans ton snapshot (raison pour laquelle j'ai mis un --exclude=/mnt au niveau du rsync). C'est la partie délicate... un oubli est vite fait!
+
 
+
Basculer ton live vers un voldid > 0 n'est pas complexe, snapshot (offline évidemment) puis remontage de l'ID 0 sur un quelconque point de montage puis supression de tout *sauf* du "répertoire" représentant ton snapshot (évidemment.... vu que sinon tu dégages tout) à partir de ce point de montage.
+
</en_francais>
+

Latest revision as of 21:33, 11 April 2012

Does btrfs-zero-log work only on a single partition or can it handle BTRFS filesystems spanned across several devices?

[edit] LVM functionality is only partially replaced by BTRFS

One thing about LVM Volumes in contrast to btrfs sub volumes is quota's. Every LVM VOlume has a hard quota and if it runs out of space other volumes are not running out of disk space. This is one functionality that btrfs has not (yet) implemeted.

For this reasson I stil use LVM, but with btrfs filesystems in the volumes and not with ext4 (anymore).

[edit] SHow free blocks in btrfs

The other day I had a btrfs FS that was running out of disk space. But df -h showed that there was still 20% free (subvolumes a presumably not calculated since they are seperately mounted?). And du -s works the other way around (this also calculated subvolumes and sums, so it counts the unaltered blocks in snapshot sunbvolumes extra). Is there a way to find out how much free blocks there are available in a btrfs filesystem?

Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff