Attempted something stupid after a couple of beers

So there I was looking at filelight and noticing that my var folder seems to be quite big and is only going to get bigger because of the video folders I’m about to scan with Jellyfin. I came up with the bright idea of moving var to another partition after a couple of beers.

After moving var and editing fstab to the new location I noticed that Jellyfin would not start up properly or mariaDB and various other things I have running. I thought it could be a permission and ownership thing, so I changed the owner of var to root and the permissions to 755. It’s kind of made a bit of progress but still not working properly.

I was thinking of just reinstalling, but there are so many apps installed and services setup that I am really reluctant to do that.

Is there a way I can repair this using chroot without reinstalling? I also deleted the backup of var, because I prematurely thought everything was fine when the desktop loaded.

Is there anyone out there that can help with drunken disaster recovery or maybe this is just a lesson learned?

you can repair the permissions with:

1 Like

Some light reading, for future reference… :arrow_down:

:wink:

I tried moving var many moons ago because of space, it wasnt the best idea I have had and I dont have beer to blame. If I remember right, here is what I did to fix it. I mounted the partition var is on and created a symlink of var’s new location to /var and removed the fstab entry.
In the end I think I started over on a new partition , leaving the old one in its place, and then copied over what I needed.

Warning: Do not symlink the /var/cache/pacman/pkg/ directory to some other location. It will cause pacman to misbehave, especially when pacman attempts to update itself.

https://wiki.archlinux.org/title/pacman#Package_cache_directory

In that case its likely best to move var back to its original location as root.

Looks like I’ve got it fixed for the most part using pacman-fix-permissions. Thanks for the heads up on that.

It had to run for ages and check 2237 installs and reinstall a load of stuff, but all works well. I just needed to change the ownership on mariaDB and jellyfin in /var/lib and /var/cache so these servers would come back up. There maybe some more ownership issues in there, but so far so good.

All running on the new var partition. Thanks for the help. You have all saved me a lot of work.

I would call this solved.

Just one final piece of advice. Backup your system with timeshift before trying something like this in the future. If it all goes belly up you can easily revert it.

1 Like

Just an update

The system is running with the new var partition, but there are still a few things to sort out. I found that changing the ownership of some of the folders and files in mysql in lib using chown -R mysql:mysql /var/lib/mysql got mariaDB working again. I had to do the same with Jellyfin in both the /var/lib and the /var/cache folders to get it working again.

Special permissions on /var/tmp

To get pacman to flush it’s package cache I had to change the permission on /var/tmp using chmod 1777 /var/tmp and then rm -rf everything from within that directory as root to get it to behave correctly. The problem I’m getting now is with pamac-gtk just not being able to clone anything form the AUR. I’ve totally uninstalled it. I’m using paru to install from the AUR now. I can’t figure out why pamac is not working. I’ve uninstalled and reinstalled, but no joy.

Most of the software I’ve tried works as expected, but I’ve yet to go through the rest.

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