I had an issue where I needed to reinstall IPfire after the boot volume got corrupted. I did an rsync to put everything from the old /var/ipfire branch into the new, but things aren’t working properly and it appears the folder/file ownership and permissions are screwed up.
Can someone give me a reference on what should be what?
That is not so easy to do as there are so many folders and files in that directory tree.
Why did you do an rsync rather than a restore from the backup? The restore also makes sure that only those files that should be recovered are put back.
The top level /var/ipfire looks like
ls -hal /var/ipfire/
total 428K
drwxr-xr-x 50 root root 4.0K Jun 9 22:37 .
drwxr-xr-x 16 root root 4.0K Jun 9 22:37 …
drwxr-xr-x 3 root root 4.0K Jul 7 17:01 accounting
drwxr-xr-x 2 root root 4.0K Jun 9 22:36 addon-lang
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 auth
drwxr-xr-x 4 root root 4.0K Jul 1 21:00 backup
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 ca
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 captive
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 certs
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 connscheduler
-rw-r–r-- 1 root root 5.3K Jun 9 20:31 countries.pl
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 crls
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 ddns
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 dhcp
drwxr-xr-x 3 root nobody 4.0K Jun 27 10:57 dhcpc
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 dma
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 dns
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 dnsforward
drwxr-xr-x 2 nobody nobody 4.0K Jul 3 12:57 ethernet
drwxr-xr-x 3 nobody nobody 4.0K Jun 26 15:23 extrahd
drwxr-xr-x 2 root root 4.0K Jun 26 14:16 fireinfo
drwxr-xr-x 2 nobody nobody 4.0K Jun 29 15:43 firewall
drwxr-xr-x 2 nobody nobody 4.0K Sep 1 2020 fwhosts
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 fwlogs
-rw-r–r-- 1 root root 37K Jun 9 20:31 general-functions.pl
-rw-r–r-- 1 root root 45K Jun 9 20:31 graphs.pl
-rw-r–r-- 1 root root 19K Jun 9 20:31 header.pl
-rw-r–r-- 1 root root 55K Jun 9 20:31 ids-functions.pl
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 ipblocklist
-rw-r–r-- 1 root root 12K Jun 9 20:31 ipblocklist-functions.pl
drwxr-xr-x 2 root root 4.0K Jun 26 15:23 isdn
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 key
-rw-r–r-- 1 root root 5.3K Jun 9 20:31 lang.pl
drwxr-xr-x 2 root root 4.0K Jun 26 14:10 langs
-rw-r–r-- 1 root root 7.6K Jun 9 20:31 location-functions.pl
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 logging
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 mac
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 main
drwxr-xr-x 2 root root 4.0K Jun 9 22:36 menu.d
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 modem
-rw-r–r-- 1 root root 5.9K Jun 9 20:31 modem-lib.pl
-rw-r–r-- 1 root root 18K Jun 9 20:31 network-functions.pl
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 optionsfw
drwxr-xr-x 9 nobody nobody 4.0K Jun 26 15:23 ovpn
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 pakfire
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 ppp
drwxr-xr-x 2 nobody nobody 4.0K Jun 9 20:31 private
drwxr-xr-x 4 nobody nobody 4.0K Jul 4 10:51 proxy
drwxr-xr-x 3 nobody nobody 4.0K Jun 26 15:23 qos
drwxr-xr-x 2 nobody nobody 4.0K Jun 27 10:57 red
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 remote
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 sensors
drwxr-xr-x 2 nobody nobody 4.0K May 22 23:03 suricata
drwxr-xr-x 2 nobody nobody 4.0K Mar 24 2021 time
drwxr-xr-x 4 nobody nobody 4.0K Jun 26 15:23 updatexlrator
drwxr-xr-x 5 nobody nobody 4.0K Sep 15 2022 urlfilter
drwxr-xr-x 2 nobody nobody 4.0K Feb 2 2017 vpn
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 wakeonlan
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:45 wio
drwxr-xr-x 2 nobody nobody 4.0K Jun 26 15:23 wireless
but of course you then also need each of those directories listed to show the files/directories within them and then the contents of those directories.
Because there wasn’t a backup to download. IPfire was stuck in a boot loop, so I had to mount it on another Linux device and transfer the files and folders over. I tried rsync -azP but now I’m having issue with the DHCP server not reading/writing the files. Everything is the latest updated version, but I get:
depmod: ERROR: could not open directory /lib/modules/6.1.11-ipfire: No such file or directory
Which the only folder in there is 6.1.30-ipfire.so headache continues.
When you did your rsync, did you just copy across the /var/ipfire/ directory tree or did you also copy across files and directories in other parts of IPFire.
It’s too late now but you could also have copied out the backup files from /var/ipfire/backup/.
Which Core Update version did you install when your boot partition got corrupted?
Kernel 6.1.11 was used on Core Update 173 and 174. In Core Update 175 it was updated to 6.1.30
I am suspecting that you installed CU175 but your previous version was CU173 or 174 and your rsync copied some files across that shouldn’t have been, that are expecting an earlier kernel.
If that is the case then you need to do another fresh install and then review the directories and files that you have in your rsync tree to decide what you should copy across.
It would be great to create a .sh that when executed, would put all the default folder and file permissions and owner/group.
I sometimes do a clean install and hand copy files and folders. Then I have to connect to another IPFire to see what permissions it has and set them correctly.
I think that isn’t quite easy.
The script can be effective only, if two propositions are true
all relevant files are contained
each modification to IPFire code must update the script and/or it’s definitions
I think, this is a great effort for temporarily issues.
On the other hand, if someone does this job ( creation and maintenance of the script ), the developers will not inhibit that.
I performed a backup of the running installation. Downloaded the backup archives and the ‘Generate ISO’. I didn’t really need the backup archive after that. I wiped the drive and used the ISO to restore IPfire. I just had to make sure all my networking parameters were defined. I had to define Red, Green and DHCP. (RED+GREEN config). After that, everything worked as desired.