You are not logged in.

#1 2015-07-18 11:58:01

pgzh
Member
Registered: 2013-03-20
Posts: 19

Re-creating /var

Hi all,

because I thought I had to save a few bucks and not replace my aging HDD, I now have a bit of a situation with my arch install:
I have a SDD containing the root filesystem, except for /var, which I *had* on my HDD to avoid stressing the SSD. You probably aready figured it out, my HDD went out with a bang. (literally...)

So now I have a Arch Linux installation without any data in /var, how can I re-install the filesystem hierarchy only for /var without messing up the rest of the filesystem (which should be perfectly fine)?
Or do I even need to do anything about it, I already noticed cache, log, lib, run, spool and tmp subdirectories being created automatically in /var.

Any hints on how to proceed would be really appreciated.

Peter

Offline

#2 2015-07-18 14:03:07

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: Re-creating /var

You restore it from your backup...

Shouldn't be any problem reinstalling the filesystem package. The real issue is that you've lost your pacman database.

Offline

#3 2015-07-18 14:13:34

pgzh
Member
Registered: 2013-03-20
Posts: 19

Re: Re-creating /var

Scimmia wrote:

The real issue is that you've lost your pacman database.

Is there any chance/way of re-creating the pacman db without having a backup?
I have backups of my data, but not of the system.

I'm starting to suspect that I've got a problem that cannot be solved without re-installing the whole system...

Offline

#4 2015-07-18 14:32:50

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: Re-creating /var

Yes, but it will require some work. Look into `pacman -S --dbonly`, you can use that to "reinstall" only the package information. I would start by using that on any groups or individual programs you know you have installed; you can then use something like lostfiles in the AUR to see what is not owned by a package so you can reinstall those as well. pkgfile will help figure out what packages the files should belong to. Don't forget to use pacman's --asdeps and --asexplicit options when reinstalling things.

Someone might have a better idea?

Edit: Oh, and after you have the database recreated, you can use `pacman -Qk` to figure out what needs reinstalled to get files back on /var.

Last edited by Scimmia (2015-07-18 14:34:13)

Offline

#5 2015-07-18 14:48:49

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,475
Website

Re: Re-creating /var

There is Xyne's package detection script, which may or may not be of use.

https://bbs.archlinux.org/viewtopic.php?pid=670876


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-07-19 16:52:23

pgzh
Member
Registered: 2013-03-20
Posts: 19

Re: Re-creating /var

Thank you for the useful tips, but sadly I haven't had a lot of success so far.
I still am uncertain why, but many systemd services refuse to start and I wasn't even able to get the xorg-server in a run-able state so far.
I guess it might save me quite some time just re-installing the whole system (and backing up whatever configs I consider worth saving before).
Would you recommend putting /var on the SSD along with the rest of the system or not? I am kind of tempted to do so since it's a cheap SSD and I'll just replace it in three years anyway...
The mess I am in right now maybe just isn't worth trying to prolong the lifespan of a small and relatively cheap SSD...

Offline

#7 2015-07-19 16:55:43

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: Re-creating /var

Have you started following the instructions I gave? If so, did you run into a problem?

Nothing wrong with reinstalling, but you'll learn a lot more by fixing it.

Offline

#8 2015-07-20 07:30:16

pgzh
Member
Registered: 2013-03-20
Posts: 19

Re: Re-creating /var

Well, yes, I've followed your instructions and managed to re-create the pacman db.
But as it turns out, this was only the tip of the iceberg - some systemd services refused to work, including polkit and krb5 which prevented any login manager from starting successfully.
Quite some packages were missing important files from /var and needed to be really re-installed.
I've managed to fix almost all the problems starting with low-level components working my way “up“ to successfully starting a login manager.
Since I've got other things to do, I will have to continue tonight.
Right now I think I'm almost done and with fluxbox back up running I can have multiple terminals and a browser for assistance, so things are likely to become easier now :-)

Thanks for the help so far, I'll keep you guys up to date with my progress.

Offline

#9 2015-07-20 14:43:01

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,725

Re: Re-creating /var

As I said, pacman -Qk can help you identify the packages that need to be reinstalled.

Offline

Board footer

Powered by FluxBB