Difference between revisions of "Btrfs"

m
small edits
m (removed tvar)
m (small edits)
Line 154: Line 154:
== move a volume ==
== move a volume ==


But there is an '''easy and secure way''' to move a volume to another disk/device. If you use Btrfs itself to move a volume, there will be no danger. You even can do this '''while the volume is in use'''.
There is an '''easy and secure way''' to move a volume to another disk/device. If you use Btrfs itself to move the volume, there will be no danger. You even can do this '''while the volume is in use'''.
* Create the partition you want to use in the future '''without formatting''' it. Or remove the filesystem when one is present
* Create the partition you want to use as ''destination'' '''without formatting''' it. Or remove the filesystem when one is present
* Add this device to your volume by '''btrfs device add ...'''
* Add the ''destination'' device to your volume by '''btrfs device add /dev/nvme9n1p3'''
* Remove the previously used device from your volume by '''btrfs device remove ...'''
* Remove the ''source'' device from your volume by '''btrfs device remove /dev/sdz3'''
Btrfs will notice, that it is necessary for this setup to move all data from the old device to the new device. And it will start immediately to move it in the background. Meanwhile you can use your PC as you want. Empty Blocks will not be moved. Compressed data will remain compressed. Snapshots will remain. '''The UUID of the filesystem will remain the same''', but btrfs will be aware of this. So this is also easy with '''/boot/grub/grub.cfg''' and '''/etc/fstab'''.
Btrfs will notice, that it is necessary for this setup to move all data from the source device to the destination device. And it will start immediately to move data in the background. Meanwhile you can use your PC as you want.  
* Empty Blocks will not be moved
* Compressed data will remain compressed
* All Snapshots will remain
* '''The UUID of the filesystem will remain the same''', but btrfs will be aware of this
* If you used the UUID to identify your volume, you even wont´t need to edit '''/boot/grub/grub.cfg''' and '''/etc/fstab'''  
* Only, '''don't shutdown while the move of the volume is not complete'''.
* Only, '''don't shutdown while the move of the volume is not complete'''.
If you want to watch the volume move, inside a terminal:
If you want to watch the volume move, inside a terminal:
translator
1,001

edits