How to restore files (backup to disk) without the catalog

1,848 views
Skip to first unread message

Christian Tardif

unread,
Nov 26, 2014, 1:38:21 AM11/26/14
to bareos...@googlegroups.com
Hi,
 
I have my SAN that crashed tonight, and I'd like to know what are my options to restore my files from my Bareos backups. My backups are backup-to-disk, but the catalog was on the SAN, as long as any other configuration.  I really need to be able to restore from these backup files.
 
How can I achieve this ?
 
Thanks,
 



Christian Tardif
christia...@servinfo.ca

 

Bruno Friedmann

unread,
Nov 26, 2014, 2:37:51 AM11/26/14
to bareos...@googlegroups.com
On Wednesday 26 November 2014 06.37:35 Christian Tardif wrote:
> Hi,
>
> I have my SAN that crashed tonight, and I'd like to know what are my
> options to restore my files from my Bareos backups. My backups are
> backup-to-disk, but the catalog was on the SAN, as long as any other
> configuration. I really need to be able to restore from these backup
> files.
>
> How can I achieve this ?
>
> Thanks,

I would say, recreate a catalog db server somewhere,
and restore your last backup catalog there.

You can use bscan to recreate the catalog from media

And at least using bls/bextract tools when nothing else could be used.

--

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch

openSUSE Member & Board, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot

Philipp Storz

unread,
Nov 26, 2014, 3:21:58 AM11/26/14
to bareos...@googlegroups.com
Hello,

yes, exactly as Bruno says, you need to get you catalog back.

If you have the bootstrap record of your last backup in an email, it is relatively easy to get it back.

See "Restoring When Things Go Wrong" in the manual:
http://doc.bareos.org/master/html/bareos-manual-main-reference.html#x1-416000I.6.4

You can also use bextract and give it your bootstrap file with the -b parameter.
It will then directly extract your last catalog backup.

I wish you success!



Am 26.11.2014 08:36, schrieb Bruno Friedmann:
> On Wednesday 26 November 2014 06.37:35 Christian Tardif wrote:
>> Hi,
>>
>> I have my SAN that crashed tonight, and I'd like to know what are my
>> options to restore my files from my Bareos backups. My backups are
>> backup-to-disk, but the catalog was on the SAN, as long as any other
>> configuration. I really need to be able to restore from these backup
>> files.
>>
>> How can I achieve this ?
>>
>> Thanks,
>
> I would say, recreate a catalog db server somewhere,
> and restore your last backup catalog there.
>
> You can use bscan to recreate the catalog from media
>
> And at least using bls/bextract tools when nothing else could be used.
>


--
Mit freundlichen Grüßen

Philipp Storz philip...@bareos.com
Bareos GmbH & Co. KG Phone: Phone: +49221630693-92
http://www.bareos.com Fax: +49221630693-10

Sitz der Gesellschaft: Köln | Amtsgericht Köln: HRA 29646
Geschäftsführer: Stephan Dühr, M. Außendorf,
J. Steffens, P. Storz, M. v. Wieringen

Christian Tardif

unread,
Nov 26, 2014, 9:45:19 PM11/26/14
to Philipp Storz, bareos...@googlegroups.com
OK. It looks like I have to go the hard way, and completely recreate the
catalog from backups. Due to the number of volumes I have, I created a
bootstrap file, as said on the documentation, that sets every volume I
have.

My bscan command has to be used against files, not tapes. Since the
storage daemon configuration is the same as before the crash (the
storage server is not on my SAN), I know it is correct. So the command
I'm trying to use is:

bscan -s -v -b /var/lib/bareos/bootstrap_bscan.bsr FileStorage

(will enter database information later)

As a result, I'm getting this:

bls: butil.c:289-0 Using device: "FileStorage" for reading.
26-Nov 21:40 bls JobId 0: Warning: acquire.c:267 Read acquire: Mount
Volume "BareosVol-0001" on device "FileStorage" (/mnt/backups) and press
return when ready:

I'm getting the last part multiple times, and it finally ends up saying:

26-Nov 21:40 bls JobId 0: Fatal error: acquire.c:316 Too many errors
trying to mount device "FileStorage" (/mnt/backups) for reading.

Looks like it can't open the file for reading. Permissions issues ?
Missing simething from the command line ?

--------------------------------------------------------------------------------

Christian Tardif





------ Message d'origine ------
De : "Philipp Storz" <philip...@bareos.com>
À : bareos...@googlegroups.com
Envoyé 2014-11-26 03:21:47
Objet : Re: [bareos-users] How to restore files (backup to disk) without
the catalog
>--
>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 post to this group, send email to bareos...@googlegroups.com.
>For more options, visit https://groups.google.com/d/optout.

Christian Tardif

unread,
Nov 26, 2014, 10:12:08 PM11/26/14
to Philipp Storz, bareos...@googlegroups.com
As a side note, I know that bscan actually see the file, because if I
try a non-existing file (like aaa for example), I'm getting this:

bscan: butil.c:289-0 Using device: "FileStorage" for reading.
26-Nov 22:11 bscan JobId 0: Warning: acquire.c:226 Read open device
"FileStorage" (/mnt/backups) Volume "aaaaa" failed: ERR=dev.c:556 Could
not open: /mnt/backups/aaaaa, ERR=No such file or directory

--------------------------------------------------------------------------------

Christian Tardif


------ Message d'origine ------
De : "Christian Tardif" <christia...@servinfo.ca>
À : "Philipp Storz" <philip...@bareos.com>;
bareos...@googlegroups.com
Envoyé 2014-11-26 21:44:29
Objet : Re[2]: [bareos-users] How to restore files (backup to disk)

Philipp Storz

unread,
Nov 27, 2014, 2:21:35 AM11/27/14
to Christian Tardif, bareos...@googlegroups.com
You should run the bscan command with high debug level (e.g. 400 or 500).

I expect that it will tell you what is the problem.

You really never did a catalog db backup?

Am 27.11.2014 04:11, schrieb Christian Tardif:
>
> bscan: butil.c:289-0 Using device: "FileStorage" for reading.
> 26-Nov 22:11 bscan JobId 0: Warning: acquire.c:226 Read open device "FileStorage" (/mnt/backups)
> Volume "aaaaa" failed: ERR=dev.c:556 Could not open: /mnt/backups/aaaaa, ERR=No such file or directory


Christian Tardif

unread,
Nov 27, 2014, 8:29:00 AM11/27/14
to Philipp Storz, bareos...@googlegroups.com

Catalog Backup: Yes, but that was somewhere in the crashed SAN  :-(  So not accessible. The only thing I can rely on is....  the medias.

 

So with a debug level at 500 (it creates a lot of stuff on the screen), it gives me (I'm cutting off some redundant stuff. But that's anyway a long listing, sorry 'bout that):

=====================================================

bscan: parse_bsr.c:192-0 Enter parse_bsf /var/lib/bareos/bootstrap_bscan.bsr
bscan: lex.c:217-0 Open config file: /var/lib/bareos/bootstrap_bscan.bsr
bscan: parse_bsr.c:200-0 parse got token=T_IDENTIFIER
bscan: parse_bsr.c:207-0 in T_IDENT got token=T_EQUALS
bscan: parse_bsr.c:213-0 calling handler for volume
bscan: parse_bsr.c:200-0 parse got token=T_EOL
bscan: parse_bsr.c:200-0 parse got token=T_IDENTIFIER
bscan: parse_bsr.c:207-0 in T_IDENT got token=T_EQUALS
bscan: parse_bsr.c:213-0 calling handler for volume
bscan: parse_bsr.c:200-0 parse got token=T_EOL
bscan: parse_bsr.c:200-0 parse got token=T_IDENTIFIER
bscan: parse_bsr.c:207-0 in T_IDENT got token=T_EQUALS
bscan: parse_bsr.c:213-0 calling handler for volume

..... (cut something like 2000 lines like that)

bscan: lex.c:217-0 Open config file: /etc/bareos/bareos-sd.conf
bscan: stored_conf.c:857-0 Inserting director res: zeus.servinfo.stba-mon
bscan: stored_conf.c:857-0 Inserting device res: FileStorage2
bscan: lex.c:217-0 Open config file: /etc/bareos/bareos-sd.conf
bscan: sd_plugins.c:308-0 Load sd plugins
bscan: plugins.c:182-0 load_plugins
bscan: plugins.c:279-0 Found plugin: name=scsicrypto-sd.so len=16
bscan: scsicrypto-sd.c:137-0 scsicrypto-sd: Loaded: size=72 version=2
bscan: sd_plugins.c:357-0 is_plugin_compatible called
bscan: plugins.c:276-0 Rejected plugin: want=-sd.so name=python-dir.so len=13
bscan: plugins.c:276-0 Rejected plugin: want=-sd.so name=bpipe-fd.so len=11
bscan: plugins.c:279-0 Found plugin: name=python-sd.so len=12
bscan: sd_plugins.c:357-0 is_plugin_compatible called
bscan: plugins.c:276-0 Rejected plugin: want=-sd.so name=python-fd.so len=12
bscan: sd_plugins.c:330-0 Loaded plugin: scsicrypto-sd.so
bscan: sd_plugins.c:330-0 Loaded plugin: python-sd.so
bscan: sd_plugins.c:333-0 num plugins=2
bscan: crypto_cache.c:55-0 Could not open crypto cache file. /var/lib/bareos/bareos-sd.9103.cryptoc ERR=No such file or directory
bscan: sd_plugins.c:403-0 === enter new_plugins ===
bscan: sd_plugins.c:419-0 sd-plugin-list size=2
bscan: sd_plugins.c:427-0 Instantiate sd-plugin_ctx_list=1d6e118 JobId=0
bscan: sd_plugins.c:487-0 sd-plugin: return bVarJobId=0
bscan: scsicrypto-sd.c:168-0 scsicrypto-sd: newPlugin JobId=0
bscan: sd_plugins.c:530-0 sd-Plugin wants event=8
bscan: sd_plugins.c:530-0 sd-Plugin wants event=9
bscan: sd_plugins.c:530-0 sd-Plugin wants event=10
bscan: sd_plugins.c:530-0 sd-Plugin wants event=12
bscan: sd_plugins.c:530-0 sd-Plugin wants event=14
bscan: sd_plugins.c:530-0 sd-Plugin wants event=16
bscan: sd_plugins.c:530-0 sd-Plugin wants event=17


bscan: butil.c:289-0 Using device: "FileStorage" for reading.

bscan: dev.c:176-0 Allocate dev="FileStorage" (/mnt/backups)
bscan: dev.c:299-0 init_dev: tape=0 dev_name=/mnt/backups
bscan: acquire.c:694-0 JobId=0 enter attach_dcr_to_dev
bscan: acquire.c:699-0 Attach Jid=0 dcr=1d6f238 size=0 dev="FileStorage" (/mnt/backups)
bscan: vol_mgr.c:153-0 add read_vol=BareosVol-0001 JobId=0
bscan: bsr.c:870-0 Added volume=BareosVol-0001 mediatype=
bscan: vol_mgr.c:153-0 add read_vol=BareosVol-0002 JobId=0

... (cut the list of 600+ other volumes identifiers)

bscan: butil.c:183-0 Acquire device for read
bscan: acquire.c:63-0 dcr=1d6f238 dev=1d6e728
bscan: acquire.c:64-0 MediaType dcr= dev=File
bscan: lock.c:412-0 set blocked=BST_DOING_ACQUIRE from lock.c:135
bscan: acquire.c:92-0 Want Vol=BareosVol-0001 Slot=0
bscan: acquire.c:106-0 MediaType dcr= dev=File
bscan: acquire.c:174-0 MediaType dcr= dev=File
bscan: acquire.c:191-0 dir_get_volume_info vol=BareosVol-0001
bscan: bscan.c:1417-0 Fake dir_get_volume_info
bscan: bscan.c:1419-0 Vol=BareosVol-0001
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: scsicrypto-sd.c:245-0 scsicrypto-sd: handlePluginEvent event 12
bscan: sd_plugins.c:207-0 Event 12 disabled for this plugin.
bscan: mount.c:592-0 No swap_dev set
bscan: mount.c:542-0 Must load "FileStorage" (/mnt/backups)
bscan: autochanger.c:99-0 Device "FileStorage" (/mnt/backups) is not an autochanger
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: sd_plugins.c:207-0 Event 5 disabled for this plugin.
bscan: sd_plugins.c:207-0 Event 5 disabled for this plugin.
bscan: acquire.c:222-0 stored: open vol=BareosVol-0001
bscan: dev.c:363-0 open dev: type=1 dev_name="FileStorage" (/mnt/backups) vol=BareosVol-0001 mode=OPEN_READ_ONLY
bscan: dev.c:372-0 call open_file_device mode=OPEN_READ_ONLY
bscan: dev.c:1866-0 Enter mount
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: sd_plugins.c:207-0 Event 4 disabled for this plugin.
bscan: sd_plugins.c:207-0 Event 4 disabled for this plugin.
bscan: dev.c:550-0 open disk: mode=OPEN_READ_ONLY open(/mnt/backups/BareosVol-0001, 0x0, 0640)
bscan: dev.c:564-0 open dev: disk fd=3 opened
bscan: dev.c:376-0 preserve=0x0 fd=3
bscan: acquire.c:230-0 opened dev "FileStorage" (/mnt/backups) OK
bscan: acquire.c:233-0 calling read-vol-label
bscan: label.c:72-0 Enter read_volume_label res=0 device="FileStorage" (/mnt/backups) vol=BareosVol-0001 dev_Vol=*NULL*
bscan: dev.c:578-0 rewind res=0 fd=3 "FileStorage" (/mnt/backups)
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: scsicrypto-sd.c:245-0 scsicrypto-sd: handlePluginEvent event 8
bscan: sd_plugins.c:207-0 Event 8 disabled for this plugin.
bscan: label.c:136-0 Big if statement in read_volume_label
bscan: block.c:955-0 Full read in read_block_from_device() len=64512
bscan: block.c:1010-0 Read device got 64512 bytes at 0:0
bscan: block.c:311-0 unser_block_header block_len=223
bscan: block.c:324-0 Read binbuf = 199 24 block_len=223
bscan: block.c:1156-0 At end of read block
bscan: block.c:1160-0 Current lseek pos=64512
bscan: block.c:1165-0 Did lseek pos=223 blk_size=223 rdlen=64512
bscan: block.c:1170-0 Exit read_block read_len=64512 block_len=223
bscan: record.c:563-0 Block=0 Ver=2 size=223
bscan: record.c:571-0 Enter read_record_block: remlen=199 data_len=0 rem=0 blkver=2
bscan: record.c:633-0 rd_rec_blk() got FI=VOL_LABEL SessId=198 Strm=1 len=187
remlen=187 data_len=0
bscan: record.c:692-0 Rtn full rd_rec_blk FI=VOL_LABEL SessId=198 Strm=1 len=187
bscan: label.c:872-0 unser_vol_label


Volume Label:
Id : Bacula 1.0 immortal
VerNo : 11
VolName : BareosVol-0001
PrevVolName :
VolFile : 0
LabelType : VOL_LABEL
LabelSize : 187
PoolName : Inc-Pool
MediaType : File
PoolType : Backup
HostName : cassiopee.servinfo.stba
Date label written: 04-Sep-2014 23:30
bscan: label.c:209-0 Compare Vol names: VolName=BareosVol-0001 hdr=BareosVol-0001

Volume Label:
Id : Bacula 1.0 immortal
VerNo : 11
VolName : BareosVol-0001
PrevVolName :
VolFile : 0
LabelType : VOL_LABEL
LabelSize : 187
PoolName : Inc-Pool
MediaType : File
PoolType : Backup
HostName : cassiopee.servinfo.stba
Date label written: 04-Sep-2014 23:30
bscan: label.c:230-0 Leave read_volume_label() VOL_OK
bscan: dev.c:578-0 rewind res=0 fd=3 "FileStorage" (/mnt/backups)
bscan: label.c:247-0 Call reserve_volume=BareosVol-0001
bscan: vol_mgr.c:355-0 enter reserve_volume=BareosVol-0001 drive="FileStorage" (/mnt/backups)
bscan: vol_mgr.c:264-0 new Vol=BareosVol-0001 at 1de3c58 dev="FileStorage" (/mnt/backups)
bscan: vol_mgr.c:479-0 === set in_use. vol=BareosVol-0001 dev="FileStorage" (/mnt/backups)
bscan: vol_mgr.c:513-0 Inc walk_start use_count=2 volname=BareosVol-0001
bscan: vol_mgr.c:200-0 List end new volume: BareosVol-0001 in_use=1 swap=0 on device "FileStorage" (/mnt/backups)
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: scsicrypto-sd.c:245-0 scsicrypto-sd: handlePluginEvent event 9
bscan: label.c:266-0 Error from bsdEventLabelVerified plugin event.
bscan: dev.c:578-0 rewind res=0 fd=3 "FileStorage" (/mnt/backups)
bscan: label.c:276-0 return 5
bscan: acquire.c:254-0 Vol name=BareosVol-0001 want=BareosVol-0001 drv="FileStorage" (/mnt/backups).
bscan: dev.c:1717-0 close_dev "FileStorage" (/mnt/backups)
bscan: dev.c:1918-0 Enter unmount
bscan: sd_plugins.c:252-0 sd-plugin_ctx_list=1d6e118 JobId=0
bscan: sd_plugins.c:207-0 Event 13 disabled for this plugin.
bscan: sd_plugins.c:207-0 Event 13 disabled for this plugin.
bscan: dev.c:1706-0 Clear volhdr vol=BareosVol-0001
bscan: vol_mgr.c:666-0 === clear in_use vol=BareosVol-0001
bscan: vol_mgr.c:669-0 === remove volume BareosVol-0001 dev="FileStorage" (/mnt/backups)
27-Nov 08:17 bscan JobId 0: Warning: acquire.c:267 Read acquire: bscan: acquire.c:269-0 default path
bscan: acquire.c:284-0 calling autoload Vol=BareosVol-0001 Slot=0
bscan: autochanger.c:99-0 Device "FileStorage" (/mnt/backups) is not an autochanger
bscan: acquire.c:293-0 calling dir_ask_sysop
bscan: bscan.c:1406-0 Enter dir_ask_sysop_to_mount_volume
bscan: dev.c:1717-0 close_dev "FileStorage" (/mnt/backups)
bscan: dev.c:1724-0 device "FileStorage" (/mnt/backups) already closed vol=

=====================================================

Any clue ?

Thanks for your help!

---

Christian Tardif


 

Philipp Storz

unread,
Nov 27, 2014, 9:18:38 AM11/27/14
to Christian Tardif, bareos...@googlegroups.com
Hello Christian,

it looks like you have ran into bug 338:

see http://bugs.bareos.org/view.php?id=338

Just move/delete the scsicrypto-sd.so plugin so that it doesnt get loaded, then it should work.


Best regards,

Philipp
> *Christian Tardif
> *
>
> ----------------------------------------------------------------------------------------------------
>
>
>
> On 2014-11-27 02:21, Philipp Storz wrote:
>
>> You should run the bscan command with high debug level (e.g. 400 or 500).
>>
>> I expect that it will tell you what is the problem.
>>
>> You really never did a catalog db backup?
>>
>> Am 27.11.2014 04:11, schrieb Christian Tardif:
>>> bscan: butil.c:289-0 Using device: "FileStorage" for reading. 26-Nov 22:11 bscan JobId 0:
>>> Warning: acquire.c:226 Read open device "FileStorage" (/mnt/backups) Volume "aaaaa" failed:
>>> ERR=dev.c:556 Could not open: /mnt/backups/aaaaa, ERR=No such file or directory
>> --
>> Mit freundlichen Grüßen
>>
>> Philipp Storz philip...@bareos.com <mailto:philip...@bareos.com>

Christian Tardif

unread,
Nov 27, 2014, 8:29:53 PM11/27/14
to Philipp Storz, bareos...@googlegroups.com
Philipp, you're the man !!!!

This was E X A C T L Y my problem. Actually, I commented out the plugin
directory in the bareos-sd.conf file, and now, the database is
recreating from my 600+ volumes. Now, let's see what goes out of this.

You made my day !!!!
--------------------------------------------------------------------------------

Christian Tardif


------ Message d'origine ------
De : "Philipp Storz" <philip...@bareos.com>
À : "Christian Tardif" <christia...@servinfo.ca>
Cc: bareos...@googlegroups.com
Envoyé 2014-11-27 09:18:24
Objet : Re: [bareos-users] How to restore files (backup to disk) without
the catalog

Philipp Storz

unread,
Dec 2, 2014, 3:39:46 AM12/2/14
to Christian Tardif, bareos...@googlegroups.com
Hello Christian,

I hope you were successful in restoring your data.

It looks like you are using Bareos in productive environment.

I would like to ask you to contemplate our commercial offerings.

A subscription would have given you access to the bareos.com repositories where the problem you ran
into would have already been fixed.

With a support contract we would have been able to help you directly with your problems.

Buying a subscription and/or support will help us to improve bareos.

Thank you very much,

very best regards,

Philipp
Reply all
Reply to author
Forward
0 new messages