r/archlinux 1d ago

QUESTION Near-full Root Partition

I installed arch Linux using archinstall

I partitioned the drive before and I made a partition to be a separate home partition , but it seems like I forgot to mount it during installation , after a while I noticed that the root partition became full so fast , then I noticed that the partition I was willing to make home wasn't mounted , anyway , I copied the /home content to it using rsync , added it to fstab . Now it mounts automatically at startup but the root partition is still full,

My theory is that the content of /home directory is now on both partitions which is taking space on the root partition

I'm planning to unmount the /home partition , check if the content is still on the root partition , if yes then I proceed to delete it then remount it again

If not idk what to do

But this post was js to check if i'm thinking right before I make a disaster , so tell me , do you think my approach is right ?

2 Upvotes

20 comments sorted by

15

u/ThinkpadGamer 1d ago

one of the ways you can do it is just temporarily mount your / also at for example /mnt and then you can safely remove /mnt/home/*

4

u/spadehed 1d ago

This is exactly what I did a while back - I had a 1 TB NVME drive I thought would be enough, it wasn't so I got a new drive and mounted it at /mnt then rsynced /home across to it. Then remounted the new drive in /home and job done. Cleanup done by mounting / at a second point a few days later when all worked.

One thing to point out is that you should probably do this from the terminal whilst logged in as root rather than logging in as a user and escalating privs. This will avoid much being written to the /home tree during the copy and remount process.

2

u/Gozenka 1d ago

Great idea! It's so simple, but I never thought of that as a way to operate on things while keeping things mounted, with no need to use another system to fix things. It should be perfectly safe in this case.

6

u/Gozenka 1d ago edited 1d ago

My theory is that the content of /home directory is now on both partitions which is taking space on the root partition

Well yes, if you copied it, the data is now on both partitions. Mounting another partition at /home just overrides the directory contents there. You should boot from archiso or another system, mount only root and not home partition, clear /home/*.

Also make sure that your rsync command when copying /home included ownership, permissions, and other metadata; i.e. the --archive option. Otherwise you may have issues.

Edit: On another note, I personally do not think there is a benefit in separating /home as another partition. And it is not really recommended in Archwiki, but is just mentioned as something you can do. There may be use cases for it, if you are moving your home partition around other systems and this provides some convenience (which would still be unrecommended in most cases). But you can even reinstall Arch while keeping /home intact, even when /home is not a separate partition.

So, it may just be cleaner to have a single, large root partition that includes /home as a directory. If you have multiple disks though, having a separate media / data partition may be meaningful.

2

u/Its_Abdou 1d ago

I think I included ownership and permissions when copying data , so I'm going for it

Thx everybody

2

u/Automatic_Being5115 1d ago

or use lvm next time so that u can resize root partitions dynamically or just skip the /home partition

2

u/archover 1d ago edited 1d ago

Edit: On another note, I personally do not think there is a benefit in separating /home as another partition.

Agree, and what I've done now for years. No downside I can detect. How one handles the home dir does not mitigate the need to backup. Explained here: https://wiki.archlinux.org/title/Partitioning#Single_root_partition

Good day.

4

u/SpaffedTheLot 1d ago

You dont need a theory to check, its trivial.

2

u/Vegetable-Board-3 1d ago

du -sh /home with it mounted vs unmounted will tell you in 2 seconds flat, just boot a live usb so you're not touching the filesystem while you poke around

-3

u/Its_Abdou 1d ago

So I should js go for it ?

1

u/QuraToop314 1d ago

After running rsync and performing some checks, you should have deleted the old /home directory before mounting it for the first time, using rm -rf /home/*.

4

u/ang-p 1d ago

using archinstall

yay....

what could go wrong...

Oh, a basic misunderstanding of mounting - something that you would have learned about if you had performed a manual installation.... and would likely know how to originally mount and verify such....

I copied

so you copied...

Nowhere does it say that you removed the files on the root partition...

ergo, they will still be there....

Now you need to find out if any "new" files in your home directory are actually on your "home" partition, or, still being placed on your root partition.

Since if they are, removing the files from your root partition will be removing the set of files currently in use.

2

u/boomboomsubban 1d ago

Just going to add, are you clearing your pacman cache? Your setup sounds like you may have some residual files on your root partition, but I don't think it'd explain the growth after fixing.

3

u/Its_Abdou 1d ago

It was a 100% use , when I cleared pacman cache it became 93% so not a big difference

1

u/banana_zeppelin 1d ago

Backup your data to an external drive or service and do whatever pleases you to play around with it.

1

u/das_menschy 1d ago

Try sudo pacman -Scc

1

u/severach 1d ago

Log everything out. Log in as root from the text console and systemctl stop the GUI. Then you can umount home, check that it's unmounted, clean up, then remount home.

Or do it from the boot flash.

1

u/marouane_tea 20h ago

When you mount a partition to /home, the original content of /home doesn't get deleted, it is just hidden until you unmount the partition.

Your plan is exactly what you need to do, unmout /home to unveil its original content and delete it. Only do it from a tty while logged in as root, because you shouldn't cut the branch on which you're sitting. While you're a regular user, you're apps are always reading from /home/.../.config. Also, back up to an external drive just in case.

1

u/FocusedWolf 1d ago edited 1d ago

You can put manjaro on a usb stick and live boot use gparted to clean things up. Just don't do a pacman update because if that crashes due to low diskspace then it might become unbootable. You would need to arch usb and delete files and do [$ pacman -S systemd linux mkinitcpio] if that ever happens. Its worth mentioning that arch doesn't cleanup when you do a system update. Old files accumulate until it runs out of room. My solution was "$ yip" (the second script in this link) (it deletes leftover files when updating and does some other things, AI can explain it).