Seperate Home

- 4 mins

After using manjaro for over a year and falling in love with it, it started breaking way too frequently. With every pacman -Syu, which is unavoidable if you are using Arch, something crashed for sure. Sometimes a kernel update would break it and sometimes a driver would just not work anymore. As a result manjaro wont boot up anymore, sometimes giving an error at boot or sometimes just hangs at the splash screen. You downgrade the kernel to the previous one and it just wont work.

This used to happen every weekend and my whole weekend would be me googling my way out, posting it on Manjaro forums, waiting for a reply, booting in via liveusb, using chroot, changing something here, changing something there, damn it is painful.

So I decided I wasn't going to fix it the next time something broke for no reason, instead I would do a fresh install of latest version. So Fenil, you mean to say backup the important data somewhere, sit selecting the important stuff, copy them and wait for the huge files to transfer, if not enough space then copy the rest somewhere else? Nope. There's an easy way out.

I was fortunate enough to bump into an article while installing manjaro for the first time which suggested me to have a seperate /root and /home partition, I didn't know the use case back then but did it anyway. Now I know why.

Note > Having a /home in the root parition is different from having a seperate parition for /home.

If you have "cooked" /root and /home paritions seperately you have made the "OS" data and your "User" data essentially independent and kept them in seperate boxes. Now every time your /root box breaks (where all the OS stuff lies) you just have to replace the /root box with the new OS and attach (aka mount) the existing /home box at a specific location (/home directory of the new OS) so that the /home box is mounted when the new OS boots up.

Let me walk you through. This is wrt to manjaro-installer but its the same with other linux based OS installers as well.

Re-installing manjaro using live-usb on existing root partition.

This replaces Manjaro with the other OS (Updated version of Manjaro in this case) on the root partition. You can see an option to re-use home parition for the new OS. You just select it and you are done, the new working OS with all your data intact. But all the OS installers wont have this option during install and you'd need to do it manually, but its super easy.

After fresh install boot up the OS and open /etc/fstab. You should see two paritions one is /boot/efi and the other is /root .

What is missing is the /home parition info

.

Now to identify which was your home parition before you need to know something about it like the size or maybe partition type so you can identify it from this list because it currently isn't mounted anywhere so you can get no clear identifier. So do lsblk and I remember the size of my home parition was 130G (nvmpe0n1p8) (note - here mount point is /home as I had already mounted it, it wont be visible to you).

then doing sudo blkid

Some Shit

Copy the UUID corresponding to nvmpe0n1p8 and add an entry in /etc/fstab like this.

Some Shit

Thats it! now just reboot now and you have a new OS with all your data intact. This also works if you want to try some different distribution (with some caveats) without losing or moving your data.

So I started doing this everytime an update breaks something and I'm back up and running in 10 mins. But it has some drawbacks too, but I ignore them given the time gain.

I've seen quite a few linux users not having a seperate home partition. So the next time you are installing any flavour of linux from scratch (or dual booting) make sure you have a seperate home.

Ok, Bye.