Separately /home partition

Hello Manjarolians, I’m Kiki :disguised_face:

First of all I would like to introduce myself.

Well I’m totally new in Manjaro and Linux at all but even though I’am old (I’m over 40 years🤯) I’m pretty smart and fast lerning. My main desktop PC is almast as old as I am so my ASRock motherboard is still on BIOS system, my disks are HDD Drives and I still have CD-ROM drive (I’m not sure it’s working, cos I don’t remember when I used it last time). And no, I don’t have a floppy drive, it is not that old PC.

Manjaro is my first Linux ditribution. Admittedly the first linuks I have installed was Mint, but I decided to remove it after 10 min of using and Manjaro KDE Plasma I loved at first sight.

After 2 weeks of testing Manjaro as a second OS, I decided to totally remove Windows from my PC. I do backup of my files and prepare 250Gb HDD drive to install Manjaro on BIOS/GPD style. I proceed to install a Manjaro with separately /home partition. Unfortunately after installation and reboot there was Error: Failed to mount /home drive partition. I was try some methods from other topics with this error from this forum, but nothing worked. When I tryed to chroot, there was information: No Linux OS detected. After 2 days of reinstalling, partitioning with other methods I decided to install Manjaro on a single /root partition, and everything work corectly.

My question is, what can I do now to separate /home partition without reinstalling Manjaro and crushing my stable working OS? Or if it is not possible, what could be reason of the /home mounting broblems about which I wrote earlier.

very little actual information about why the process you wanted
(a separate home partition)
would fail

If you want a separate /home partition
you have got to have … a separate partition
one for / (root)
one for /home

If your drive (as of now) is just one partition

you cannot do anything else but to start over - creating two partitions
one for / (the root filesystem)
and
one for /home

The installer should be able to do that for you.

We don’t know why that was.

Sorry @Nachlese but I think you did not read my post from beginning. As I said, I was installing system on two separate partitions, / (root) and /home, and after that installation was error Failed to mount /home partition. I was try several of solutions described here, but none helped.Than I install system on one partition and everything work fine, and my question is: Do I have to start installation from beginning and looking for solution of mounting problem, or is it possible to create partition /home using currently installed OS without reinstalling my working Manjaro Linux🤦🏽‍♂️

That’s what you said - that’s what you wanted to do.

but, alas:

… I did read :wink:

Do you (as of now) have two separate partitions?

… probably not - because:

… and we just don’t know what might have went wrong when you tried to use two partitions

there is no information in here that could help finding that out

So please don’t make an idiot of me, just tell me what information you need to possibly help me, or if you can’t help me then don’t write at all.

1 Like

If it’s not clear from what I did write so far (there is no information based upon which one could tell what might have went wrong and why …)
I’ll now follow you advice.

Unfortunately, I can’t unwrite what I already wrote.

Take care!

Many thanks @Nachlese

On the first try, I was installing Manjaro on single HDD Drive with two partitions: / (root) and /home (and swap and Bios Boot partitions as it is described here: GRUB - ArchWiki) and this installation resulted in an error Failed to mount /home drive partition. Now I have my Manjaro installed on one / (root) partition on the same Single HDD Drive (and again there are swap and Bios Boot partitions) but I want to have a separated / (root) and /home partitions (on the same one HDD Drive I’m talking about) and again the question is: Is it possible to create separated /home partition on my single HDD Drive while keeping the currently installed OS, no need to reinstall or it is impossible and I have to start installation from beginning?

And that’s exactly what I’m looking for :star_struck:
Thanks, You are the best :cowboy_hat_face:

for someone who recently did exactlythis, i can vouch for Separately /home partition - #6 by maycne.sonahoz

if not this is what I exactly did, it’s let’s say no nonsense less hariy way of doin it; How to Move Your Home Folder to Another Partition in Ubuntu

Gee, thanks, whippersnapper! What does that make me, then? :cry:

Get off my lawn! :rofl:

On account of the partitioning thing, if you already have a spare partition that you can use for /home, then you can read through this guide with regard to moving the contents of your current /home to the new partition. :arrow_down:

If you do not have a spare partition available right now, then I’m afraid you’re going to have to make room for one, even if it means reinstalling.

Another alternative to having a separate partition for /home is to use btrfs as the filesystem, with two subvolumes ─ @ and @home. The installer can set that up for you ─ you do of course still need separate partitions for the EFI system partition and the swap partition.

The advantage of btrfs is that subvolumes behave as if they are separate partitions, but at the same time, the free space is shared among all the available subvolumes. So you don’t have to worry about partition sizes when creating a separate / and /home, because technically they are on the same partition, but they are still separate namespaces in how the system sees and treats them.

As for the error you had on your /home partition during the first install, that could be caused by anything, ranging from disk failure over having chosen incorrect partition boundaries ─ which shouldn’t happen, because the partitioning tool is supposed to correctly align the partitions.

Lastly, even if you decide not to go with btrfs, the filesystem type used for both / and /home must be a Linux-native filesystem such as ext4, XFS, btrfs, JFS, reiserfs et al. You cannot use a Microsoft- or Apple-native filesystem for that, because the Apple-native filesystems are only poorly supported, and the Microsoft-native filesystems do not support POSIX file ownership and permissions.

Can you post fdisk -l ?

I have brtfs file system for my current root partition, so is it now possible to create subvolumes without reinstalling Manjaro?

I will do this later, I’m at work now😉

Yes, it is, but you’ll then need to do a few things… :arrow_down:

  1. You’ll need to create an @home subvolume with the btrfs command.

  2. You’ll need to add an entry for the @home subvolume in your /etc/fstab. Something along the lines of… :arrow_down:

UUID=the-same-uuid-as-for-root     /home   btrfs   subvol=/@home,defaults,other-mount-options-here   0   0

You may want to check the subvolid for the new subvolume too ─ you can add that to the mount options in /etc/fstab, similar to the entry for the root subvolume, although this is not actually required ─ and if this is on an SSD, then you may also want to add the noatime mount option for both subvolumes.

  1. You’ll still need to manually move over the contents of your /home to the new subvolume. This may require temporarily renaming /home into /home2, and then creating a new /home directory, and then manually mounting it to the new subvolume. Something like this ─ as root… :arrow_down:
mv /home /home2 && mount -t btrfs -o subvol=@home the-UUID-of-your-partition /home && cp -RPpv /home2/* /home/

Best is to do all of this while in single-user maintenance mode, as per the tutorial I posted higher up, so that you can be sure that /home is not in use. Then, after the copy, you can compare /home2 and /home to see whether everything is there, and if the results are satisfactory, then you can reboot, and afterwards, remove /home2.

You should either way be logged out of the GUI and logged in as root.

1 Like

Summarizing…

1

Log out of the Plasma GUI completely, and when you see the login screen reappear, press Ctrl+Alt+F2. You will now see a character-mode login prompt. Log in as the root user.

If you did not set a separate password for the root account during installation, you may need an extra step, because it is imperative that you are not logged into any other account than the root account.

So if you set the same password for root as for your regular account at installation time, then you need to first re-enable the root account. You do this by logging in at the character mode console as yourself and then issuing… :arrow_down:

sudo -i

Then you must set the root user’s password ─ make sure that it is a different one to the one you use for your regular user account. :arrow_down:

passwd

You will be asked to type the password again for confirmation. When it is done, issue the following command… :arrow_down:

systemctl isolate rescue.target

The system will now switch over to single-user maintenance mode. You will be prompted for the root password. At this point, you no longer have a network connection and no GUI, so make sure you can read this post from another device, or print it out.


2

Now we are going to create the new subvolume and migrate your data. :arrow_down:

cd /
mv /home /home2
btrfs-subvolume create @home
cp -RPpv /home2/* /home/

Verify that everything has been copied over. The copying process is verbose, so you should already be able to see it during the copying, but still, it doesn’t hurt to check twice.

If everything has been copied over, then you must edit /etc/fstab and add an entry for the new subvolume. :arrow_down:

nano /etc/fstab

This entry will largely be the same as for the root filesystem ─ including the UUID ─ but instead of the mountpoint being /, it must be /home, and instead of the subvol=/@ mount option, you must now specify subvol=/@home. Also make sure, if you include subvolid= that you use the correct one, because that will be different from the one for the root subvolume.

Exit the editor with Ctrl+O followed by Enter and then Ctrl+X.

Now you can delete the contents of the /home2 directory. :arrow_down:

rm -rf /home2 && sync && systemctl reboot
2 Likes

Thanks @Aragorn for your advice and tutorial. I will read everything twice and than prepare to do all steps. Have one more question, when I do this subvolumes, and in future I will have to reinstall my Linux, will it be possible to do this without touching my /home subvolume?

Well, in theory, Manjaro is meant to be installed only once ─ you don’t have to reinstall, as you need to do with non-rolling distributions ─ but of course, one must never say “never”.

That said, if you do not reformat the filesystem, then it would be possible to preserve your @home subvolume, but if you do reformat, then it will be wiped. It does after all live on the same btrfs filesystem.

The good news is that you can copy or even move an entire subvolume to another btrfs filesystem on another drive. But, as the old saying goes, there’s no substitute for… :arrow_down:

Gollum_Backupses

1 Like

thanks @Aragorn. Your help is unmatched. After further reflection, I think whether creating an additional partition makes sense. In fact, the best solution is to backup data regularly and I have 1Tb USB Seagate HDD to store it. Do you think I’m right? Are there any other reasons for having a separate /home partition than data security?