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.
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:
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.
Make sure default subvolumes like @, @home are not used
Install distro as normal, do not format BTRFS partition
Boot Live media
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.
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
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
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
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:
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:
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).