Partition Resizing Question

I would normally use an external drive, but being a laptop that’s not practical. So I’d like to shrink the Arch partition and format the unallocated space to use for backups. Will I risk screwing up the install? Or is it as straightforward as it seems?

Being a Btrfs partition, you could resize it while it is online, that is, it won’t need to be unmounted first.

That being said, there is always a possibility for filesystem corruption when manipulating partitions so you might want to backup your valuable data first.

Also, you may perhaps not need to create a new partition for your backups. It is possible to create new subvolumes on the root of the Btrfs partition for that purpose.

However, having several backups, including backups on external storage medium is recommended.

If anything happens to the filesystem or the disk itself, your backups will be affected as well if you don’t have them on other mediums.

3 Likes

Note that some filesystems cannot be shrunk. Now I don’t remember if btrfs is one of them, but better check before doing anything.
And as @pebcak pointed out, doing backup is always a sane choice.

2 Likes

As mentioned in my previous post, when it comes to Btrfs, not only can it be shrunk, but also the resizing can be done while it is online. That is, it won’t need to be unmounted first for it to be resized.

2 Likes

Yes it’s as straight forward as it looks. However that said boot in to you installl media and resize from there, not in the running OS. As stated make sure you backup anything you don’t want to loose first. As for being able to resize yes BTRFS can be safely resized.

1 Like

First, many thanks for the responses! It seems I have two options then.

  • Shut down and boot into a live USB and resize from the live environment.
  • No need to shut down. Just resize as I would in Windows, format the new partition, reboot to make sure all went well.

I think this is a really good suggestion. If you use a subvolume instead of a partition, you don’t need to worry about either partition running out of space because the subvolumes are able to occupy as much space as they need within the disk.

Also, if at some point in the future you decide to pivot to another backup solution for this laptop you can simply remove the subvolume and :magic_wand: it’s like it was never there, no need to hack around with partitions or filesystem size.

1 Like

After some searching, creating Btrfs subvolumes looks quite involved. I may have been using Linux for a long time, but I’m by no means an expert. Intermediate at best.

Assuming I do decide to partition, I’m guessing I’ll need to use the Rsync option in Timeshift to utilize the partition?

Hmm, I’m not sure but you may be thinking of something else. Creating a subvolume is as simple as running btrfs subvolume create. See here for example: https://wiki.archlinux.org/title/Btrfs#Creating_a_subvolume

If you want to make it a top-level subvolume (instead of nested inside of the root subvolume), you would first mount the “true” root of the disk somewhere.

sudo mount -o subvolid=0 /dev/nvme0n1p2 /mnt

Then create your new subvolume inside of that mount point.

sudo btrfs subvolume create /mnt/my_awesome_new_subvolume

Finally, unmount the root of the disk (unless you want to keep it mounted for some reason):

sudo umount /mnt

That’s all there is to it!

If you want it to be automatically mounted at boot, just create a mount point for it somewhere and use the option subvol=my_awesome_new_subvolume in /etc/fstab.

If you use a separate partition, yes: for Timeshift to work you would have to switch to the rsync option because it will be a separate filesystem.

1 Like

Awesome! Many thanks. I’ll consider my options and tweak as needed over the weekend.

1 Like

I strongly reccommend partitioning cause less chance of loosing ALL the data that way if something happens to either partition.

1 Like

I don’t think a strong recommendation is in order; in my opinion the level of data protection you would get from using a separate partition is flimsy at best. In the case of disk failure, in many cases (depending on the nature of the failure) a separate partition is not going to protect you.

For example, in the case of mechanical or electronic failure, or physical damage, certain types of logical errors, or data corruption (from sudden power loss for example), all partitions can be affected at the same time. Since using the same disk for “backups” is prone to this shortcoming no matter how you set it up, I don’t think introducing the additional limitations that come with a separate partition is worth it.

Really, it’s not a true backup unless a separate device is used for backing up to.

Not to veer too far off topic, but btrbk is a really neat tool which makes backing up Btrfs snapshots to a separate device really easy. You can run backups over SSH, and you can even use a non-Btrfs device as the storage target if you want to.

Personally I find this really useful for laptops, for having some backup capability without needing to attach a separate device. I can keep a few snapshots locally on the disk, but then I can also send snapshots over SSH to a device on my Tailnet.

2 Likes

I don’t agree cause odds are only one partition or the other would go down and be unrecoverable, usually the OS partition. It is far safer to have any data you do not wish to loose on a separate drive, but barring that a separate partition.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.