On 2018-05-27 10:48, Peter Suetterlin wrote:
Carlos E. R. wrote:
On 2018-05-27 10:37, Peter Suetterlin wrote:
jdd@dodin.org wrote:
You can simply replace one disk with another online.
but howto move /?
From my notes: Basically it's
btrfs replace start /dev/oldroot /dev/newroot /
In my case /dev/newroot was a larger partition, so after that you do
btrfs filesystem resize 1:max /
Then the standard stuff (grub install if it's a different disk), check /etc/fstab if there are other partitions (swap, home) involved that have changed. (In my case I move a server root between mdadm raids, so I had to also adjust mdadm.conf and grub.cfg that referenced the md uuid)
There's a nice webpage at https://www.howtoforge.com/a-beginners-guide-to-btrfs
It also copies the volumes structure?
Yes, of course.
Can this be used to create backups? Or just one backup per disk?
No, it replaces things. The old partition is emptied (likely, only all relevant superblocks are zeroed - I didn't check).
Uh oh... if the procedure fails for some reason, you have neither the initial disk nor the final disk. With XFS I can "image" an entire XFS filesystem or partition to a file on another partition, and this image can be used to create a copy of that on another disk later on. The file is a full backup. I mention xfs because xfs and btrfs share some developers, so some features appears on both. xfs_copy(8) xfs_copy - copy the contents of an XFS filesystem xfs_copy copies an XFS filesystem to one or more targets in parallel (see xfs(5)). The first (source) argument must be the pathname of the device or file containing the XFS filesystem. The remaining arguments specify one or more target devices or file names. If the pathnames specify devices, a copy of the source XFS filesystem is created on each device. The target can also be the name of a regular file, in which case an image of the source XFS filesystem is created in that file. If the file does not exist, xfs_copy creates the file. The length of the resulting file is equal to the size of the source filesystem. However, if the file is created on an XFS filesystem, the file consumes roughly the amount of space actually used in the source filesystem by the filesystem and the XFS log. The space saving is because xfs_copy seeks over free blocks instead of copying them and the XFS filesystem supports sparse files efficiently. xfsdump(8) xfsdump - XFS filesystem incremental dump utility xfsdump backs up files and their attributes in a filesystem. The files are dumped to storage media, a regular file, or standard output. Options allow the operator to have all files dumped, just files that have changed since a previous dump, or just files contained in a list of pathnames. The xfsrestore(8) utility re-populates a filesystem with the contents of the dump. -- Cheers / Saludos, Carlos E. R. (from 42.3 x86_64 "Malachite" at Telcontar)