FBBR – Troubleshooting – SMB – 6.x/Upto 7.0U3e
December 3, 2023
FBBR – Strict Certificate Validation
December 5, 2023
FBBR – Troubleshooting – SMB – 6.x/Upto 7.0U3e
December 3, 2023
FBBR – Strict Certificate Validation
December 5, 2023

FBBR – Troubleshooting – SMB – From 7.0U3f/8.x

Starting with 7.0U3f , vCenter uses smbclient to transfer the files.

Usage: smbclient [-?EgqBVNkPeC] [-?|--help] [--usage] [-R|--name-resolve=NAME-RESOLVE-ORDER] [-M|--message=HOST] [-I|--ip-address=IP] [-E|--stderr] [-L|--list=HOST] [-m|--max-protocol=LEVEL]
        [-T|--tar=<c|x>IXFvgbNan] [-D|--directory=DIR] [-c|--command=STRING] [-b|--send-buffer=BYTES] [-t|--timeout=SECONDS] [-p|--port=PORT] [-g|--grepable] [-q|--quiet] [-B|--browse]
        [-d|--debuglevel=DEBUGLEVEL] [-s|--configfile=CONFIGFILE] [-l|--log-basename=LOGFILEBASE] [-V|--version] [--option=name=value] [-O|--socket-options=SOCKETOPTIONS]
        [-n|--netbiosname=NETBIOSNAME] [-W|--workgroup=WORKGROUP] [-i|--scope=SCOPE] [-U|--user=USERNAME] [-N|--no-pass] [-k|--kerberos] [-A|--authentication-file=FILE]
        [-S|--signing=on|off|required] [-P|--machine-pass] [-e|--encrypt] [-C|--use-ccache] [--pw-nt-hash] service <password>

To list all the Shared folders

root@localhost [ ~ ]# /usr/bin/smbclient -L //192.168.7.5/  -U 'administrator%Password'
        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        backup          Disk
        C$              Disk      Default share
        F$              Disk      Default share
        IPC$            IPC       Remote IPC
        NETLOGON        Disk      Logon server share
        SYSVOL          Disk      Logon server share
        Users           Disk
SMB1 disabled -- no workgroup available

Alternatively, you can use the creds file to pass the credentials.

vi /root/creds
username=<username>
password=<password>
domain=<domain>
root@localhost [ ~ ]# /usr/bin/smbclient -L //10.27.34.229/ -A /root/creds
        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        backup          Disk
        C$              Disk      Default share
        F$              Disk      Default share
        IPC$            IPC       Remote IPC
        NETLOGON        Disk      Logon server share
        SYSVOL          Disk      Logon server share
        Users           Disk
SMB1 disabled -- no workgroup available

To list the contents of the folder,

/usr/bin/smbclient //<Backup_Server_IP>/<Share>/ --send-buffer 100M -A /root/creds -c "ls"

To list contents of all the folders, you can add the recuse on parameter.

/usr/bin/smbclient //<Backup_Server_IP>/<Share>/ --send-buffer 100M -A /root/creds -c "recurse on; ls"

To create a directory,

/usr/bin/smbclient //<Backup_Server_IP>/<Share>/ --send-buffer 100M -A /root/creds -c "recurse on; mkdir <Folder>/<Sub_Folder>;"

To change directory,

/usr/bin/smbclient //<backup_server_ip>/<smb_share_name> -A /root/creds -c "cd <Folder>/<Sub_Folder>; ls"

To put a File in the directory,

/usr/bin/smbclient //<backup_server_ip>/<smb_share_name> -A /root/creds -c "recurse on; cd <Folder>/<Sub_Folder>; put test.txt"

To troubleshoot retention, delete the directory.

/usr/bin/smbclient //<backup_server_ip>/<smb_share_name> -A /root/creds -c "deltree <Folder>/<Sub_Folder>"

Get the Available space on the volume

/usr/bin/smbclient //192.168.7.5/backup/ --send-buffer 100M -A /root/creds -c "ls"
In this example,
10357247 blocks of size 4096. 2306399 blocks available

4096 = Block Size in bytes
4313621 = Blocks available

Total free bytes = 4096 x 2306399
= 17668591616 bytes
= 17.6GB free

Using Interactive mode

SMB Client can be used in Interactive mode to test the SMB functionality.

/usr/bin/smbclient //<Backup_Server_IP>/<Folder>/ -U <username>

You can use all the linux commands

smb: \> ls
smb: \> mkdir Test
smb: \> cd Test
smb: \> put Test.txt
smb: \> get Test.txt
smb: \> deltree Test

In the Series:

Leave a Reply

Your email address will not be published. Required fields are marked *