Bareos storage error

49 views
Skip to first unread message

lucas

unread,
Jun 16, 2020, 6:59:12 AM6/16/20
to bareos-users
Hi, 

I'm trying to change the storage of my bareos backups, I have mounted a second disk in /var/lib/bareos/storage, but when trying to make a backup I get that error, someone can help and explain what happens.  

Thanks a lot
Bildschirmfoto 2020-06-16 um 12.48.12.png
Bildschirmfoto 2020-06-16 um 12.48.40.png

Spadajspadaj

unread,
Jun 16, 2020, 7:21:44 AM6/16/20
to bareos...@googlegroups.com

As tou can see, the Storage Daemon can't create files on the disk. Since the device is formatted with ext4 filesystem you need to set appropriate ownership and access rights to the storage directory _after you've mounted it_.

--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bareos-users/da946380-4a9e-44a1-8822-7ba3e7045f4ao%40googlegroups.com.

lucas

unread,
Jun 16, 2020, 7:31:43 AM6/16/20
to bareos-users


El martes, 16 de junio de 2020, 13:21:44 (UTC+2), Spadajspadaj escribió:

As tou can see, the Storage Daemon can't create files on the disk. Since the device is formatted with ext4 filesystem you need to set appropriate ownership and access rights to the storage directory _after you've mounted it_.


On 16.06.2020 12:59, lucas wrote:
Hi, 

I'm trying to change the storage of my bareos backups, I have mounted a second disk in /var/lib/bareos/storage, but when trying to make a backup I get that error, someone can help and explain what happens.  

Thanks a lot
--
You received this message because you are subscribed to the Google Groups "bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bareos...@googlegroups.com.

Can you tell me how to do a little guide? I am a novice in this, in what format do I have to mount the disk and what privileges do I have to give it?

Thanks

Spadajspadaj

unread,
Jun 16, 2020, 7:38:04 AM6/16/20
to bareos...@googlegroups.com


On 16.06.2020 13:31, lucas wrote:

Can you tell me how to do a little guide? I am a novice in this, in what format do I have to mount the disk and what privileges do I have to give it?


I have no clue what your configuration looks like but I suppose you've already mounted the disk (at least that's what the screenshot shows - /dev/sdb is mounted on /var/lib/bareos/storage).

So you have to check what user the bareos-sd is running with (I suppose it's user bareos but it's always good to check). Just run "ps u -C bareos-sd" and see the first column of outtput.

Then you have to chown the /var/lib/bareos/storage. Supposing it's the user "bareos", you have to do "chown bareos /var/lib/bareos/storage".

But I strongly advise you read a bit about unix permissions.

lucas

unread,
Jun 16, 2020, 7:54:49 AM6/16/20
to bareos-users
yes, my username is bareos, so do I have to give permissions to the / var / lib / bareos / storage directory?  and lastly the disk is mounted on ext4 cause any problem if it is on ext4?
 
Bildschirmfoto 2020-06-16 um 13.51.51.png

lucas

unread,
Jun 16, 2020, 8:06:36 AM6/16/20
to bareos-users


El martes, 16 de junio de 2020, 13:38:04 (UTC+2), Spadajspadaj escribió:
I did what you told me, the backup is successful but with those messages. 
Bildschirmfoto 2020-06-16 um 14.04.54.png

Spadajspadaj

unread,
Jun 17, 2020, 3:25:57 AM6/17/20
to bareos...@googlegroups.com

Can you tell me how to do a little guide? I am a novice in this, in what format do I have to mount the disk and what privileges do I have to give it?


I have no clue what your configuration looks like but I suppose you've already mounted the disk (at least that's what the screenshot shows - /dev/sdb is mounted on /var/lib/bareos/storage).

So you have to check what user the bareos-sd is running with (I suppose it's user bareos but it's always good to check). Just run "ps u -C bareos-sd" and see the first column of outtput.

Then you have to chown the /var/lib/bareos/storage. Supposing it's the user "bareos", you have to do "chown bareos /var/lib/bareos/storage".

But I strongly advise you read a bit about unix permissions.



I did what you told me, the backup is successful but with those messages. 


I assume that you had a local installation on which you were writing to /var/lib/bareos/storage, it worked for some time (you did at least one backup) and now you mounted another drive into that directory.

When you mount the drive into a directory, the drive is seen by the operating system as this directory. Previous contents of this directory are no longer accessible until you unmount that drive.

So in your case /var/lib/bareos/storage no longer shows a local directory (which contained a previously used bareos media file) but points to another filesystem created on /dev/sdb. So as long as you have the disk mounted under /var/lib/bareos/storage, you don't have access to the /var/lib/bareos/storage/Full-0001 file. Also you have no way to - for example - delete it in case you want to free some space on your filesystem. But the media file is still referenced by bareos director database so you might run into trouble later, for example, trying to restore from the job contained in this file.

The question is what do you want to achieve. If you just want to have a single big bareos backup drive, I'd suggest you stop all bareos processes, unmount the new disk, move the contents from /var/lib/bareos/storage to another directory, mount the new disk and then move the files back to /var/lib/bareos/storage (this time they'll be located on the new disk).

But if you want to have removable disks which you can swap (for example to have off-line backup stored somewhere else), that's a much more tricky solution involving vchanger script and I wouldn't advise you try to set it up unless you have a good understanding of Bareos and how your OS works.

lucas

unread,
Jun 17, 2020, 2:26:50 PM6/17/20
to bareos-users
Hi Spadajspadaj,

thank you very much !

its work
Reply all
Reply to author
Forward
0 new messages