我将 SATA2 HDD 换成 SATA2 固态硬盘后,ubuntu 18.04 运行缓慢

我将 SATA2 HDD 换成 SATA2 固态硬盘后,ubuntu 18.04 运行缓慢

最近我用 SSD 替换了我的内置 HDD,从那时起我的代码执行就很慢。

以前执行大约需要 5 秒钟,现在则需要大约 10 分钟。

当我从 grub 执行 fsck 时,显示以下结果:

文件系统检查

$ sudo blkid
[sudo] password for shivaksingh: 
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda1: LABEL="System Reserved" UUID="648A5D678A5D36B0" TYPE="ntfs" PARTUUID="e2cbf64a-01"
/dev/sda2: UUID="B20C5F560C5F1527" TYPE="ntfs" PARTUUID="e2cbf64a-02"
/dev/sda5: UUID="1c96a5ea-42e4-4188-89fc-26aa4cb9b5fe" TYPE="ext4" PARTUUID="e2cbf64a-05"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda5 during installation
UUID=1c96a5ea-42e4-4188-89fc-26aa4cb9b5fe /               ext4    errors=remount-ro 0       1
/swapfile                                 none            swap    sw

$ free -h
          total        used        free      shared  buff/cache  available
Mem:           7.7G        1.2G        5.6G        239M        963M        6.0G
Swap:          2.0G          0B        2.0G

$ swapon
NAME      TYPE SIZE USED PRIO
/swapfile file   2G   0B   -2

$ sudo fdisk -l
Disk /dev/loop0: 2.3 MiB, 2355200 bytes, 4600 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: 34.8 MiB, 36503552 bytes, 71296 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: 140.7 MiB, 147496960 bytes, 288080 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: 3.7 MiB, 3878912 bytes, 7576 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: 14.5 MiB, 15208448 bytes, 29704 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: 13 MiB, 13619200 bytes, 26600 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: 128.5 MiB, 134746112 bytes, 263176 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: 7.5 MiB, 7811072 bytes, 15256 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/sda: 232.9 GiB, 250059350016 bytes, 488397168 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
Disklabel type: dos
Disk identifier: 0xe2cbf64a

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048    206847    204800   100M  7 HPFS/NTFS/exFAT
/dev/sda2          206848 262252825 262045978   125G  7 HPFS/NTFS/exFAT
/dev/sda3       262254590 488396799 226142210 107.9G  5 Extended
/dev/sda5       262254592 488396799 226142208 107.9G 83 Linux




Disk /dev/loop8: 140.7 MiB, 147496960 bytes, 288080 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/loop9: 34.6 MiB, 36216832 bytes, 70736 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: 91 MiB, 95408128 bytes, 186344 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: 91 MiB, 95416320 bytes, 186360 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

答案1

要检查 Ubuntu 18.xx 分区上的文件系统...

  • 启动至 Ubuntu Live DVD/USB
  • 打开terminal窗户
  • 类型sudo fdisk -l
  • 识别“Linux 文件系统”的 /dev/XXXX 设备名称
  • 输入sudo fsck -f /dev/XXXX# 用你之前找到的数字替换 XXXX
  • 如果有错误,请重复 fsck 命令
  • 类型reboot

更新#1:

来自评论...

我们决定最好使用 GPT 分区表重建系统磁盘,并全新安装 Windows 和 Ubuntu。备份失败和用户代码运行缓慢的问题已得到解决。

相关内容