How would I manually install Endeavour with BTRFS with partitions

I believe Endeavour has the option to automatically install with btrfs while selecting clean installation,
however I would like to do it through the manual partitioning method, with subvolumes for /root, /home, /sys, etc.

I’m not a newbie, but I’m not that advanced as well (I know how partitions, and mounting work), and I’ve been using ext4 so far.
I want to switch so I can enable snapshots, because my system often breaks because of updates.

I’m not familiar with btrfs, so please do tell me exactly what subvolumes and everything to create, as well as how to go about it.

Thanks in advance,
Gaurav

If you use manual partitioning and create a btrfs mounted at /, it will automatically create all the recommended subvolumes for you in that partition.

Specifically, it will create subvolumes for:

  • /
  • /home
  • /var/log
  • /var/cache

If you want to customize those, you can edit /etc/calamares/modules/mount.conf but be sure you know what you are doing. The defaults are a pretty reasonable starting place.

For example, you mention subvolumes for /root and /sys but before doing that make sure you have a good reason for doing so and understand the implications. You almost definitely don’t want a subvolume at /sys

To add to wwhat @dalto is saying, I also don’t recommend a seperate partition for the /root directory either. Root is kind of your last resort login and having it’s home directory on a seperate volume means if you loose that volume the root login probably won’t work right. It was meant to be part of the root “/” volume so that it would always work unless you actually lost the root volume itself.

Filling it up shouldn’t be a concern since you’re really not supposed to log in as root and use the root login minimally.

This is how I accomplish that:

  1. Make sure default subvolumes like @, @home are not used
  2. Install distro as normal, do not format BTRFS partition
  3. Boot Live media
  4. Move subvolumes as I wish, for example @ goes to /linux/endeavour/root. @home goes to /linux/endeavour/home, @cache, @log and other directories under /var are merged into a /linux/endeavour/var subvolume, @srv goes to /linux/endeavour/srv.
    EDIT: These are my preferences, you can modify subvolumes as you wish. Also if you merge var, move pacman database outside of var or it will not be snapshotted.
  5. Chroot in, modify /etc/fstab, reinstall GRUB and regenerate grub.cfg

I have tried many distros and Anaconda (from Fedora) is the only installer I have come across with that feature so I do this work around for anything else. Not even YaST2 from openSUSE :man_facepalming:

You only need to do this if you are installing into an existing btrfs partition and trying to share a single btrfs filesystem between two distros.

For what the OP wants, this is drastically overcomplicated.

Wow thanks! I didn’t expect it to be that easy.

Also I have a small question.
So I have a 220gb SSD and a 1TB HDD.
I would like to keep the bootup files on the SSD and everything else on the HDD (such as /home), would it be possible for me to achieve something like this, and if so, which volumes do I keep on the SSD and which ones on the HDD.

Aaaand how I would set these up to be on the different drives.

Sorry for all the questions, not really very familiar with the inner workings of linux

Thanks

I would advise against putting /home on your hdd. The reason is that there are config files and cache stored in /home. There will a performance hit if you do that.

Instead. Do it this way. Put / on a btrfs partition on you ssd. Create a btrfs partition for you hdd and mount it at /data(or any other name you like).

After the install is complete. Create subvolumes for documents, videos, downloads, pictures, music. Then symlink those into the proper locations. This way your /home is on your ssd but the big files which consume lots of space are on the hdd.

However, if you would prefer to do it the other way, it is easy. Just create a btrfs partition in the installer mounted at / on the ssd and create one on the hdd mounted at /home

3 Likes

I don’t advise this sort of thing but I have a pretty similar setup to @gaurav’s: A small 120GB SSD and a 1 TB HDD. For conformity with timeshift I only have two subvolumes: @ and @home, both are on the SSD. However, I have a 60GB partition on my HDD, which I mount on ~/mount (later I realized I should have made the directory under / instead of ~/), and then I bind mount /var and /tmp on ~/mount/atvar and ~/mount/attemp respectively. This means that my entire /var is on my HDD (I did this to reduce writes). However, this also means that timeshift will not take snapshots of /var and I’ve been meaning to fix that. Lastly I have a big hdd partition which I mount on ~/hdd. So anyway here’s my fstab:

/dev/sda1		/boot		vfat		defaults,noatime			0 2
/dev/sda2		/		btrfs		compress=zstd,noatime,ssd,subvol=@	0 1
/dev/sda2		/home		btrfs		compress=zstd,noatime,ssd,subvol=@home	0 1
/dev/sdb10		/home/leibniz/hdd	btrfs	compress=zstd,noatime,space_cache=v2			0 1
/dev/sdb6		/home/leibniz/mount	btrfs	compress=zstd,noatime,space_cache=v2			0 0
/home/leibniz/mount/atvar	/var		none	defaults,bind				0 0
/home/leibniz/mount/attemp 	/tmp		none 	defaults,bind				0 0

On most distros, having a separate /var would not be a big deal but because pacman stores it’s information on /var/lib this will leave you in a huge mess if you ever need want to restore a snapshot. Basically, the system will think you have different package versions installed than you actually do. Worse, if you lose that data do to hdd failure or corruption, pacman will no longer have any idea what you have installed.

Mounting /tmp on your hdd might reduce ssd writes but it also reduces performance. Given the realistic lifespan of an ssd, I don’t think that would worth it for most use cases.

That’s why I worked on a somewhat elaborate plan to make snapshots of /var as well. I can’t put /var on my ssd as it has 38 GiB of free space and /var takes up 25 GiB. For anyone in a similar situation, here’s the plan:

  1. Converting /var to a subvolume
    1. Make a bootable linux drive
    2. Copy the contents of var to somewhere safe
    3. Delete ~/mount
    4. Make /mount
    5. Make /mount/vardir
    6. Make /mount/vardir/@var subvolume
    7. Mount the subvolume properly:
    8. Create snaphots directory:
    9. Create directory that will actually hold /var data:
    10. Set permissions:
    11. Copy over the /var directory contents:
    12. Make first snapshot:
    13. Edit fstab:

Converting /var to a subvolume

Make a bootable linux drive

Copy the contents of var to somewhere safe

Delete ~/mount

Make /mount

Make /mount/vardir

Make /mount/vardir/@var subvolume

Mount the subvolume properly:

mount /dev/sdb6 -o subvol=@var /mount/vardir

Create snaphots directory:

mkdir /mount/vardir/snapshots

Create directory that will actually hold /var data:

mkdir /mount/vardir/actualvar

Set permissions:

chown user:user -R /mount/

Copy over the /var directory contents:

cp <pathtocontents/*> /mount/vardir/actualvar

Make first snapshot:

btrfs su snapshot /mount/vardir /mount/vardir/snapshots/1

Edit fstab:

/dev/sdb6    /mount/vardir   btrfs   compress=zstd,noatime,subvol=@var 0 0
/mount/vardir/actualvar   /var  none   defaults,bind  0 0

Wow, that is a lot of work. You also need to somehow make sure that every time a timeshift snapshot is generated, you take a snapshot of /var at the same time. Likewise, you need to make sure they are cleaned up together.

Can I propose an alternative?

You probably don’t need all of /var to be on your hdd. You probably only need one or two places. In fact, it may only be /var/cache or maybe even only /var/cache/pacman. There could be a couple of other spots too depending on what software you run.

Just let /var be part of your / and then identify the handful of locations that take up all the space. Then mount directories or subvols from your hdd at only those locations.

While I agree with @dalto that it’s better to put /home on SSD and then Documents, Pictures, Videos, Downloads, etc… on HDD, if you did it the other way, i.e. put /home on HDD, that’s not much of a problem. You can still get pretty much the same performance if you move only .config and .cache to the SSD, as those two directories are pretty much the only two inside home that give you a noticeable performance boost if they can be accessed quickly. Maybe also .local… There may be others that could benefit from being on a fast SSD (like .mozilla), but it’s unlikely you’ll notice any difference in performance with anything other than .config and .cache.

Thanks, that could work as well. To clarify, I would put /var under / but make a separate subvolume for /var/cache which I will mount on my hdd, right? If so where do I go to make the subvolume? Do I go to a directory the hdd is mounted on, and just make a regular subvolume there? But in fstab I’ll mount the subvolume in a different location (/var/cache).

If that drive is btrfs, you can make the subvol anywhere on it and then just mount it at /var/cache

If it isn’t, you can use a symlink or a bind mount on a directory the same way you have up until now.

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