Bacula-users

Re: [Bacula-users] How to properly remove volumes in regards to the catalog?

2016-05-04 07:19:56
Subject: Re: [Bacula-users] How to properly remove volumes in regards to the catalog?
From: Kern Sibbald <kern AT sibbald DOT com>
To: Florian Splett <florian.splett AT web DOT de>, bacula-users AT lists.sourceforge DOT net
Date: Wed, 4 May 2016 13:18:09 +0200
Hello,

I strongly encourage users to use Bacula bconsole commands to accomplish *all* modifications of the catalog database.  Making changes by hand using SQL will quite often lead to inconsistencies in the catalog that can come back to haunt you. In addition, much of the SQL for MySQL and PostgreSQL is different, which can also cause problems.  Bacula via bconsole knows how to handle the database for both MySQL and Postges.  It is *extremely* rare that I do any modification of the database by hand -- maybe 2 times in 16 years.

Best regards,
Kern

On 05/04/2016 12:13 PM, Florian Splett wrote:

Hello and sorry for the late response.

I just wanted to thank you for all the information.
Definitely helped me decide on how to approach the issue.

Regards,

Florian S.

Am 28.04.2016 um 13:04 schrieb Wanderlei Huttel:
Hello Florian


2016-04-28 5:47 GMT-03:00 Florian Splett <florian.splett AT web DOT de>:
Hello, bacula community.

The harddrive my bacula system is using to store its volumes is reaching
its maximum capacity, so I had the following plan for my network:

I want to manually move the old volumes onto an external harddrive and
keep that somewhere else.

Now what i want to ask is: Does this cause complications with the catalog?
It depends if they will be recycle soon or not
I guess so, since the volumes will be just gone.
Can I somehow tell the catalog that the volumes should be marked as
"unavailable" or something like that?
You can update Volume Status and set to "Archive" or "Disabled"
*update
1: Volume parameters
1: Volume Status
 
...or is it in fact perfectly fine to just remove those volumes?
Or you could create another Storage Resource in bacula-dir.conf and new Device in bacula-sd.conf and use this external harddrive as a Storage.
Move those Volumes to the external harddrive.

Get StorageId from New Storage:
*sqlquery
Entering SQL query mode.
Terminate each query with a semicolon.
Terminate query mode with a blank line.
Enter SQL query: select StorageID, Name, Autochanger from Storage;
+-----------+---------------+-------------+
| StorageID | Name          | Autochanger |
+-----------+---------------+-------------+
|         1 | StorageLocal1 |           0 |
|         3 | StorageLocal2 |           0 |
+-----------+---------------+-------------+

Use this below sql to get information about Volumes x Pool x Storage

select M.MediaId, M.VolumeName, M.StorageId, S.Name, M.PoolId, P.Name from Media M  left join Storage S on (M.StorageId = S.StorageId) left join Pool P on (M.PoolId = P.PoolId) order by M.VolumeName;

*sqlquery
Entering SQL query mode.
Terminate each query with a semicolon.
Terminate query mode with a blank line.
Enter SQL query: select M.MediaId, M.VolumeName, M.StorageId, S.Name, M.PoolId, P.Name from Media M  left join Storage S on (M.StorageId = S.StorageId) left join Pool P on (M.PoolId = P.PoolId) orde; by M.VolumeNam
+---------+---------------------+-----------+---------------+--------+---------+
| MediaId | VolumeName          | StorageId | Name          | PoolId | Name    |
+---------+---------------------+-----------+---------------+--------+---------+
|      36 | Volume-Diario-0001  |         1 | StorageLocal1 |      6 | Diaria  |
|      51 | Volume-Diario-0002  |         1 | StorageLocal1 |      6 | Diaria  |
|      74 | Volume-Diario-0003  |         1 | StorageLocal1 |      6 | Diaria  |
|      89 | Volume-Diario-0004  |         1 | StorageLocal1 |      6 | Diaria  |
|      96 | Volume-Diario-0005  |         1 | StorageLocal1 |      6 | Diaria  |
|      97 | Volume-Diario-0006  |         1 | StorageLocal1 |      6 | Diaria  |
|      98 | Volume-Diario-0007  |         1 | StorageLocal1 |      6 | Diaria  |
...

Update the volumes that you have moved to external hard drive to NewStorage (change StorageId).

*sqlquery
update Media set StorageId = 3 where PoolId = 6; # Move all volumes from a Pool or 
*sqlquery
update Media set StorageId = 3 where MediaId in (36,51,74,89,96);

I guess this can help you.

Best Regards

Wanderlei Hüttel


Regards,

Florian S.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users



------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z


_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users