You are not logged in.
I have since migrated all my data out of NTFS partitions to BTRFS partitions and now I need to extend my main BTRFS partition. My BTRFS partition is 200 GiB pushed to the end of the partition table and I want to extend it backwards, but I'm aware that could be dangerous. Here's what gdisk -l /dev/... outputs:
Disk /dev/...: 7814037168 sectors, 3.6 TiB
Model: ...
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): ...
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 7814037134
Partitions will be aligned on 2048-sector boundaries
Total free space is 7387244141 sectors (3.4 TiB)
Number Start (sector) End (sector) Size Code Name
6 7387242496 7395631103 4.0 GiB 0700 EFI
7 7395631104 7814035455 199.5 GiB 8300 Linux filesystemI can recreate the EFI partition, that's not a problem for me, but the issue is with extending the BTRFS partition backwards to fill the rest of the drive. Can I really just use GParted to extend it back? Would there be a better way to do this?
Also, to back up my files, I was planning on making new snapshots of both my /home and / subvolumes, then tar those snapshots to a separate file like so: `sudo XZ_OPT='-vv' tar cfa /media/files/Backup/home.tar.xz /home/.snapshots/2`. Is there a better way to do this?
Last edited by muizz (Today 03:23:23)
Offline
Is your backup disk btrfs? The safest way is to btrfs send snapshots of / and /home to the backup filesystem. If that is possible you can simply reformat the original disk and send the snapshots back from backup. I would avoid trying to resize the partition that way if at all possible.
Offline
Thanks! It was confusing reading the docs because subvolume and snapshot was being used interchangeably (I thought they were separate concepts) but I figured it out in the end. I now have a complete BTRFS filesystem ![]()
I'm now stuck being unable to create snapshots, but I'll try looking into that later today.
Offline
Just resolved this tonight! Here's the complete process before I mark this as SOLVED.
I used Btrfs Assistant (which uses Snapper under the hood) to create new snapshots for each of my BTRFS subvolumes. Snapper will make these read-only for you so this saves a lot of headache later on!
I then reformatted an old SSD to BTRFS, and then did the following in a Live CD environment.
I created two folders in /mnt: /mnt/source and /mnt/backup, and mounted my temporary backup disk to /mnt/backup, and my main BTRFS drive/partition to /mnt/source.
Then I sent my snapper snapshots like so:
btrfs send /mnt/source/root/.snapshots/19/snapshot | btrfs receive /mnt/backupThis places the snapshot folder inside, so I renamed that folder to /mnt/backup/root_backup. Because snapper made these snapshots read-only automatically, this just works!
I did the same again for /mnt/source/home/.snapshots/2/snapshot.
After unmounting /mnt/source, I used gdisk to "reformat" my primary drive and created a new EFI and BTRFS partition.
Then I sent them back and renamed the subvolumes back to root and home.
Then I changed their read-only status to read-write like so:
btrfs property set -f -ts '/path/to/snapshot' ro falseI could probably do the previous step better, but it worked for me so I'll leave it as is.
While you still can, mount your root subvolume and delete the Snapper config files in /etc/snapper/configs as they will prevent you from creating any snapshots once you are back into your Arch system, or from deleting the configs from inside BTRFS Assistant.
Afterwards, it's just referring back to the manual arch install process. After rebooting into the Arch Live CD, I mounted all the necessary drives and generated a new /etc/fstab, and then installed and regenerated GRUB and its config files. That's it!
Offline