20241116解决在WIN11和ubuntu20.04通过samba共享时出现局域网千兆带宽拉满的情况
 2024/11/16 13:42
缘起:最近需要通过iperf3打流,因此在ubuntu20.04服务器上常开sudo nethogs监控流量。
 但是发现一个异常,ubuntu20.04服务器上发送的流量过大!

 定位问题:只要将win11和ubuntu20.04服务器的samba共享已断开,ubuntu20.04服务器上的send流量马上恢复正常。
 基本确定为samba服务器的问题。
ubuntu20.04服务器上是 WIN10和ubuntu20.04双系统。
 win10和ubuntu20.04都安装在512GB的SSD固态硬盘上。
ubuntu20.04服务器 挂一个3TB的HDD机械硬盘作为/home目录,ext4分区。硬盘是新的。
 WIN10挂两个淘宝/PDD拼多多的2个2手12T硬盘。
现在主要怀疑:
 1、二手硬盘,质量不可靠,可能挂掉了。
2、2手12T硬盘的NTFS分区异常了。
 定位过程:
 首先,需要将ubuntu20.04服务器上的压缩包腾空间到WIN10的2手12T硬盘上。发现2个2手12T硬盘都是只读状态,不可写!



 WIN10下的磁盘修复过程:
Microsoft Windows [版本 10.0.19045.5011]
 (c) Microsoft Corporation。保留所有权利。
C:\Windows\system32>chkdsk d:/f
 文件系统的类型是 NTFS。
 卷标是 SEAG12T。
阶段 1: 检查基本文件系统结构...
   已处理 332544 个文件记录。
 文件验证完成。
  阶段持续时间 (文件记录验证): 10.16 秒。
   已处理 6270 个大型文件记录。
  阶段持续时间 (孤立文件记录恢复): 0.00 毫秒。
   已处理 0 个错误的文件记录。
  阶段持续时间 (文件记录检查错误): 0.56 毫秒。
阶段 2: 检查文件名链接...
   已处理 886 个重新解析记录。
   已处理 360836 个索引项。
 索引验证完成。
  阶段持续时间 (索引验证): 11.61 秒。
   已扫描到 0 个未索引文件。
  阶段持续时间 (孤立文件重新连接): 162.11 毫秒。
   已将 0 个未编制索引的文件恢复到回收箱。
  阶段持续时间 (孤立文件恢复到回收箱): 14.34 毫秒。
   已处理 886 个重新解析记录。
  阶段持续时间 (重分析点和对象 ID 验证): 7.01 毫秒。
阶段 3: 检查安全描述符...
 安全描述符验证完成。
  阶段持续时间 (安全描述符验证): 11.15 毫秒。
   已处理 14146 个数据文件。
  阶段持续时间 (数据属性验证): 0.68 毫秒。
Windows 已扫描文件系统并且没有发现问题。
 无需采取进一步操作。
总磁盘空间为   11444205 MB。
 311519 个文件中有   10554974 MB。
 14148 个索引      91200 KB。
 坏扇区          0 KB。
 系统正在使用     771843 KB。
 日志文件占用了      65536 KB。
 磁盘上  909710504 KB 可用。
每个分配单元中有       4096 字节。
 磁盘上共有 2929716735 个分配单元。
 磁盘上有  227427626 个可用的分配单元。
 总持续时间: 21.99 秒 (21990 毫秒)。
C:\Windows\system32>chkdsk e:/f
 文件系统的类型是 NTFS。
 卷标是 新加卷。
阶段 1: 检查基本文件系统结构...
   已处理 283392 个文件记录。
 文件验证完成。
  阶段持续时间 (文件记录验证): 10.41 秒。
   已处理 4973 个大型文件记录。
  阶段持续时间 (孤立文件记录恢复): 0.00 毫秒。
   已处理 0 个错误的文件记录。
  阶段持续时间 (文件记录检查错误): 1.87 毫秒。
阶段 2: 检查文件名链接...
   已处理 667 个重新解析记录。
   已处理 303068 个索引项。
 索引验证完成。
  阶段持续时间 (索引验证): 9.66 秒。
   已扫描到 0 个未索引文件。
  阶段持续时间 (孤立文件重新连接): 122.35 毫秒。
   已将 0 个未编制索引的文件恢复到回收箱。
  阶段持续时间 (孤立文件恢复到回收箱): 1.87 毫秒。
   已处理 667 个重新解析记录。
  阶段持续时间 (重分析点和对象 ID 验证): 12.02 毫秒。
阶段 3: 检查安全描述符...
 安全描述符验证完成。
  阶段持续时间 (安全描述符验证): 7.45 毫秒。
   已处理 9838 个数据文件。
  阶段持续时间 (数据属性验证): 0.56 毫秒。
Windows 已扫描文件系统并且没有发现问题。
 无需采取进一步操作。
总磁盘空间为   11444205 MB。
 150799 个文件中有   10881486 MB。
 9840 个索引      46304 KB。
 坏扇区          0 KB。
 系统正在使用     712383 KB。
 日志文件占用了      65536 KB。
 磁盘上  575465604 KB 可用。
每个分配单元中有       4096 字节。
 磁盘上共有 2929716735 个分配单元。
 磁盘上有  143866401 个可用的分配单元。
 总持续时间: 20.24 秒 (20240 毫秒)。
C:\Windows\system32>
 ubuntu20.04服务器上查看 硬盘挂载 情况的LOG:
Connecting to 192.168.3.221:22...
 Connection established.
 To escape to local shell, press 'Ctrl+Alt+]'.
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-122-generic x86_64)
 * Documentation:  https://help.ubuntu.com
  * Management:     https://landscape.canonical.com
  * Support:        https://ubuntu.com/advantage
 * Introducing Expanded Security Maintenance for Applications.
    Receive updates to over 25,000 software packages with your
    Ubuntu Pro subscription. Free for personal use.
https://ubuntu.com/pro
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates.
 See https://ubuntu.com/esm or run: sudo pro status
 The list of available updates is more than a week old.
 To check for new updates run: sudo apt update
 New release '22.04.5 LTS' available.
 Run 'do-release-upgrade' to upgrade to it.
Your Hardware Enablement Stack (HWE) is supported until April 2025.
 Last login: Sat Nov 16 11:39:22 2024 from 192.168.3.90
 rootroot@rootroot-desktop:~$ sudo apt install ntfs-3g
 [sudo] password for rootroot: 
 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 ntfs-3g is already the newest version (1:2017.3.23AR.3-3ubuntu1.3).
 The following packages were automatically installed and are no longer required:
   chromium-codecs-ffmpeg-extra gstreamer1.0-vaapi libgstreamer-plugins-bad1.0-0 libva-wayland2
 Use 'sudo apt autoremove' to remove them.
 0 upgraded, 0 newly installed, 0 to remove and 61 not upgraded.
 rootroot@rootroot-desktop:~$ 
 rootroot@rootroot-desktop:~$ 
 rootroot@rootroot-desktop:~$ 
 rootroot@rootroot-desktop:~$ fdisk -l
 fdisk: cannot open /dev/loop0: Permission denied
 fdisk: cannot open /dev/loop1: Permission denied
 fdisk: cannot open /dev/loop2: Permission denied
 fdisk: cannot open /dev/loop3: Permission denied
 fdisk: cannot open /dev/loop4: Permission denied
 fdisk: cannot open /dev/loop5: Permission denied
 fdisk: cannot open /dev/loop6: Permission denied
 fdisk: cannot open /dev/loop7: Permission denied
 fdisk: cannot open /dev/nvme0n1: Permission denied
 fdisk: cannot open /dev/sda: Permission denied
 fdisk: cannot open /dev/sdb: Permission denied
 fdisk: cannot open /dev/sdc: Permission denied
 fdisk: cannot open /dev/loop9: Permission denied
 fdisk: cannot open /dev/loop8: Permission denied
 fdisk: cannot open /dev/loop10: Permission denied
 fdisk: cannot open /dev/loop11: Permission denied
 fdisk: cannot open /dev/loop12: Permission denied
 rootroot@rootroot-desktop:~$ 
 rootroot@rootroot-desktop:~$ sudo fdisk -l
 Disk /dev/loop0: 4 KiB, 4096 bytes, 8 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop1: 63.10 MiB, 67080192 bytes, 131016 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop2: 74.25 MiB, 77852672 bytes, 152056 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop3: 38.85 MiB, 40714240 bytes, 79520 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop4: 38.75 MiB, 40615936 bytes, 79328 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop5: 12.2 MiB, 12791808 bytes, 24984 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop6: 91.7 MiB, 96141312 bytes, 187776 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop7: 73.9 MiB, 77463552 bytes, 151296 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/nvme0n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
 Disk model: HFM512GD3JX013N                         
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disklabel type: gpt
 Disk identifier: F5348D3F-2352-4369-85F4-53F16394F765
Device             Start        End   Sectors   Size Type
 /dev/nvme0n1p1      2048     206847    204800   100M EFI System
 /dev/nvme0n1p2    206848     239615     32768    16M Microsoft reserved
 /dev/nvme0n1p3    239616  818643196 818403581 390.3G Microsoft basic data
 /dev/nvme0n1p4 818644992  819314687    669696   327M EFI System
 /dev/nvme0n1p5 999002112 1000212479   1210368   591M Windows recovery environment
 /dev/nvme0n1p6 819314688  820291583    976896   477M Linux filesystem
 /dev/nvme0n1p7 820291584  851542015  31250432  14.9G Linux swap
 /dev/nvme0n1p8 851542016  999002111 147460096  70.3G Linux filesystem
Partition table entries are not in disk order.
 Disk /dev/sda: 10.94 TiB, 12000138625024 bytes, 23437770752 sectors
 Disk model: HUH721212ALE601 
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
 I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 Disklabel type: gpt
 Disk identifier: 5730557A-67F7-4B4A-AEC2-03C2000671B1
Device     Start         End     Sectors  Size Type
 /dev/sda1     34       32767       32734   16M Microsoft reserved
 /dev/sda2  32768 23437766655 23437733888 10.9T Microsoft basic data
Partition 1 does not start on physical sector boundary.
 Disk /dev/sdb: 2.75 TiB, 3000592982016 bytes, 5860533168 sectors
 Disk model: TOSHIBA HDWD130 
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
 I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 Disklabel type: gpt
 Disk identifier: 43DF21A7-EB07-4A01-9EB4-228A6DFBC379
Device     Start        End    Sectors  Size Type
 /dev/sdb1   2048 5860532223 5860530176  2.7T Linux filesystem
 Disk /dev/sdc: 10.94 TiB, 12000138625024 bytes, 23437770752 sectors
 Disk model: HUH721212ALE601 
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 4096 bytes
 I/O size (minimum/optimal): 4096 bytes / 4096 bytes
 Disklabel type: gpt
 Disk identifier: FD242757-266D-431A-B7FC-354B2B252AA6
Device     Start         End     Sectors  Size Type
 /dev/sdc1     34       32767       32734   16M Microsoft reserved
 /dev/sdc2  32768 23437766655 23437733888 10.9T Microsoft basic data
Partition 1 does not start on physical sector boundary.
 Disk /dev/loop9: 505.9 MiB, 529625088 bytes, 1034424 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop8: 12.95 MiB, 13553664 bytes, 26472 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop10: 346.34 MiB, 363151360 bytes, 709280 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop11: 349.71 MiB, 366682112 bytes, 716176 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 Disk /dev/loop12: 63.71 MiB, 66789376 bytes, 130448 sectors
 Units: sectors of 1 * 512 = 512 bytes
 Sector size (logical/physical): 512 bytes / 512 bytes
 I/O size (minimum/optimal): 512 bytes / 512 bytes
 rootroot@rootroot-desktop:~$ 
 rootroot@rootroot-desktop:~$ sudo ntfsfix /dev/sda
 Mounting volume... NTFS signature is missing.
 FAILED
 Attempting to correct errors... NTFS signature is missing.
 FAILED
 Failed to startup volume: Invalid argument
 NTFS signature is missing.
 Trying the alternate boot sector
 Unrecoverable error
 Volume is corrupt. You should run chkdsk.
 rootroot@rootroot-desktop:~$ Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.3.221) at 12:10:41.
Type `help' to learn how to use Xshell prompt.
 [C:\~]$ 
Connecting to 192.168.3.221:22...
 Connection established.
 To escape to local shell, press 'Ctrl+Alt+]'.
Welcome to Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-122-generic x86_64)
 * Documentation:  https://help.ubuntu.com
  * Management:     https://landscape.canonical.com
  * Support:        https://ubuntu.com/advantage
 * Introducing Expanded Security Maintenance for Applications.
    Receive updates to over 25,000 software packages with your
    Ubuntu Pro subscription. Free for personal use.
https://ubuntu.com/pro
Expanded Security Maintenance for Applications is not enabled.
0 updates can be applied immediately.
Enable ESM Apps to receive additional future security updates.
 See https://ubuntu.com/esm or run: sudo pro status
 The list of available updates is more than a week old.
 To check for new updates run: sudo apt update
 New release '22.04.5 LTS' available.
 Run 'do-release-upgrade' to upgrade to it.
Your Hardware Enablement Stack (HWE) is supported until April 2025.
 Last login: Sat Nov 16 12:08:54 2024 from 192.168.3.90
 rootroot@rootroot-desktop:~$ 





![[ACTF2020]Upload 1--详细解析](https://i-blog.csdnimg.cn/direct/3edab97542de4610876a9b9a036b010e.png)













