You are not logged in.

#1 2019-10-12 13:04:08

Arctus
Member
Registered: 2012-07-14
Posts: 90

Unable to copy the entire /var folder

Hi
I'm migrating my installation to a new disk. Upon booting up and attempting to use pacman, I get an error about lacking content of /var/lib/pacman.
A quick inspection shows, that the entire folder, and many others, are missing.
I reattempt to copy the folder, but the same result is produced.
I copy using the following command:

sudo rsync -axX --info=progress2 /var /mnt/var

The content of my original /var/lib:

LANG=C sudo ls -la /var/lib/
total 212
drwxr-xr-x 47 root           root            4096 Oct 12 14:50 .
drwxr-xr-x 14 root           root            4096 Aug 14 19:49 ..
drwxr-xr-x  4 root           root            4096 Mar  6  2016 AccountsService
drwx------  2 root           root           20480 Oct 12 15:00 NetworkManager
drwxr-xr-x  2 root           root            4096 Oct 12 14:32 alsa
drwxr-xr-x  2 root           root            4096 Mar 12  2013 arpd
drwx------  3 root           root            4096 Feb  5  2018 bluetooth
drwxr-xr-x  8 root           root            4096 Nov 13  2017 ceph
drwxr-xr-x  3 colord         colord          4096 Jan  5  2018 colord
drwx------  2 root           root            4096 Dec 22  2014 container
drwxr-xr-x  2 root           root            4096 Jun  7  2012 dbus
drwxr-xr-x  2 root           root            4096 Nov  3  2013 dhclient
drwxr-xr-x  2 root           root            4096 Dec 16  2018 dhcpcd
drwxr-xr-x  3 root           root            4096 Aug 12 19:10 dkms
drwxrwxrwt  2 root           root            4096 Nov 16  2012 ex
drwxr-xr-x  2 geoclue        geoclue         4096 Mar 16  2019 geoclue
drwxr-xr-x  4 root           root            4096 Nov 13  2016 gssproxy
drwxr-xr-x  2 kdm            kdm             4096 Mar  1  2015 kdm
drwxr-xr-x  2 root           root            4096 Jun 24 22:25 krb5kdc
drwxr-xr-x  5 root           root            4096 Aug  6  2018 libvirt
drwxr-xr-x  4 root           root            4096 Jul  3  2016 lirc
drwxr-xr-x  2 root           root            4096 Apr 13  2014 logmein-hamachi
-rw-r--r--  1 root           root             956 Oct 12 12:25 logrotate.status
drwx------  2 root           root            4096 Mar  1  2015 machines
drwx------  2 mediatomb      mediatomb       4096 Sep 21  2014 mediatomb
drwxr-xr-x  2 root           root            4096 Jun 10  2012 misc
drwx------  5 mysql          mysql           4096 Apr  2  2013 mysql
drwxr-xr-x  7 root           root            4096 Aug 12 19:10 nfs
drwxr-xr-x  2 ntp            root            4096 Oct 12 13:25 ntp
drwxr-xr-x  2 root           root            4096 Nov 17  2015 os-prober
drwxr-xr-x  4 root           root            4096 Sep 18 20:22 pacman
drwx------  2 root           root            4096 Aug  6  2018 portables
drwx------  3 root           root            4096 Jan  5  2018 private
drwxr-xr-x  2 root           root            4096 Feb  4  2013 rarian
drwx------  2 rpc            rpc             4096 Nov 13  2016 rpcbind
drwxr-xr-x  4 root           root            4096 Mar 23  2018 samba
drwxr-xr-x 15 sddm           sddm            4096 Feb  8  2017 sddm
drwxr-xr-x  2 root           root            4096 Oct 22  2012 syslog-ng
drwxr-xr-x  9 root           root            4096 May 19 21:53 systemd
drwxr-xr-x  5 root           root            4096 Jun 11  2016 texmf
drwx------  2 tor            tor             4096 Dec 20  2013 tor
drwxr-x---  2 tox-bootstrapd tox-bootstrapd  4096 Mar 27  2016 tox-bootstrapd
drwx------  2 root           root            4096 Oct 12 14:50 udisks
drwx------  2 root           root            4096 Jan  7  2013 udisks2
drwxr-xr-x  2 root           root            4096 Jan 16  2019 uniconf
drwxr-xr-x  2 root           root            4096 Mar 18  2013 upower
drwxr-xr-x  2 root           root            4096 Feb  3  2014 usb_modeswitch
drwxr-xr-x  2 root           root            4096 Jul 15 10:57 xkb

The content of my new /var/lib after attempting to copy:

LANG=C sudo ls -la var/lib/
total 64
drwxr-xr-x 16 root    root    4096 Oct 12 14:24 .
drwxr-xr-x 11 root    root    4096 Oct 12 14:41 ..
drwx------  2 root    root    4096 Oct 12 14:50 NetworkManager
drwx------  3 root    root    4096 Oct 12 14:23 bluetooth
drwxr-xr-x  3 colord  colord  4096 Oct 12 14:23 colord
drwxr-xr-x  2 root    root    4096 Oct 12 14:23 dbus
drwxr-xr-x  2 geoclue geoclue 4096 Oct 12 14:23 geoclue
drwx------  2 root    root    4096 Oct 12 14:23 machines
drwx------  2 mysql   mysql   4096 Oct 12 14:23 mysql
drwx------  2 root    root    4096 Oct 12 14:23 portables
drwx------  2 root    root    4096 Oct 12 14:23 private
drwx------  2 rpc     rpc     4096 Oct 12 14:23 rpcbind
drwxr-xr-x 14 sddm    sddm    4096 Oct 12 14:38 sddm
drwxr-xr-x  7 root    root    4096 Oct 12 14:23 systemd
drwx------  2 tor     tor     4096 Oct 12 14:23 tor
drwx------  2 root    root    4096 Oct 12 14:24 udisks2

The rest of my copy seems to have been okay, the system boots and works as expected otherwise so far (Of course I'm worried something else is also missing).
Am I missing something obvious here?

Offline

#2 2019-10-12 13:53:35

WSDMatty
Member
Registered: 2019-08-27
Posts: 14

Re: Unable to copy the entire /var folder

Obviously, rsync missed some directories and files. Perhaps it was not set to properly recurse down far enough? I'm not familiar with rsync but based on the differences between origin/var/lib and new/var/lib, rsync did a boo-boo.

Offline

#3 2019-10-12 14:19:51

seth
Member
Registered: 2012-09-03
Posts: 12,690

Re: Unable to copy the entire /var folder

Are (were) the lost directories empty (except for more empty directories, but no actual files)? (rsync has such option but it doesn't seem invoked by your command)

Offline

#4 2019-10-12 14:33:32

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,295

Re: Unable to copy the entire /var folder

Restore a backup

If you wish to restore a backup, use the same rsync command that was executed but with the source and destination reversed.

You did do that ?


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2019-10-12 18:08:59

Arctus
Member
Registered: 2012-07-14
Posts: 90

Re: Unable to copy the entire /var folder

seth wrote:

Are (were) the lost directories empty (except for more empty directories, but no actual files)? (rsync has such option but it doesn't seem invoked by your command)

No, at least /var/lib/pacman isn't. 71 MiB.

Lone_Wolf wrote:

Restore a backup

If you wish to restore a backup, use the same rsync command that was executed but with the source and destination reversed.

You did do that ?

No the destination of the initial command is the disk I then boot into.

Offline

#6 2019-10-12 21:21:14

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,295

Re: Unable to copy the entire /var folder

I had to doublecheck the rsync manpage, but think I found the cause.
rsync handles source & destination different then most commands, read Usage section of rsync manpage for details.

From your new system post output of ls -l /var/var/lib .


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#7 2019-10-15 18:02:51

Arctus
Member
Registered: 2012-07-14
Posts: 90

Re: Unable to copy the entire /var folder

Lone_Wolf wrote:

I had to doublecheck the rsync manpage, but think I found the cause.
rsync handles source & destination different then most commands, read Usage section of rsync manpage for details.

From your new system post output of ls -l /var/var/lib .

Yeah I think this is part of my issue. It seems the first time the command is executed, /var is created. Any subsequent commands are going to /var/var.

Further investigation shows, that the first command does correctly copy the entire folder, but something during the boot sequence deletes the missing folders. Unfortunately I haven't had much time to investigate further.

Offline

Board footer

Powered by FluxBB