Can't set path on Pi 4B. #317
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#317
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
I'm trying to set the path for borg, and sadly, all of the different methods I've tried haven't worked. I've tried to reset the path on both ~/.profile and ~/.bashrc and even after rebooting and running the 'source' command, it isn't working.
Steps to reproduce (if a bug)
Raspberry Pi 4b on OpenMediaVault 5. I essentially followed all of the directions to install borg, along with borgmatic. Added the following at the end of ~/.profile and ~/.bashrc.
Expected behavior (if a bug)
Whenever I try to execute the following
I just get back
Other notes / implementation ideas
I should note that if I put in the following as root
It works for that session, but I would like something more solid. Once I log out of root, it also stops working.
Environment
borgmatic version: [1.5.4]
borgmatic installation method: [Debian package]
Borg version: [1.1.11]
Python version: [3.7.3]
operating system and version: [Open Media Vault 5, Debian]
Thanks for filing this! There are few things more frustrating than system path issues..
One thing you didn't mention: Are you adding the path extention to the end of root's
~/.profile
and~/.bashrc
, or your non-root user's? I believe that if you want to be able to run borgmatic commands with sudo, you'll need to do this for your non-root user's~/.profile
/~/.bashrc
. If you haven't tried that already, please give that a shot. You might also try your~/.bash_profile
if that's not already sourcing~/.bashrc
.Not a problem! Thank you, haha, it is my first foray into the subject and a very interesting one to say the least.
Apologies on that end. I have added into my root user's
~/.profile
and~/.bashrc
, along with my non-root user's. I've also made it so that my~/.bash_profile
is sourcing~/.bashrc
Do you have any suggestions on what else I should try? Most of the things I've looked up show that these processes should work on Debian. Very odd!
Couple of ideas for other things to try:
echo $PATH
and see whether/root/.local/bin
is present in yourPATH
. If it is, then you know that's not the problem! A related approach is to add anecho hi
statement or similar to~/.bashrc
to see ifhi
shows up when you login./root/.local/bin
? Does running the full path via/root/.local/bin/generate-borgmatic-config
work?I assume that you're using Bash and not another shell?
These returned very interesting results, thank you!
After running echo $PATH, I get these results, which does show that /root/.local/bin is in the path, isn't that correct?
Additionally, adding
echo hi
does show up when I runsource ~/.bashrc
afterwards.I am quite sure that it is installed in /root/.local/bin, because if I run the full path, it does end up working! I did run this command with sudo in front of it. Of course, since I already have a config file, it spits out the following. Sadly it still doesn't recognize commands with sudo, weird.
And that
PATH
you pasted is for the root user or the non-root user? Forsudo generate-borgmatic-config
to work, I believe the non-root user will need/root/.local/bin
in their path.The only other thing I can think of is a permissions issue, e.g. the non-root user not being able to access
/root
or/root/.local/bin
or both. However I would expect that to manifest as a different error.If you still can't get this working, then another option would be to: Uninstall borgmatic (
pip3 uninstall borgmatic
as root), and then reinstall borgmatic without the--user
flag. That would install borgmatic globally at the system level, and would hopefully bypass all of the PATH issues as it would be on the default path.The main downside of this approach is that its installation would be a little less self-contained / separated from the rest of the system.
The path listed was for the non-root user!
Non-Root
Root
Do you think there is anything else I should look into with the possible permissions issue? If not, I'll go ahead and try to reinstall globally! Should I try to reinstall as root as well?
At this point I'd recommend just reinstalling globally, assuming you're okay with that. Given that this is probably a relatively dedicated device (a Pi), that's probably fine. The
--user
install recommendation is mostly there for workstations or big servers where you want to keep things relatively segregated, so installs of different Python software don't conflict with one another.That worked great! In a bit, I'll be running a backup and can report back on what transpires. So far,
sudo validate-borgmatic-config
along withsudo generate-borgmatic-config
are working flawlessly.Awesome, so glad to hear it! I'll update the instructions to mention the global install as an option.
So, after trying to run a backup with
sudo borgmatic --verbosity 1 --files
, I have gotten these error lines back. Do you know what the issue is and how I could solve it? I'd be happy to make another ticket for this if this is unrelated.I've listed my config.yaml below. For some reason it didn't let me upload it.
That appears to be an error coming directly from Borg, saying that the repository path you've specified is on a read-only filesystem.. meaning that Borg doesn't have the ability to write to your backup destination.
So can you check that Borg has the ability to write to
/srv/dev-disk-by-label-backup_drive/Borg_Backup/lock.roster
? You can even just verify that manually at the command-line by using your editor of choice to create and save a text file somewhere in/srv/dev-disk-by-label-backup_drive/Borg_Backup
.Yes, you are spot on with that. Thank you. I was able to solve this permissions issue by putting in
sudo chmod ug+rwx /srv/dev-disk-by-label-backup_drive
and can now create a new file in 'Borg_Backup'Sadly however, as one problem is solved another does tend to appear, haha. I'm getting this new error, can you shed some light onto it? Essentially I intend to backup around 250GB from one hard drive to another for redundancy. The hard drive that is the repository 'backup_drive', is completely empty. It seems to be showing an error that it doesn't have enough space?
My recommendation is to run a command like
sudo df -h
to show you the disk usage of the various disks in your system. That prints out a table showing the used, available, and percentage for each device. It should give you an idea of whether your disk is indeed full or close to it!Oh interesting, so, it spit this out. I checked OMV and it turns out that my 'backup_drive' was not mounted. I wonder why it just put the repository into the root partition instead?
How would you go about pruning the partial repo that somehow ended up on /dev/root?
Additionally, when I go to start a backup, it asks for my passphrase although I've specified it in the config.yaml. Do I have an issue with how I input that?
I believe that's just how Linux works.. Any path that's not otherwise mounted is presumed to be on the root partition.
I would just delete the whole contents of the
Borg_Backup/
directory before mounting, assuming that you don't mind recreating / re-init
ing it after you mount the directory.Not sure about that one. Make sure it's uncommented in the configuration file?
I went along with deleting that folder, however, on my SD Card, it still showed as entirely full until I went ahead and wiped the drive. Weird. Thank you!
How does this look? Is that correct?
Glad to hear the free space issue sounds like it's sorted out.
As for the passphrase, it's still commented out! Try this:
Note the removed
#
before both thestorage:
and theencryption_passphrase
.I see! Thank you. I just tried that out and everything seems to have run to perfection. Working on setting up the cron script now. Thank you so much for your help and patience with this, it is greatly appreciated!
Glad to hear it's working!