mounting backup makes mount point 'disapear'... #490

Closed
opened 2022-01-20 14:49:43 +00:00 by pseud · 12 comments

What I'm trying to do and why

Mount back up to browse

Steps to reproduce (if a bug)

[admin@frontserver ~]$ ls -lh /mnt
total 8.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
drwxr-xr-x. 2 root root 4.0K Feb 20  2020 tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$ sudo borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1
[admin@frontserver ~]$ ls -lh /mnt
ls: cannot access '/mnt/tmp1': Permission denied
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
d?????????? ? ?    ?       ?            ? tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$ sudo borgmatic umount --mount-point /mnt/tmp1
[admin@frontserver ~]$ ls -lh /mnt
total 8.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
drwxr-xr-x. 2 root root 4.0K Feb 20  2020 tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$ sudo borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1/
[admin@frontserver ~]$ ls -lh /mnt
ls: cannot access '/mnt/tmp1': Permission denied
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
d?????????? ? ?    ?       ?            ? tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$

Actual behavior (if a bug)

See above, mount point 'disapears' - or at least can not be accessed on mounting

Expected behavior (if a bug)

Mount of archive is accessable

Other notes / implementation ideas

The archive is on xfs and the mount on ext4:

[admin@frontserver ~]$ df -Th | grep "^/dev"
/dev/mapper/cl_frontserver-root      ext4       22G  7.9G   13G  39% /
/dev/dm-4                            xfs       699G  284G  415G  41% /mnt/RAID1-699GiB
/dev/mapper/cl_frontserver-usr_local ext4      976M   79M  831M   9% /usr/local
/dev/sdc1                            ext4      477M  383M   66M  86% /boot
/dev/mapper/cl_frontserver-var       xfs        50G   25G   25G  50% /var

Environment

borgmatic version: 1.5.21

Used sudo borgmatic --version

borgmatic installation method:

sudo dnf install borgmatic
From here:
https://copr.fedorainfracloud.org/coprs/heffer/borgmatic/repo/epel-8/heffer-borgmatic-epel-8.repo

Borg version: borg 1.1.17

Used sudo borg --version

Python version: Python 3.6.8

Used python3 --version

Database version (if applicable): n/a

Use psql --version or mysql --version on client and server.

operating system and version: Linux frontserver.lan 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Tue Dec 21 19:02:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

#### What I'm trying to do and why Mount back up to browse #### Steps to reproduce (if a bug) ``` [admin@frontserver ~]$ ls -lh /mnt total 8.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB drwxr-xr-x. 2 root root 4.0K Feb 20 2020 tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ sudo borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1 [admin@frontserver ~]$ ls -lh /mnt ls: cannot access '/mnt/tmp1': Permission denied total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB d?????????? ? ? ? ? ? tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ sudo borgmatic umount --mount-point /mnt/tmp1 [admin@frontserver ~]$ ls -lh /mnt total 8.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB drwxr-xr-x. 2 root root 4.0K Feb 20 2020 tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ sudo borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1/ [admin@frontserver ~]$ ls -lh /mnt ls: cannot access '/mnt/tmp1': Permission denied total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB d?????????? ? ? ? ? ? tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ ``` #### Actual behavior (if a bug) See above, mount point 'disapears' - or at least can not be accessed on mounting #### Expected behavior (if a bug) Mount of archive is accessable #### Other notes / implementation ideas The archive is on xfs and the mount on ext4: ``` [admin@frontserver ~]$ df -Th | grep "^/dev" /dev/mapper/cl_frontserver-root ext4 22G 7.9G 13G 39% / /dev/dm-4 xfs 699G 284G 415G 41% /mnt/RAID1-699GiB /dev/mapper/cl_frontserver-usr_local ext4 976M 79M 831M 9% /usr/local /dev/sdc1 ext4 477M 383M 66M 86% /boot /dev/mapper/cl_frontserver-var xfs 50G 25G 25G 50% /var ``` #### Environment **borgmatic version:** 1.5.21 Used `sudo borgmatic --version` **borgmatic installation method:** `sudo dnf install borgmatic` From here: https://copr.fedorainfracloud.org/coprs/heffer/borgmatic/repo/epel-8/heffer-borgmatic-epel-8.repo **Borg version:** borg 1.1.17 Used `sudo borg --version` **Python version:** Python 3.6.8 Used `python3 --version` **Database version (if applicable):** n/a Use `psql --version` or `mysql --version` on client and server. **operating system and version:** Linux frontserver.lan 4.18.0-348.7.1.el8_5.x86_64 #1 SMP Tue Dec 21 19:02:23 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Author

This works:

[admin@frontserver /]$ sudo borgmatic extract -l --archive frontserver-20220120T030225 --path home/admin/nextcloud.d
/mnt/RAID1-699GiB/backup/borg/frontserver: Listing archives
drwxrwxr-x admin  admin         0 Wed, 2022-01-19 19:53:11 home/admin/nextcloud.d
-rw-rw-r-- admin  admin       393 Wed, 2022-01-19 19:53:11 home/admin/nextcloud.d/CommandReference
drwxrwxr-x admin  admin         0 Thu, 2021-11-25 23:19:50 home/admin/nextcloud.d/ExperimentHistory
-rw-r--r-- admin  root        864 Mon, 2021-08-09 05:10:45 home/admin/nextcloud.d/ExperimentHistory/pod-nextcloud.service
-rw-r--r-- root   root        767 Wed, 2021-11-24 01:07:34 home/admin/nextcloud.d/ExperimentHistory/container-fd15abdf1dfd-infra.service.bak1
-rw-r--r-- root   root       1169 Wed, 2021-11-24 01:12:08 home/admin/nextcloud.d/ExperimentHistory/container-nextcloud_app_1.service
-rw-r--r-- root   root       1327 Wed, 2021-11-24 01:12:36 home/admin/nextcloud.d/ExperimentHistory/container-nextcloud_db_1.service
-rw-r--r-- root   root        767 Wed, 2021-11-24 01:13:03 home/admin/nextcloud.d/ExperimentHistory/container-fd15abdf1dfd-infra.service.bak2
drwxrwxr-x admin  admin         0 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services
-rw-r--r-- admin  root        809 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/container-nextcloud_db_1.service
-rw-r--r-- admin  root        814 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/container-nextcloud_app_1.service
-rw-r--r-- admin  admin       864 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/pod-nextcloud.service
drwxrwxr-x admin  admin         0 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/20201015_InitialSetup
-rw-r--r-- admin  admin       501 Thu, 2020-10-15 01:37:17 home/admin/nextcloud.d/20201015_InitialSetup/docker-compose.yml
-rw------- admin  admin       154 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/20201015_InitialSetup/secrets.txt
drwxrwxr-x admin  admin         0 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud
-rw-r--r-- admin  admin       501 Sat, 2021-12-04 18:28:17 home/admin/nextcloud.d/20211204_nextcloud/docker-compose.yml
-rw------- admin  admin       154 Sat, 2021-12-04 18:28:42 home/admin/nextcloud.d/20211204_nextcloud/secrets.txt
-rw-r--r-- root   root        860 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/pod-nextcloud.service
-rw-r--r-- root   root        810 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/container-nextcloud_app_1.service
-rw-r--r-- root   root        805 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/container-nextcloud_db_1.service
drwxrwxr-x admin  admin         0 Tue, 2022-01-18 00:45:26 home/admin/nextcloud.d/20211126_nextcloud
-rw-rw-r-- admin  admin     60872 Fri, 2021-11-26 20:14:42 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_app_1.service.log
-rw-r--r-- admin  admin      1969 Fri, 2021-11-26 23:24:41 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_db_1.service
-rw-r--r-- admin  admin      1072 Fri, 2021-11-26 01:09:17 home/admin/nextcloud.d/20211126_nextcloud/pod-nextcloud.service
-rw-rw-r-- admin  admin     60421 Fri, 2021-11-26 20:14:46 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_db_1.service.log
-rw-rw-r-- admin  admin     48298 Fri, 2021-11-26 20:14:50 home/admin/nextcloud.d/20211126_nextcloud/pod-nextcloud.service.log
-rw-r--r-- admin  admin      1971 Fri, 2021-11-26 23:23:44 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_app_1.service
drwxrwxr-x admin  admin         0 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud
-rw------- admin  admin       154 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/nextcloud/secrets.txt
-rw-rw-r-- admin  admin       702 Wed, 2022-01-19 18:56:07 home/admin/nextcloud.d/nextcloud/docker-compose.yml
-rw-r--r-- root   root       1412 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/container-nextcloud_db_1.service
-rw-r--r-- root   root       1355 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/container-nextcloud_app_1.service
-rw-r--r-- root   root       1072 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/pod-nextcloud.service
[admin@frontserver /]$
This works: ``` [admin@frontserver /]$ sudo borgmatic extract -l --archive frontserver-20220120T030225 --path home/admin/nextcloud.d /mnt/RAID1-699GiB/backup/borg/frontserver: Listing archives drwxrwxr-x admin admin 0 Wed, 2022-01-19 19:53:11 home/admin/nextcloud.d -rw-rw-r-- admin admin 393 Wed, 2022-01-19 19:53:11 home/admin/nextcloud.d/CommandReference drwxrwxr-x admin admin 0 Thu, 2021-11-25 23:19:50 home/admin/nextcloud.d/ExperimentHistory -rw-r--r-- admin root 864 Mon, 2021-08-09 05:10:45 home/admin/nextcloud.d/ExperimentHistory/pod-nextcloud.service -rw-r--r-- root root 767 Wed, 2021-11-24 01:07:34 home/admin/nextcloud.d/ExperimentHistory/container-fd15abdf1dfd-infra.service.bak1 -rw-r--r-- root root 1169 Wed, 2021-11-24 01:12:08 home/admin/nextcloud.d/ExperimentHistory/container-nextcloud_app_1.service -rw-r--r-- root root 1327 Wed, 2021-11-24 01:12:36 home/admin/nextcloud.d/ExperimentHistory/container-nextcloud_db_1.service -rw-r--r-- root root 767 Wed, 2021-11-24 01:13:03 home/admin/nextcloud.d/ExperimentHistory/container-fd15abdf1dfd-infra.service.bak2 drwxrwxr-x admin admin 0 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services -rw-r--r-- admin root 809 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/container-nextcloud_db_1.service -rw-r--r-- admin root 814 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/container-nextcloud_app_1.service -rw-r--r-- admin admin 864 Fri, 2021-11-26 00:10:33 home/admin/nextcloud.d/20210809_first-services/pod-nextcloud.service drwxrwxr-x admin admin 0 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/20201015_InitialSetup -rw-r--r-- admin admin 501 Thu, 2020-10-15 01:37:17 home/admin/nextcloud.d/20201015_InitialSetup/docker-compose.yml -rw------- admin admin 154 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/20201015_InitialSetup/secrets.txt drwxrwxr-x admin admin 0 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud -rw-r--r-- admin admin 501 Sat, 2021-12-04 18:28:17 home/admin/nextcloud.d/20211204_nextcloud/docker-compose.yml -rw------- admin admin 154 Sat, 2021-12-04 18:28:42 home/admin/nextcloud.d/20211204_nextcloud/secrets.txt -rw-r--r-- root root 860 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/pod-nextcloud.service -rw-r--r-- root root 810 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/container-nextcloud_app_1.service -rw-r--r-- root root 805 Sat, 2021-12-04 20:41:10 home/admin/nextcloud.d/20211204_nextcloud/container-nextcloud_db_1.service drwxrwxr-x admin admin 0 Tue, 2022-01-18 00:45:26 home/admin/nextcloud.d/20211126_nextcloud -rw-rw-r-- admin admin 60872 Fri, 2021-11-26 20:14:42 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_app_1.service.log -rw-r--r-- admin admin 1969 Fri, 2021-11-26 23:24:41 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_db_1.service -rw-r--r-- admin admin 1072 Fri, 2021-11-26 01:09:17 home/admin/nextcloud.d/20211126_nextcloud/pod-nextcloud.service -rw-rw-r-- admin admin 60421 Fri, 2021-11-26 20:14:46 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_db_1.service.log -rw-rw-r-- admin admin 48298 Fri, 2021-11-26 20:14:50 home/admin/nextcloud.d/20211126_nextcloud/pod-nextcloud.service.log -rw-r--r-- admin admin 1971 Fri, 2021-11-26 23:23:44 home/admin/nextcloud.d/20211126_nextcloud/container-nextcloud_app_1.service drwxrwxr-x admin admin 0 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud -rw------- admin admin 154 Thu, 2021-11-25 21:39:12 home/admin/nextcloud.d/nextcloud/secrets.txt -rw-rw-r-- admin admin 702 Wed, 2022-01-19 18:56:07 home/admin/nextcloud.d/nextcloud/docker-compose.yml -rw-r--r-- root root 1412 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/container-nextcloud_db_1.service -rw-r--r-- root root 1355 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/container-nextcloud_app_1.service -rw-r--r-- root root 1072 Wed, 2022-01-19 22:01:50 home/admin/nextcloud.d/nextcloud/pod-nextcloud.service [admin@frontserver /]$ ```
Owner

I believe this is just how mounting in Linux works—you're mounting with sudo in this case, which means the path is mounted with root's permissions.. And that includes the mount point itself, which effectively gets "masked" by whatever's mounted there until it's subsequently unmounted.

So, options for dealing with this:

  • Mount as root and browse as root.
  • When mounting as root, pass additional mount options via borgmatic mount --options that allow non-root users to browse. One option I can think of trying would be --options uid=value. Check out the documentation for mount though for more options.
  • It may be possible to mount as a non-root user, but that could require setting up a mount point ahead of time (e.g. via /etc/fstab) with appropriate options.
I believe this is just how mounting in Linux works—you're mounting with sudo in this case, which means the path is mounted with root's permissions.. And that includes the mount point itself, which effectively gets "masked" by whatever's mounted there until it's subsequently unmounted. So, options for dealing with this: * Mount as root and browse as root. * When mounting as root, pass additional mount options via `borgmatic mount --options` that allow non-root users to browse. One option I can think of trying would be `--options uid=value`. Check out the documentation for `mount` though for more options. * It may be possible to mount as a non-root user, but that could require setting up a mount point ahead of time (e.g. via `/etc/fstab`) with appropriate options.
witten added the
question / support
label 2022-01-20 18:15:04 +00:00
Author

Thanks @witten, but I'm not sure about that - both /mnt/RAID1-699GiB and /mnt/tmp2 are owned by root but readable.

[root@frontserver ~]# umask
0022

Gives default directory permissions of 755, or o=rwx g=r-x a=r-x - which is as for /mnt/RAID1-699GiB and /mnt/tmp2.
But, I'm not sure I've added much there other than pointing out that x=x & y=y...
Anyway, here it is as root:

[root@frontserver ~]# borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1
/mnt/RAID1-699GiB/backup/borg/frontserver: Error running actions for repository
Command 'borg mount /mnt/RAID1-699GiB/backup/borg/frontserver::frontserver-20220120T030225 /mnt/tmp1' returned non-zero exit status 2.
/etc/borgmatic/config.yaml: Error running configuration file

summary:
/etc/borgmatic/config.yaml: Error running configuration file
/mnt/RAID1-699GiB/backup/borg/frontserver: Error running actions for repository
/mnt/tmp1: Mountpoint must be a writable directory
Command 'borg mount /mnt/RAID1-699GiB/backup/borg/frontserver::frontserver-20220120T030225 /mnt/tmp1' returned non-zero exit status 2.

Need some help? https://torsion.org/borgmatic/#issues
[root@frontserver ~]# ls -lh /mnt
ls: cannot access '/mnt/tmp1': Transport endpoint is not connected
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
d?????????? ? ?    ?       ?            ? tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[root@frontserver ~]#
Thanks @witten, but I'm not sure about that - both `/mnt/RAID1-699GiB` and `/mnt/tmp2` are owned by root but readable. ``` [root@frontserver ~]# umask 0022 ``` Gives default directory permissions of 755, or o=rwx g=r-x a=r-x - which is as for `/mnt/RAID1-699GiB` and `/mnt/tmp2`. But, I'm not sure I've added much there other than pointing out that x=x & y=y... Anyway, here it is as root: ``` [root@frontserver ~]# borgmatic mount --archive frontserver-20220120T030225 --mount-point /mnt/tmp1 /mnt/RAID1-699GiB/backup/borg/frontserver: Error running actions for repository Command 'borg mount /mnt/RAID1-699GiB/backup/borg/frontserver::frontserver-20220120T030225 /mnt/tmp1' returned non-zero exit status 2. /etc/borgmatic/config.yaml: Error running configuration file summary: /etc/borgmatic/config.yaml: Error running configuration file /mnt/RAID1-699GiB/backup/borg/frontserver: Error running actions for repository /mnt/tmp1: Mountpoint must be a writable directory Command 'borg mount /mnt/RAID1-699GiB/backup/borg/frontserver::frontserver-20220120T030225 /mnt/tmp1' returned non-zero exit status 2. Need some help? https://torsion.org/borgmatic/#issues [root@frontserver ~]# ls -lh /mnt ls: cannot access '/mnt/tmp1': Transport endpoint is not connected total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB d?????????? ? ? ? ? ? tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [root@frontserver ~]# ```
Owner

Yeah, my understanding is that the permission of a mount point prior to mounting does not impact the permissions of the filesystem once mounted. Those permissions are taken from those in the mounted filesystem, in this case the Borg archive. I think one of the options listed above is probably your best bet. I'd first try accessing the mounted path as the root user and make sure at least that works.

Yeah, my understanding is that the permission of a mount point prior to mounting does not impact the permissions of the filesystem once mounted. [Those permissions are taken from those in the mounted filesystem](https://unix.stackexchange.com/questions/181260/ownership-of-a-mount-point), in this case the Borg archive. I think one of the options listed [above](https://projects.torsion.org/borgmatic-collective/borgmatic/issues/490#issuecomment-3965) is probably your best bet. I'd first try accessing the mounted path as the root user and make sure at least *that* works.
Owner

Oh, I just saw that /mnt/tmp1: Mountpoint must be a writable directory! Not sure what's going on there if you're getting that as root. My guess would be that tmp1 is already somehow mounted? Have you tried unmounting it? umount /mnt/tmp1 as root.

Oh, I just saw that `/mnt/tmp1: Mountpoint must be a writable directory`! Not sure what's going on there if you're getting that as root. My guess would be that `tmp1` is already somehow mounted? Have you tried unmounting it? `umount /mnt/tmp1` as root.

Having a similar problem on Fedora (which it appears you're also running). Not sure if I should post here or start a new issue. Seems more like the the file manager (Nautilus) is at fault here. Wondering if and how you ever got it resolved?

When mounting a backup with sudo borgmatic mount --archive latest --mount-point /mnt/borgbackuplatest the directory/folder (/mnt/borgbackuplatest) would no longer be browsable using the default file manager in Fedora. Instead I would get the popup error message "This location could not be displayed" with the underlying message being "you do not have the permissions necessary to view the contents of "borgbackuplatest". When unmounted the mount directory would be browsable but predictably empty.

Running Nautilus (default file manager on Fedora) with root privileges from the terminal (sudo nautilus) allows me to see the contents of my mounted backup but how come I cannot open the mounted directory as root from my default instance of Nautilus. In other words without openining up a privileged instance of the file manager. I can open other root protected directories as root from the default instance of the file manager such as the root folder and lost&found. With those folders navigating to them through the file manager a popup prompt would ask me for my password and allow me in.

Update: Not sure if I'm allowed to provide links here but this seems more like a issue (good security practice by design) related to the Nautilus file manager, issue report & discussion here.

https://gitlab.gnome.org/GNOME/nautilus/-/issues/1282

Having a similar problem on Fedora (which it appears you're also running). Not sure if I should post here or start a new issue. Seems more like the the file manager (Nautilus) is at fault here. Wondering if and how you ever got it resolved? When mounting a backup with sudo borgmatic mount --archive latest --mount-point /mnt/borgbackuplatest the directory/folder (/mnt/borgbackuplatest) would no longer be browsable using the default file manager in Fedora. Instead I would get the popup error message "This location could not be displayed" with the underlying message being "you do not have the permissions necessary to view the contents of "borgbackuplatest". When unmounted the mount directory would be browsable but predictably empty. Running Nautilus (default file manager on Fedora) with root privileges from the terminal (sudo nautilus) allows me to see the contents of my mounted backup but how come I cannot open the mounted directory as root from my default instance of Nautilus. In other words without openining up a privileged instance of the file manager. I can open other root protected directories as root from the default instance of the file manager such as the root folder and lost&found. With those folders navigating to them through the file manager a popup prompt would ask me for my password and allow me in. Update: Not sure if I'm allowed to provide links here but this seems more like a issue (good security practice by design) related to the Nautilus file manager, issue report & discussion here. https://gitlab.gnome.org/GNOME/nautilus/-/issues/1282
Author

Having a similar problem on Fedora (which it appears you're also running)

Actually, Rocky

Seems more like the the file manager (Nautilus) is at fault here. Wondering if and how you ever got it resolved?

Not solved; I do not think this bug is related to Nautilus - I'm not using Nautilus with borgmatic.

I'm running borgmatic on a small headless home server.

Slightly OT this thread, but the link you've given to Nautilus issue can be solved by the installation of the nautilus-admin extension:
https://www.how2shout.com/linux/open-ubuntu-file-manager-as-root-user/
But, the project seems dead:
https://github.com/brunonova/nautilus-admin
Also, the instructions to use the admin:/// uri works.

If you're using borg with gnome I strongley suggest installing Pika Backup:
https://gitlab.gnome.org/World/pika-backup
It's a young project but moving very fast. Very slick, simple and straight forward user backup gui to borg. It's very soon to release v0.4 which will intruduce scheduled b/u. Until then, I've just had it set as a start up app so whenever I log in I get prompted to do a backup.

I think you would do better starting a new bug, because this has veered rather OT.

> Having a similar problem on Fedora (which it appears you're also running) Actually, Rocky > Seems more like the the file manager (Nautilus) is at fault here. Wondering if and how you ever got it resolved? Not solved; I do not think this bug is related to Nautilus - I'm not using Nautilus with borgmatic. I'm running borgmatic on a small headless home server. Slightly OT this thread, but the link you've given to Nautilus issue can be solved by the installation of the nautilus-admin extension: https://www.how2shout.com/linux/open-ubuntu-file-manager-as-root-user/ But, the project seems dead: https://github.com/brunonova/nautilus-admin Also, the instructions to use the `admin:///` uri works. If you're using borg with gnome I strongley suggest installing Pika Backup: https://gitlab.gnome.org/World/pika-backup It's a young project but moving very fast. Very slick, simple and straight forward user backup gui to borg. It's very soon to release v0.4 which will intruduce scheduled b/u. Until then, I've just had it set as a start up app so whenever I log in I get prompted to do a backup. I think you would do better starting a new bug, because this has veered rather OT.
Owner

So @psued, did it turn that out that tmp1 was somehow already mounted?

So @psued, did it turn that out that `tmp1` was somehow already mounted?
Author

Thanks @witten. No, the only sense in which tmp1 was/is mounted is that it is mounted by the root filesystem on /dev/mapper/cl_frontserver-root at /mnt/tmp1 as per /etc/fstab (other than when this bug is evident as per the OP)

But also:

[admin@frontserver ~]$ sudo borgmatic mount --archive latest --mount-point /mnt/tmp1
[admin@frontserver ~]$ ls -lh /mnt
ls: cannot access '/mnt/tmp1': Permission denied
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
d?????????? ? ?    ?       ?            ? tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$ sudo ls -lh /mnt
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
drwxr-xr-x. 1 root root    0 Jan 30 09:29 tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[admin@frontserver ~]$ su -
Password: 
[root@frontserver ~]# ls -lh /mnt
total 4.0K
drwxr-xr-x. 6 root root   71 Oct 31 23:03 RAID1-699GiB
drwxr-xr-x. 1 root root    0 Jan 30 09:29 tmp1
drwxr-xr-x. 2 root root 4.0K Feb 16  2020 tmp2
[root@frontserver ~]# cd /mnt/tmp1
[root@frontserver tmp1]# ls
etc  home  opt  root  srv  usr  var
[root@frontserver tmp1]#

So, it's just not being root when attempting to browse - which you mentioned and is a bit bleeding obvious... but, I guess got lost in the noise. Sorry about that. Closing.

Thanks @witten. No, the only sense in which `tmp1` was/is mounted is that it is mounted by the root filesystem on `/dev/mapper/cl_frontserver-root` at `/mnt/tmp1` as per `/etc/fstab` (other than when this bug is evident as per the OP) But also: ``` [admin@frontserver ~]$ sudo borgmatic mount --archive latest --mount-point /mnt/tmp1 [admin@frontserver ~]$ ls -lh /mnt ls: cannot access '/mnt/tmp1': Permission denied total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB d?????????? ? ? ? ? ? tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ sudo ls -lh /mnt total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB drwxr-xr-x. 1 root root 0 Jan 30 09:29 tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [admin@frontserver ~]$ su - Password: [root@frontserver ~]# ls -lh /mnt total 4.0K drwxr-xr-x. 6 root root 71 Oct 31 23:03 RAID1-699GiB drwxr-xr-x. 1 root root 0 Jan 30 09:29 tmp1 drwxr-xr-x. 2 root root 4.0K Feb 16 2020 tmp2 [root@frontserver ~]# cd /mnt/tmp1 [root@frontserver tmp1]# ls etc home opt root srv usr var [root@frontserver tmp1]# ``` So, it's just not being root when attempting to browse - which you mentioned and is a bit bleeding obvious... but, I guess got lost in the noise. Sorry about that. Closing.
pseud closed this issue 2022-01-30 09:36:23 +00:00
Author

But, still - isn't a bit weird that /mnt/tmp1 has the same permissions as the other directories in /mnt - of which /mnt/RAID1-699GiB permanently (ie, via /etc/fstab on boot) has an external file system mounted on it and /mnt/tmp2 has never (for our purposes) has another file system mounted on it, and they can be read and traversed?

Ah, I think it's begining to dawn on me what you've been saying - borg creates and mounts the backed-up directory at some point in time as a directory with the user permissions of the user creating the backup files - borg doesn't mount an existing directory (with its permissions) as such, but creates a directory from the backup files and gives that directory the permissions of the user making that backup.

But, still - isn't a bit weird that `/mnt/tmp1` has the same permissions as the other directories in `/mnt` - of which `/mnt/RAID1-699GiB` permanently (ie, via `/etc/fstab` on boot) has an external file system mounted on it and `/mnt/tmp2` has never (for our purposes) has another file system mounted on it, and they can be read and traversed? Ah, I think it's begining to dawn on me what you've been saying - `borg` creates and mounts the backed-up *directory* at some point in time as a *directory* with the user permissions of the user creating the backup *files* - `borg` doesn't `mount` an existing `directory` (with its permissions) as such, but creates a `directory` from the backup `files` and gives that `directory` the permissions of the user making that backup.
Owner

Ah, I think it's begining to dawn on me what you've been saying - borg creates and mounts the backed-up directory at some point in time as a directory with the user permissions of the user creating the backup files - borg doesn't mount an existing directory (with its permissions) as such, but creates a directory from the backup files and gives that directory the permissions of the user making that backup.

That's correct! At least, that's my understanding of how it works.

> Ah, I think it's begining to dawn on me what you've been saying - borg creates and mounts the backed-up directory at some point in time as a directory with the user permissions of the user creating the backup files - borg doesn't mount an existing directory (with its permissions) as such, but creates a directory from the backup files and gives that directory the permissions of the user making that backup. That's correct! At least, that's my understanding of how it works.
Author

Happiness :)

Happiness :)
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#490
No description provided.