btrfs filesystem defragment -r -- does it affect subvolumes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When I do a 
btrfs filesystem defragment -r /directory
does it defragment really all files in this directory tree, even if it
contains subvolumes?
The man page does not mention subvolumes on this topic.

I have an older script (written by myself) which does a 
"btrfs filesystem defragment -r" on all subvolumes recursivly:

  btrfs filesystem defragment -r $m
  for s in $(btrfs subvolume list $m | awk '{ print $NF }'); do
    [[ "$s" =~ ^@ ]] && continue
    [[ $(btrfs subvolume show $m/$s) =~ Flags:.*readonly ]] && continue
    btrfs filesystem defragment -r $m/$s
  done

I wonder why I have done it that way :-}


-- 
Ullrich Horlacher              Server und Virtualisierung
Rechenzentrum TIK         
Universitaet Stuttgart         E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Allmandring 30a                Tel:    ++49-711-68565868
70569 Stuttgart (Germany)      WWW:    http://www.tik.uni-stuttgart.de/
REF:<20170831070558.GB5783@xxxxxxxxxxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux