Bareos Bug Tracker
Bareos Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000988bareos-core[All Projects] Generalpublic2018-07-19 11:572018-07-20 23:18
ReporterIvanBayan 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSUbuntuOS Version16.04
Product Version17.2.4 
Target VersionFixed in Version 
Summary0000988: Truncate command do nothing
DescriptionLooks like bareos simple ignore truncate command. Since truncate option was removed from purge command, it's impossible to truncate volume from cli:
Steps To Reproduce1. Purge volumes
2. Check that them was purged.
# echo "list volumes pool=ow-backup03_veeam_full"|bconsole|tail -n 4
| 390 | ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423 | Purged | 1 | 10,737,377,563 | 2 | 1,296,000 | 0 | 0 | 0 | File_ow-backup03_dev-03 | 2017-07-11 21:20:58 | ow-backup03_dev-03-sd |
| 391 | ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423 | Purged | 1 | 4,858,174,249 | 1 | 1,296,000 | 0 | 0 | 0 | File_ow-backup03_dev-03 | 2017-07-11 21:21:47 | ow-backup03_dev-03-sd |
+---------+---------------------------------------------------------+-----------+---------+----------------+----------+--------------+---------+------+-----------+-------------------------+---------------------+-----------------------+
3. Invoke truncate
# echo "truncate volstatus=Purged pool=ow-backup03_veeam_full yes"|bconsole
Connecting to Director localhost:9101
1000 OK: mia-backup03-dir Version: 17.2.4 (21 Sep 2017)
Enter a period to cancel a command.
truncate volstatus=Purged pool=ow-backup03_veeam_full yes
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
No results to list.
You have messages.
4. Check that volumes stay untouched:
# ls -lh /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-21{19,20}*
-rw-r----- 1 bareos bareos 10G Jul 11 2017 /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423
-rw-r----- 1 bareos bareos 4.6G Jul 11 2017 /mnt/storage-dev-03/bareos/storage/ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423
TagsNo tags attached.
bareos-master: impact
bareos-master: action
bareos-18.2: impact
bareos-18.2: action
bareos-17.2: impact
bareos-17.2: action
bareos-16.2: impact
bareos-16.2: action
bareos-15.2: impact
bareos-15.2: action
bareos-14.2: impact
bareos-14.2: action
bareos-13.2: impact
bareos-13.2: action
bareos-12.4: impact
bareos-12.4: action
Attached Files

- Relationships

-  Notes
(0003078)
aron_s (developer)
2018-07-20 13:20
edited on: 2018-07-20 13:20

Could you try to specify each of the volumes when truncating them ?
The usage of the truncate command is truncate volstatus=Purged [storage=<storage>] [pool=<pool>] [volume=<volume>] [yes], so try

truncate volstatus=Purged pool=ow-backup03_veeam_full volume=ow-backup01-fd-ow-backup03_veeam_full-20170711-2119-423 yes

truncate volstatus=Purged pool=ow-backup03_veeam_full volume= ow-backup01-fd-ow-backup03_veeam_full-20170711-2120-423 yes

(0003079)
IvanBayan (reporter)
2018-07-20 13:42

I've already deleted that volumes, but done test for you with different volume and got same result:
# ls -lh mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
-rw-r----- 1 bareos bareos 3.7G Sep 30 2017 mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00


*purge volume=mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00

This command can be DANGEROUS!!!
.....
This command requires full access to all resources.
1 File on Volume "mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00" purged from catalog.
There are no more Jobs associated with Volume "mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00". Marking it purged.

*list volume=mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
| mediaid | volumename | volstatus | enabled | volbytes | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten | storage |
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
| 413 | mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00 | Purged | 1 | 3,903,535,449 | 0 | 5,184,000 | 0 | 0 | 0 | File_mia-backup03_storage03 | 2017-09-30 21:00:36 | mia-backup03_storage03-sd |
+---------+-----------------------------------------------------------------+-----------+---------+---------------+----------+--------------+---------+------+-----------+-----------------------------+---------------------+---------------------------+
# ls -lh mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00
-rw-r----- 1 bareos bareos 3.7G Sep 30 2017 mia-backup03-fd-mia-backup03_mixed_differential-20170930-568-00

So, volume specification in truncate command make no difference.
(0003080)
aron_s (developer)
2018-07-20 13:43

As a proof of functionality I tried this myself with a filestorage and it worked flawless.

$ echo "list volumes pool=truncate-test"|bconsole|tail -n 4
| mediaid | volumename | volstatus | enabled | volbytes | volfiles | volretention | recycle | slot | inchanger | mediatype | lastwritten | storage |
+---------+--------------+-----------+---------+------------+----------+--------------+---------+------+-----------+-----------+---------------------+--------------------------+
| 3 | Truncate-001 | Purged | 1 | 22,947,582 | 0 | 31,536,000 | 1 | 0 | 0 | File | 2018-07-20 13:28:00 | ubuntu1604-VirtualBox-sd |
+---------+--------------+-----------+---------+------------+----------+--------------+---------+------+-----------+-----------+---------------------+--------------------------+
$ ls -lh /var/lib/bareos/storage/Truncate-001
-rw-r----- 1 bareos bareos 22M Jul 20 13:28 /var/lib/bareos/storage/Truncate-001
$ echo "truncate volstatus=Purged pool=truncate-test yes"|bconsole
[...]
Sending relabel command from "Truncate-001" to "Truncate-001" ...
3000 OK label. VolBytes=231 Volume="Truncate-001" Device="FileStorage" (/var/lib/bareos/storage)
The volume 'Truncate-001' has been truncated.
$ ls -lh /var/lib/bareos/storage/Truncate-001
-rw-r----- 1 bareos bareos 231 Jul 20 13:38 /var/lib/bareos/storage/Truncate-001
(0003081)
IvanBayan (reporter)
2018-07-20 15:08

So, is here a way to help you with debugging?
*version
mia-backup03-dir Version: 17.2.4 (21 Sep 2017) x86_64-pc-linux-gnu ubuntu Ubuntu 16.04 LTS xUbuntu_16.04 x86_64
*status storage=mia-backup03_storage03-sd
Connecting to Storage daemon mia-backup03_storage03-sd at mia-backup03.int:9103

mia-backup03_storage03-sd Version: 17.2.4 (21 Sep 2017) x86_64-pc-linux-gnu ubuntu Ubuntu 16.04 LTS
(0003082)
aron_s (developer)
2018-07-20 23:18

I will look into the changes between Bareos 18.2 and 17.2 when it comes to truncating. If there are none, it must be something outside of Bareos.

- Issue History
Date Modified Username Field Change
2018-07-19 11:57 IvanBayan New Issue
2018-07-20 13:20 aron_s Note Added: 0003078
2018-07-20 13:20 aron_s Note Edited: 0003078 View Revisions
2018-07-20 13:42 IvanBayan Note Added: 0003079
2018-07-20 13:43 aron_s Note Added: 0003080
2018-07-20 15:08 IvanBayan Note Added: 0003081
2018-07-20 23:18 aron_s Note Added: 0003082


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker