I am trying to move my system from an SSD that’s running out of space, onto a larger nvme drive, but I’m having some trouble understanding the syntax of the commands. Would really appreciate some assistance in clearing up my confusion.
I created a fat 32 for the ESP on the other drive and used dd to copy everything over. For the rest of the nvme, I made one big btrfs partion.
Now, I want to run btrfs-replace and move everything over to the other drive, including the top level of the btrfs system, the timeshift-btrfs snapshots, etc. An exact copy basically. However, I cannot for the life of me understand the syntax for the btrfs-replace command, despsite reading the docs, man pages and countless guides and forum posts.
The part that trips me up is this part of the man pages/docs:
start [options] <srcdev>|<devid> <targetdev> <path>
Is <path>
referring to the path that <srcdev>
is mounted, or <targetdev>
?
This it the lsblk output for the relevant drives (I want to move everything from /dev/sdc2 to /dev/nvme0n1p2):
sdc 8:32 0 232.9G 0 disk
├─sdc1 8:33 0 511M 0 part /boot/efi
└─sdc2 8:34 0 232.4G 0 part /mnt/top-level
/var/lib/docker/btrfs
/var/cache/pacman/pkg
/home
/
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 550M 0 part
└─nvme0n1p2 259:2 0 953.3G 0 part
Now, thinking that <path>
refers to <srcdev>
I wasn’t sure what mountpoint to use, since I have several subvolumes, mounted in different places.
See my fstab:
# <file system> <mount point> <type> <options> <dump> <pass>
UUID=FDE3-B78F /boot/efi vfat umask=0077 0 2
UUID=313dc380-0d06-44ec-8652-062bd60bd5c6 / btrfs subvol=@,defaults,noatime,space_cache,noautodefrag,compress=zstd 0 0
UUID=313dc380-0d06-44ec-8652-062bd60bd5c6 /home btrfs subvol=@home,defaults,noatime,space_cache,noautodefrag,compress=zstd 0 0
UUID=313dc380-0d06-44ec-8652-062bd60bd5c6 /var/lib/docker/btrfs btrfs subvol=@docker,defaults,noatime,space_cache,compress=zlib 0 0
UUID=313dc380-0d06-44ec-8652-062bd60bd5c6 /var/cache/pacman/pkg btrfs subvol=@var-cache-pacman-pkg,defaults,noatime,space_cache,noautodefrag,compress=zstd 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
UUID="51596fec-9d35-4522-87c5-64bacce1314c" /mnt/hdd ext4 defaults,errors=remount-ro 0 2
UUID="92bd7cf2-8b9a-4806-a0d8-4384f5afb5ed" /mnt/newdata ext4 defaults,errors=remount-ro 0 2
When I run btrfs filesystem show, I get:
Label: none uuid: 313dc380-0d06-44ec-8652-062bd60bd5c6
Total devices 1 FS bytes used 167.78GiB
devid 1 size 232.39GiB used 232.38GiB path /dev/sdc2
Do I put in /dev/sd2 for the <path>
part? Or should I use /, or /mnt/top-level where I temporarily mounted /dev/sdc2 - so I could access snapshots in timeshift-bfrfs?
Any insight into this would be greatly appreciated, also any tips for how to get the system up and running after I hopefully pull of btrfs-send.
On a related note: If I want to send a snapshot or snapshots to another non-BTRFS device, how can I do it?
I saw from my research that you can create a file version of a snapshot with btrfs-send, using the -f flag.
From my understanding the btrfs snapshot would have to be read-only for this to work. So if I set a snapshot to ro=true, can I just do something like this:
sudo btrfs send -f 2024_12_15-11-00-00 timeshift-btrfs/snapshots/2024-12-15_11-00-00/@/
Where ‘2024_12_15-11-00-00’ is the name of the f ile. If so, can I just rsync that file over to another drive?
If there were an easy way to send every snapshot in the timeshift-btrfs directory (at the top level of the btrfs system) to a backup directory on a non-btrfs drive, that’d be even better.