Applicable products
- NAS models running QTS / QuTS hero
Scenario
When SMB connection issues occur, such as the service working only briefly after a reboot, inability to connect to shared folders, or interrupted file transfers, capturing Samba debug logs can help you and QNAP technical support diagnose the root cause.
Common symptoms include:
- SMB service works only briefly after NAS reboot
- Windows or Mac cannot connect to NAS shared folders
- Connection is established but transfers are interrupted
- HTTP interface works but SMB is inaccessible
Details
Samba log file locations
Samba log file locations vary depending on the firmware version and operation mode.
QTS/QuTS hero 5.2.x and earlier versions
| Operation mode | Log file path |
|---|
| Standalone | /share/CACHEDEV1_DATA/.samba/var/log.winbindd*
/share/CACHEDEV1_DATA/.samba/var/log.wb*
/var/log/log.smbd.wspd*
/var/log/log.smbd*
/var/log/log.nmbd* |
| AD member | /share/CACHEDEV1_DATA/.samba/var/log.winbind*
/share/CACHEDEV1_DATA/.samba/var/log.wb*
/var/log/log.smbd.wspd*
/var/log/log.smbd*
/var/log/log.nmbd* |
| DC (domain controller) | /share/CACHEDEV1_DATA/.samba_target/var/log.samba*
/share/CACHEDEV1_DATA/.samba_target/var/log.smbd*
/share/CACHEDEV1_DATA/.samba_target/var/log.winbindd*
/share/CACHEDEV1_DATA/.samba_target/var/log.wb*
/share/CACHEDEV1_DATA/.samba_target/var/log.wspd* |
QTS/QuTS hero 5.3.x and later versions
| Operation mode | Log file path |
|---|
| Standalone | /var/log/smb_a/log.smbd*
/var/log/smb_a/log.nmbd*
/var/log/smb_a/log.winbindd*
/var/log/smb_a/log.wb*
/var/log/smb_a/log.smbd.wspd* |
| AD member | /var/log/smb_a/log.smbd*
/var/log/smb_a/log.nmbd*
/var/log/smb_a/log.winbindd*
/var/log/smb_a/log.wb*
/var/log/smb_a/log.smbd.wspd* |
| DC (domain controller) | /mnt/ext/opt/samba/var/log.smbd*
/mnt/ext/opt/samba/var/log.winbindd*
/mnt/ext/opt/samba/var/log.samba*
/mnt/ext/opt/samba/var/log.wb*
/mnt/ext/opt/samba/var/log.wspd* |
Procedure
For Advanced Users Only: This article involves SSH access and command-line operations. Incorrect modifications to system files may cause service disruptions or system instability. Proceed only if you are comfortable with these operations.
Step 1: Enable SSH
- Log in to QTS / QuTS hero with an administrator account.
- Go to Control Panel > Network & File Services > Telnet / SSH.
- Select Allow SSH connection.
- Set the port number (default: 22).
- Click Apply.
Step 2: Connect to the NAS using SSH
Use PuTTY (Windows) or Terminal (Mac/Linux) to connect:
ssh admin@<NAS_IP>
Step 3: Increase the Samba log level (enable debug mode)
Run the following command to increase the log level to 10 (most detailed):
QTS/QuTS hero 5.2.x and earlier versions:
/usr/local/samba/bin/smbcontrol -s /etc/config/smb.conf smbd debug 10
QTS/QuTS hero 5.3.x and later versions:
/usr/local/samba/bin/smbcontrol -s /etc/config.local/smb_a.conf smbd debug 10
Tip: This is a dynamic adjustment that takes effect immediately without restarting the service.
Warning: Enabling debug logging for an extended period may generate a large volume of logs that can fill up the system partition. If you need to capture debug logs over a longer period, you can temporarily redirect debug logs to a data volume.
Optional: Change log storage location
If you need to output logs directly to a shared folder for easier collection, you can temporarily change the log storage path.
QTS/QuTS hero 5.2.x and earlier versions
Edit /etc/config/smb.sh and find the following line. Change the path after -l to a shared folder:
/sbin/daemon_mgr smbd start "${smbd_bin} -l /var/log -D -s $CONFIG"
Change it to, for example:
/sbin/daemon_mgr smbd start "${smbd_bin} -l /share/Public -D -s $CONFIG"
QTS/QuTS hero 5.3.x and later versions
Edit /etc/init.d/smb_a.sh and find the following global variable:
SMB_LOG_PATH="/var/log/smb_a"
Change it to, for example:
SMB_LOG_PATH="/share/Public/smb_log"
Warning: Back up the original file before modifying system scripts. These settings may be reset after a reboot.
Step 4: Reproduce the issue
Perform the operations that trigger the issue (for example, connecting to a NAS shared folder from Windows) so that the system can record the relevant logs.
Step 5: Collect log files
Based on your firmware version and operation mode, navigate to the corresponding path to collect log files.
Example (QTS/QuTS hero 5.3.x standalone mode):
# Copy logs to a shared folder
cp /var/log/smb_a/log.smbd* /share/Public/
cp /var/log/smb_a/log.nmbd* /share/Public/
Download the log files from /share/Public/ via File Station or an SMB connection.
Step 6: Restore the log level (after troubleshooting)
Reset the log level to the default value (1):
QTS/QuTS hero 5.2.x and earlier versions:
/usr/local/samba/bin/smbcontrol -s /etc/config/smb.conf smbd debug 1
QTS/QuTS hero 5.3.x and later versions:
/usr/local/samba/bin/smbcontrol -s /etc/config.local/smb_a.conf smbd debug 1
Important notes
- Enabling a high log level (such as 10) generates a large volume of logs and may affect NAS performance. Use this setting only during troubleshooting.
- Always reset the log level to the default value after troubleshooting is complete.
- If you modified the log storage location, restore the original settings after troubleshooting is complete.
Technical support escalation checklist
When contacting QNAP technical support, prepare the following information and files:
- NAS model name
- Firmware version (QTS/QuTS hero version number)
- Samba log files (collected based on operation mode)
- Timestamp of when the issue occurred
- Client operating system version
- Network topology (for example, direct connection, switch, or router)
- Steps to reproduce the issue
Further reading
适用产品
- 运行 QTS / QuTS hero 的 NAS 型号
场景
当出现 SMB 连接问题时,例如服务在重启后仅短暂工作、无法连接到共享文件夹或文件传输中断,捕获 SAMBA 调试日志可以帮助您和 QNAP 技术支持诊断根本原因。
常见症状包括:
- SMB 服务在 NAS 重启后仅短暂工作
- Windows 或 Mac 无法连接到 NAS 共享文件夹
- 连接已建立但传输中断
- HTTP 接口正常但 SMB 无法访问
详细信息
SAMBA 日志文件位置
SAMBA 日志文件位置因固件版本和操作模式而异。
QTS/QuTS hero 5.2.x 及更早版本
| 操作模式 | 日志文件路径 |
|---|
| 独立模式 | /share/CACHEDEV1_DATA/.SAMBA/var/log.winbindd*
/share/CACHEDEV1_DATA/.SAMBA/var/log.wb*
/var/log/log.smbd.wspd*
/var/log/log.smbd*
/var/log/log.nmbd* |
| AD 成员 | /share/CACHEDEV1_DATA/.SAMBA/var/log.winbind*
/share/CACHEDEV1_DATA/.SAMBA/var/log.wb*
/var/log/log.smbd.wspd*
/var/log/log.smbd*
/var/log/log.nmbd* |
| DC (域控制器) | /share/CACHEDEV1_DATA/.SAMBA_target/var/log.SAMBA*
/share/CACHEDEV1_DATA/.SAMBA_target/var/log.smbd*
/share/CACHEDEV1_DATA/.SAMBA_target/var/log.winbindd*
/share/CACHEDEV1_DATA/.SAMBA_target/var/log.wb*
/share/CACHEDEV1_DATA/.SAMBA_target/var/log.wspd* |
QTS/QuTS hero 5.3.x 及更高版本
| 操作模式 | 日志文件路径 |
|---|
| 独立模式 | /var/log/smb_a/log.smbd*
/var/log/smb_a/log.nmbd*
/var/log/smb_a/log.winbindd*
/var/log/smb_a/log.wb*
/var/log/smb_a/log.smbd.wspd* |
| AD 成员 | /var/log/smb_a/log.smbd*
/var/log/smb_a/log.nmbd*
/var/log/smb_a/log.winbindd*
/var/log/smb_a/log.wb*
/var/log/smb_a/log.smbd.wspd* |
| DC (域控制器) | /mnt/ext/opt/SAMBA/var/log.smbd*
/mnt/ext/opt/SAMBA/var/log.winbindd*
/mnt/ext/opt/SAMBA/var/log.SAMBA*
/mnt/ext/opt/SAMBA/var/log.wb*
/mnt/ext/opt/SAMBA/var/log.wspd* |
步骤
仅限优异用户:本文涉及 SSH 访问和命令行操作。不正确的系统文件修改可能导致服务中断或系统不稳定。仅在您对这些操作感到熟悉时继续。
步骤 1:启用 SSH
- 使用管理员账户登录 QTS / QuTS hero。
- 转到控制台 > 网络和文件服务 > Telnet / SSH。
- 选择允许 SSH 连接。
- 设置端口号(默认:22)。
- 点击应用。
步骤 2:使用 SSH 连接到 NAS
使用 PuTTY(Windows)或终端(Mac/Linux)进行连接:
ssh admin@<nas_ip>
步骤 3:提高 SAMBA 日志级别(启用调试模式)
运行以下命令将日志级别提高到 10(较详细):
QTS/QuTS hero 5.2.x 及更早版本:
/usr/local/SAMBA/bin/smbcontrol -s /etc/config/smb.conf smbd debug 10
QTS/QuTS hero 5.3.x 及更高版本:
/usr/local/SAMBA/bin/smbcontrol -s /etc/config.local/smb_a.conf smbd debug 10
提示:这是一个动态调整,无需重启服务即可立即生效。
警告:长时间启用调试日志可能会生成大量日志,填满系统分区。如果需要长时间捕获调试日志,可以暂时将调试日志重定向到数据卷。
可选:更改日志存储位置
如果需要将日志直接输出到共享文件夹以便于收集,可以暂时更改日志存储路径。
QTS/QuTS hero 5.2.x 及更早版本
编辑/etc/config/smb.sh并找到以下行。将-l后的路径更改为共享文件夹:
/sbin/daemon_mgr smbd start "${smbd_bin} -l /var/log -D -s $CONFIG"
将其更改为,例如:
/sbin/daemon_mgr smbd start "${smbd_bin} -l /share/Public -D -s $CONFIG"
QTS/QuTS hero 5.3.x 及更高版本
编辑/etc/init.d/smb_a.sh并找到以下全局变量:
SMB_LOG_PATH="/var/log/smb_a"
将其更改为,例如:
SMB_LOG_PATH="/share/Public/smb_log"
警告:修改系统脚本前请备份原文件。这些设置可能会在重启后重置。
步骤 4:重现问题
执行触发问题的操作(例如,从 Windows 连接到 NAS 共享文件夹),以便系统记录相关日志。
步骤 5:收集日志文件
根据您的固件版本和操作模式,导航到相应路径以收集日志文件。
示例(QTS/QuTS hero 5.3.x 独立模式):
# 将日志复制到共享文件夹
cp /var/log/smb_a/log.smbd* /share/Public/
cp /var/log/smb_a/log.nmbd* /share/Public/
通过 File Station 或 SMB 连接从/share/Public/下载日志文件。
步骤 6:恢复日志级别(故障排除后)
将日志级别重置为默认值(1):
QTS/QuTS hero 5.2.x 及更早版本:
/usr/local/SAMBA/bin/smbcontrol -s /etc/config/smb.conf smbd debug 1
QTS/QuTS hero 5.3.x 及更高版本:
/usr/local/SAMBA/bin/smbcontrol -s /etc/config.local/smb_a.conf smbd debug 1
重要注释
- 启用较高的日志级别(如 10)会生成大量日志,可能影响 NAS 性能。仅在故障排除期间使用此设置。
- 故障排除完成后,请始终将日志级别重置为默认值。
- 如果您修改了日志存储位置,请在故障排除完成后恢复原始设置。
技术支持升级检查清单
联系 QNAP 技术支持时,请准备以下信息和文件:
- NAS 型号名称
- 固件版本(QTS/QuTS hero 版本号)
- SAMBA 日志文件(根据操作模式收集)
- 问题发生的时间戳
- 客户端操作系统版本
- 网络拓扑(例如,直接连接、交换机或路由器)
- 重现问题的步骤
进一步阅读