[SOLVED] Files present in backup, but missing after restore VM

mansoft

New Member
Jun 9, 2023
3
1
3
Hello

I have a very strange and interesting case. VM with Rocky Linux. After restarting I found that I was missing a lot of files on one of the disks (LVM). The file system is lvm built on two disks (PV).

I checked the backups. All files in the backup copy are present. I can even download them as a zip (over 20 GB). Restoring the machine from the backup always gives the same result. There are no files in the location e.g. /srv. I do not understand what could have happened and above all why I can see the files in the backup copy and I can download them, but after restoring the virtual machine (overwriting or as a new VM) the files from the backup copy are not visible every time.

Have you encountered anything like this?
The problem could have arisen after a power loss or during an interruption of the cyclic backup process. I do not know, I am guessing.
 
Could it be you mount another filesystem onto /srv, effectively overlaying the original content of that directory?
Hello

It was a bullseye. I don't know how I managed to do this, because it didn't happen on other systems and there was an analogous situation.

Interestingly, after restoring the backup, the system had the lvm partition/disk mounted to /srv, which can be seen below... it had to be unmounted and mounted again.
All the files were....

Thank you. You saved me a few hours of work.


Bash:
[root@hub ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   64G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   63G  0 part
  ├─rl-root 253:0    0   41G  0 lvm  /
  ├─rl-swap 253:1    0  2.1G  0 lvm  [SWAP]
  └─rl-home 253:2    0   20G  0 lvm  /home
sdb           8:16   0   64G  0 disk
└─rl-srv    253:3    0 51.2G  0 lvm  /var/srv
sr0          11:0    1 1024M  0 rom
[root@hub ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                732M  8.8M  723M   2% /run
/dev/mapper/rl-root   41G   17G   25G  42% /
/dev/sda1           1014M  372M  643M  37% /boot
/dev/mapper/rl-srv    52G   30G   22G  58% /var/srv
/dev/mapper/rl-home   20G  3.6G   17G  18% /home
tmpfs                356M  4.0K  356M   1% /run/user/0
[root@hub ~]# cat /etc/fstab
#
/dev/mapper/rl-root     /                       xfs     defaults        0 0
UUID=xxxxxxxx-140c-4177-b7da-xxxxxxxxxxx /boot                   xfs     defaults        0 0
/dev/mapper/rl-home     /home                   xfs     defaults        0 0
/dev/mapper/rl-swap     none                    swap    defaults        0 0
/dev/mapper/rl-srv     /var/srv                 xfs     defaults        0 0
[root@hub ~]# mount /dev/mapper/rl-srv /var/srv
mount: /var/srv: /dev/mapper/rl-srv already mounted on /var/srv.
[root@hub ~]# ls -l /srv/
total 0
drwxr-xr-x. 2 root root   6 Jan 26 18:43 x1
drwxr-xr-x. 7 root root  89 Jan 26 18:43 x2
drwxr-xr-x. 6 root root  57 Jan 26 18:43 x3
drwxr-xr-x. 5 root root  44 Jan 26 18:42 x4
drwxr-xr-x. 3 root root  25 Jan 26 18:43 x5
drwxr-xr-x. 2 root root   6 Jan 26 18:42 x6
drwxr-xr-x. 4 root root  33 Jan 26 18:42 x7
drwxr-xr-x. 9 1000 1000 133 Jan 26 18:43 x8
drwxr-xr-x. 3 root root  20 Jan 26 18:42 x8
drwxr-xr-x. 4 1000 1000  32 Jan 26 18:43 x9
drwxr-xr-x. 3 root root  18 Jan 26 18:42 x10
[root@hub ~]# umount /dev/mapper/rl-srv
[root@hub ~]# ls -l /srv/
total 0
drwxr-xr-x. 2 root root   6 Jan 26 18:43 x1
drwxr-xr-x. 7 root root  89 Jan 26 18:43 x2
drwxr-xr-x. 6 root root  57 Jan 26 18:43 x3
drwxr-xr-x. 5 root root  44 Jan 26 18:42 x4
drwxr-xr-x. 3 root root  25 Jan 26 18:43 x5
drwxr-xr-x. 2 root root   6 Jan 26 18:42 x6
drwxr-xr-x. 4 root root  33 Jan 26 18:42 x7
drwxr-xr-x. 9 1000 1000 133 Jan 26 18:43 x8
drwxr-xr-x. 3 root root  20 Jan 26 18:42 x8
drwxr-xr-x. 4 1000 1000  32 Jan 26 18:43 x9
drwxr-xr-x. 3 root root  18 Jan 26 18:42 x10
[root@hub ~]# du -hs /srv
166M    /srv
[root@hub ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   64G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   63G  0 part
  ├─rl-root 253:0    0   41G  0 lvm  /
  ├─rl-swap 253:1    0  2.1G  0 lvm  [SWAP]
  └─rl-home 253:2    0   20G  0 lvm  /home
sdb           8:16   0   64G  0 disk
└─rl-srv    253:3    0 51.2G  0 lvm
sr0          11:0    1 1024M  0 rom
[root@hub ~]# mount /dev/mapper/rl-srv /srv
[root@hub ~]# lsblk
NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sda           8:0    0   64G  0 disk
├─sda1        8:1    0    1G  0 part /boot
└─sda2        8:2    0   63G  0 part
  ├─rl-root 253:0    0   41G  0 lvm  /
  ├─rl-swap 253:1    0  2.1G  0 lvm  [SWAP]
  └─rl-home 253:2    0   20G  0 lvm  /home
sdb           8:16   0   64G  0 disk
└─rl-srv    253:3    0 51.2G  0 lvm  /srv
sr0          11:0    1 1024M  0 rom
[root@hub ~]# du -hs /srv
29G     /srv
[root@hub ~]# ls -l /srv/
total 52
drwxr-xr-x. 2 root root  4096 Nov 23 02:38 my_lost_dirs
drwxr-xr-x. 8 root root   102 May 15  2024 my_lost_dirs
-rw-r--r--. 1 root root 10359 Jan 16 23:19 some_file.x
drwxr-xr-x. 6 root root    80 Nov 18 00:52 my_lost_dirs
drwxr-xr-x. 5 root root    44 Jan  1 02:27 my_lost_dirs
drwxr-xr-x. 3 root root    62 Nov 24 00:54 my_lost_dirs
drwxr-xr-x. 4 root root  4096 Sep 15 12:36 my_lost_dirs
drwxr-xr-x. 4 root root    33 Nov 23 02:24 my_lost_dirs
drwxr-xr-x. 9 1000 1000   162 Nov  6 01:41 my_lost_dirs
-rw-r--r--. 1 root root 22171 Dec 20 23:42 some_file.x
drwxr-xr-x. 9 root root  4096 Jan 12 19:27 my_lost_dirs
drwxr-xr-x. 3 root root    20 May 14  2024 my_lost_dirs
-rw-r--r--. 1 root root  1202 May 14  2024 some_file.x
drwxr-xr-x. 6 1000 1000    69 Mar 18  2024 my_lost_dirs
drwxr-xr-x. 3 root root    20 Nov 12  2023 my_lost_dirs
drwxr-xr-x. 3 root root    18 Jul 24  2023 my_lost_dirs
[root@hub ~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
devtmpfs             4.0M     0  4.0M   0% /dev
tmpfs                1.8G     0  1.8G   0% /dev/shm
tmpfs                732M  8.8M  723M   2% /run
/dev/mapper/rl-root   41G   17G   25G  42% /
/dev/sda1           1014M  372M  643M  37% /boot
/dev/mapper/rl-home   20G  3.6G   17G  18% /home
tmpfs                356M  4.0K  356M   1% /run/user/0
/dev/mapper/rl-srv    52G   30G   22G  58% /srv
[root@hub ~]#
 
Last edited:
  • Like
Reactions: maxim.webster