View Full Version : amrecover + smb

May 21st, 2009, 11:56 PM

i'm using amanda 2.6.1p1 (but i had the same problem with an older version) in order to save some directories located on a windows box (we'll call it WINBOX). I'm using smb share to do this. amanda-server is installed on a fedora10 (let's call it FEDBOX).

here is some extracts:
- DailySet1/disklist

[root@FEDBOX tmp]# grep WINBOX /etc/amanda/DailySet1/disklist
FEDBOX //WINBOX/c$/Inetpub comp-user-tar

- amandapass

[root@FEDBOX tmp]# grep WINBOX /etc/amandapass
//WINBOX/c$ administrateur%XXXXXX DOMAIN.local

(ask me if you need other informations)

Here is the problem: i can't restore files using "setmode smb" with amrecover.

[root@FEDBOX tmp]# amrecover -C DailySet1
AMRECOVER Version 2.6.1p1. Contacting server on FEDBOX ...
220 fedbox AMANDA index server (2.6.1p1) ready.
Setting restore date to today (2009-05-22)
200 Working date set to 2009-05-22.
200 Config set to DailySet1.
501 Host fedbox is not in your disklist.
Trying host localhost.localdomain ...
501 Host localhost.localdomain is not in your disklist.
Trying host localhost ...
200 Dump host set to localhost.
Use the setdisk command to choose dump disk to recover
amrecover> listhost
200- List hosts for config DailySet1
200 List hosts for config DailySet1
amrecover> sethost FEDBOX
200 Dump host set to FEDBOX.
amrecover> listdisk
200- List of disk for host FEDBOX
201- //WINBOX/c$/Inetpub
200 List of disk for host FEDBOX
amrecover> setdisk //WINBOX/c$/Inetpub
200 Disk set to //WINBOX/c$/Inetpub.
amrecover> ls
2009-05-20-15-31-25 Inetpub/
amrecover> cd Inetpub
amrecover> add test2009
Added dir /Inetpub/test2009/ at date 2009-05-20-15-31-25
amrecover> setmode smb
SAMBA dumps will be extracted using smbclient
amrecover> extract

Extracting files using tape drive changer on host FEDBOX.
The following tapes are needed: DailySet1-05

Restoring files into directory /tmp
(unless it is a Samba backup, that will go through to the SMB server)
Continue [?/Y/n]? y

Extracting files using tape drive changer on host FEDBOX.
Load tape DailySet1-05 now
Continue [?/Y/n/s/d]? y
Extractor child exited with status 1

And nothing is restored in the directory test2009. :(

Note that if i extract locally (using "setmode tar"), everything works perfectly.

I hope this remind something to someone,
Thanks in advance ;)


(sorry for my english :D)

May 22nd, 2009, 03:42 AM
Post the amrecover.*.debug file

May 22nd, 2009, 04:13 AM
Aouch ! i just looked in /etc/amanda/DailySet1/logs; thx

Here is the amrecover log:

[root@FEDBOX ~]# cat /var/log/amanda/client/DailySet1/amrecover.20090522140239.debug
1242993759.624091: amrecover: pid 4177 ruid 0 euid 0 version 2.6.1p1: start at Fri May 22 14:02:39 2009
1242993759.625312: amrecover: pid 4177 ruid 0 euid 0 version 2.6.1p1: rename at Fri May 22 14:02:39 2009
1242993759.625393: amrecover: security_getdriver(name=bsdtcp) returns 0x7f1660
1242993759.625423: amrecover: security_handleinit(handle=0x83f7368, driver=0x7f1660 (BSDTCP))
1242993759.627228: amrecover: security_streaminit(stream=0x83f7f50, driver=0x7f1660 (BSDTCP))
1242993759.628625: amrecover: connect_port: Skip port 700: owned by epp.
1242993759.629435: amrecover: connect_port: Skip port 701: owned by lmp.
1242993759.630289: amrecover: connect_port: Skip port 702: owned by iris-beep.
1242993759.636345: amrecover: make_socket opening socket with family 2
1242993759.638014: amrecover: connect_port: Try port 703: available - Success
1242993759.649327: amrecover: connected to
1242993759.649366: amrecover: our side is
1242993759.649387: amrecover: try_socksize: send buffer size is 65536
1242993759.649402: amrecover: try_socksize: receive buffer size is 65536
1242993759.669385: amrecover: security_streaminit(stream=0x8400fe8, driver=0x7f1660 (BSDTCP))
1242993759.669427: amrecover: security_close(handle=0x83f7368, driver=0x7f1660 (BSDTCP))
1242993759.669442: amrecover: security_stream_close(0x83f7f50)
1242993770.528400: amrecover: user command: 'listhost'
1242993775.592808: amrecover: user command: 'sethost FEDBOX'
1242993782.081216: amrecover: user command: 'listdisk'
1242993789.057693: amrecover: user command: 'setdisk //WINBOX/c$/Inetpub'
1242993789.978937: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/"
1242993797.129966: amrecover: user command: 'ls'
1242993801.354136: amrecover: user command: 'cd Inetpub'
1242993801.354212: amrecover: cd_glob (Inetpub) -> ^Inetpub$
1242993801.426933: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/AdminScripts/"
1242993801.426978: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/AdminScripts_cp2nt/"
1242993801.426999: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/Tomcat41/"
1242993801.427019: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/catalog.wci/"
1242993801.427038: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/ftproot/"
1242993801.427057: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/mailroot/"
1242993801.427075: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/mailroot_cp2nt/"
1242993801.427094: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/nntpfile/"
1242993801.427113: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/scripts/"
1242993801.427131: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/test2009/"
1242993801.427148: amrecover: add_dir_list_item: Adding "2009-05-20-15-31-25" "1" "DailySet1-05:13" "13" "/Inetpub/wwwroot/"
1242993805.842609: amrecover: user command: 'add test2009'
1242993805.842676: amrecover: add_glob (test2009) -> ^test2009$
1242993805.842732: amrecover: add_file: Looking for "test2009[/]*$"
1242993805.842757: amrecover: add_file: Converted path="test2009[/]*$" to path_on_disk="\/Inetpub/test2009[/]*$"
1242993805.842824: amrecover: add_file: Pondering ditem->path=/Inetpub/wwwroot/
1242993805.842964: amrecover: add_file: Pondering ditem->path=/Inetpub/test2009/
1242993805.872914: amrecover: add_file: (Successful) Added dir /Inetpub/test2009/ at date 2009-05-20-15-31-25
1242993805.872996: amrecover: add_file: Pondering ditem->path=/Inetpub/scripts/
1242993805.873080: amrecover: add_file: Pondering ditem->path=/Inetpub/nntpfile/
1242993805.873184: amrecover: add_file: Pondering ditem->path=/Inetpub/mailroot_cp2nt/
1242993805.873255: amrecover: add_file: Pondering ditem->path=/Inetpub/mailroot/
1242993805.873323: amrecover: add_file: Pondering ditem->path=/Inetpub/ftproot/
1242993805.873392: amrecover: add_file: Pondering ditem->path=/Inetpub/catalog.wci/
1242993805.873460: amrecover: add_file: Pondering ditem->path=/Inetpub/Tomcat41/
1242993805.873528: amrecover: add_file: Pondering ditem->path=/Inetpub/AdminScripts_cp2nt/
1242993805.873595: amrecover: add_file: Pondering ditem->path=/Inetpub/AdminScripts/
1242993810.562904: amrecover: user command: 'setmode smb'
1242993813.803058: amrecover: user command: 'extract'
1242993813.803465: amrecover: append_to_tapelist(tapelist=(nil), label='DailySet1-05', file=-1, partnum=-1, isafile=0)
1242993813.803505: amrecover: append_to_tapelist(tapelist=0x84108e0, label='DailySet1-05', file=13, partnum=-1, isafile=0)
1242993813.803586: amrecover: Checking with user before restoring into directory /root
1242993815.306891: amrecover: User prompt: 'Continue [?/Y/n]? '; response: 'y'
1242993815.306979: amrecover: append_to_tapelist(tapelist=(nil), label='DailySet1-05', file=-1, partnum=-1, isafile=0)
1242993815.306999: amrecover: append_to_tapelist(tapelist=0x8410b60, label='DailySet1-05', file=13, partnum=-1, isafile=0)
1242993815.307019: amrecover: Requesting tape DailySet1-05 from user
1242993815.907116: amrecover: User prompt: 'Continue [?/Y/n/s/d]? '; response: 'y'
1242993815.907174: amrecover: security_getdriver(name=bsdtcp) returns 0x7f1660
1242993815.907197: amrecover: security_handleinit(handle=0x8410118, driver=0x7f1660 (BSDTCP))
1242993815.907371: amrecover: security_streaminit(stream=0x84138c0, driver=0x7f1660 (BSDTCP))
1242993815.917106: amrecover: security_streaminit(stream=0x841b8f8, driver=0x7f1660 (BSDTCP))
1242993815.917144: amrecover: amidxtaped_streams[0].fd = 0x841b8f8
1242993815.917163: amrecover: security_streaminit(stream=0x8423930, driver=0x7f1660 (BSDTCP))
1242993815.917177: amrecover: amidxtaped_streams[1].fd = 0x8423930
1242993815.917191: amrecover: security_close(handle=0x8410118, driver=0x7f1660 (BSDTCP))
1242993815.917204: amrecover: security_stream_close(0x84138c0)
1242993823.225315: amrecover: Exec'ing /usr/bin/smbclient with arguments:
1242993823.225367: amrecover: smbclient
1242993823.225380: amrecover: -d0
1242993823.225392: amrecover: -Tx
1242993823.225404: amrecover: -
1242993823.225416: amrecover: ./Inetpub/test2009
1242993826.288441: amrecover: security_stream_seterr(0x841b8f8, EOF)
1242993826.335991: amrecover: security_stream_seterr(0x8423930, EOF)
1242993826.336040: amrecover: security_stream_close(0x8423930)
1242993826.336227: amrecover: security_stream_close(0x841b8f8)
1242993828.195870: amrecover: user command: 'exit'
1242993828.200153: amrecover: security_stream_close(0x8400fe8)
1242993828.200460: amrecover: pid 4177 finish time Fri May 22 14:03:48 2009

Don't know smbclient syntax, but i think there is something missing with it ...

Thank you for helping me ;)

May 22nd, 2009, 04:56 AM
amrecover require an exact match in the amandapass file, add the following line to /etc/amandapass:

//WINBOX/c$/Inetpub administrateur%XXXXXX DOMAIN.local

May 22nd, 2009, 05:04 AM
mhh, thanks, amrecover is more verbose now :

Extracting files using tape drive changer on host CERVIN.
Load tape DailySet1-05 now
Continue [?/Y/n/s/d]? y
Domain=[OURDOMAIN] OS=[Windows Server 2003 3790 Service Pack 1] Server=[Windows Server 2003 5.2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
Extractor child exited with status 1

and here is the amrecover.log
1242996871.039459: amrecover: security_stream_close(0x852e898)
1242996873.443376: amrecover: Exec'ing /usr/bin/smbclient with arguments:
1242996873.443427: amrecover: smbclient
1242996873.443440: amrecover: //WINBOX/c$/Inetpub
1242996873.443452: amrecover: XXXXX [<- It's really "xxxxx" in the file; it's not me ;)]
1242996873.443463: amrecover: administrateur%XXXXXX [<- and this one is the password of "administrateur"]
1242996873.443475: amrecover: -W
1242996873.443488: amrecover: OURDOMAIN
1242996873.443499: amrecover: -d0
1242996873.443511: amrecover: -Tx
1242996873.443523: amrecover: -
1242996873.443534: amrecover: ./Inetpub/test2009
1242996876.487045: amrecover: security_stream_seterr(0x85368d0, EOF)
1242996876.534982: amrecover: security_stream_seterr(0x853e908, EOF)
1242996876.535031: amrecover: security_stream_close(0x853e908)
1242996876.535221: amrecover: security_stream_close(0x85368d0)
1242996977.410297: amrecover: user command: 'exit'
1242996977.414593: amrecover: security_stream_close(0x851bfc0)
1242996977.414905: amrecover: pid 4461 finish time Fri May 22 14:56:17 2009

Looks better :)
I feel we are not far of the solution ...:rolleyes:

May 22nd, 2009, 05:19 AM
amrecover try to connect to the '//WINBOX/c$/Inetpub' share, which can't be valid.
amrecover doesn't understand subdir in the diskname. It is not going to works.

May 22nd, 2009, 05:33 AM
You mean that it would works if i create on WINBOX a share for the specific directory ?

May 22nd, 2009, 05:36 AM
Creating the share might works.

Or you can try the attached patch.

May 22nd, 2009, 06:00 AM
It seems that you're right:

smbclient //WINBOX/c$ -U administrateur%PASS -W DOMAIN -d0


smbclient //WINBOX/c$/Inetpub -U administrateur%PASS -W DOMAIN -d0


I'll explain that to my boss, on monday; he will decide ...

Thank you :)