部分答案...正在进行中...

部分答案...正在进行中...

我有以下输出,我的 ubuntu 启动非常慢。启动需要 2-3 分钟,而 Windows 只需要 15 秒。这里是 journalctl 的输出: http://paste.ubuntu.com/24706296/

如果有人能帮助我那就太好了,因为我真的很想快速启动到 ubuntu。

我的所有内容都在 SSD (/) 上,但只有 /var 和 /home 在 hdd 上。

编辑:

sudo blkid:

/dev/sda1: LABEL="Wiederherstellung" UUID="1E5EB9035EB8D4AD" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="daad9650-8cde-491d-80db-7dda8e1874c0"
/dev/sda2: UUID="56B9-5488" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="419f5006-cb88-4fcc-9b5e-39ca6d657edb"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="e924079c-0c0c-4157-b82d-85f0a8ef5e8c"
/dev/sda4: UUID="6862CAA762CA78F8" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="4c2eb33b-8ea1-4c7e-9c72-25c490d407ce"
/dev/sda5: UUID="76A07C5BA07C2431" TYPE="ntfs" PARTUUID="887bbacf-c0e9-44b0-bf46-1385b114068b"
/dev/sda6: UUID="c89b4926-af5a-416a-b61a-006aaa34a3cc" TYPE="ext4" PARTUUID="abab0c8d-8d6e-4529-8d94-1a88d0900861"
/dev/sda7: UUID="69152b87-29d1-410d-a49b-b31e1e9885f4" TYPE="swap" PARTUUID="7d94acf0-a66c-44d4-ba94-d3cd4ca6a31b"
/dev/sdb1: PARTLABEL="Microsoft reserved partition" PARTUUID="bdc2d24e-e974-441f-b190-b8b285579f87"
/dev/sdb2: LABEL="Volume" UUID="1A4A64574A643225" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="ec522179-fc5b-4406-a029-1036e2e1df7c"
/dev/sdb3: UUID="da267417-9a48-45a2-a3e2-2bc62163003a" TYPE="ext4" PARTUUID="8c1e23df-5f97-44f8-a344-3fb713b13bf6"
/dev/sdb4: UUID="f2362bd0-5a3d-4e0f-b915-d7ab299d0be9" TYPE="ext4" PARTUUID="c85406d4-71fc-46f6-a9c4-a4f76b2cc185"

猫/ 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/sda6 during installation
UUID=c89b4926-af5a-416a-b61a-006aaa34a3cc /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=56B9-5488  /boot/efi       vfat    umask=0077      0       1
# /home was on /dev/sdb4 during installation
UUID=f2362bd0-5a3d-4e0f-b915-d7ab299d0be9 /home           ext4    defaults        0       2
# /var was on /dev/sdb3 during installation
UUID=da267417-9a48-45a2-a3e2-2bc62163003a /var            ext4    defaults        0       2
/swapfile                                 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0

免费-h:

              total        used        free      shared  buff/cache   available
Mem:           7,7G        2,8G        121M         92M        4,8G        4,5G
Swap:          7,8G          0B        7,8G

uwe@loopy-ubuntu:~$ swapon

NAME      TYPE      SIZE USED PRIO
/dev/sda7 partition 7,8G   0B   -1

uwe@loopy-ubuntu:~$ ls -al /

total 1541232
drwxr-xr-x  24 root root       4096 Mai 29 08:00 .
drwxr-xr-x  24 root root       4096 Mai 29 08:00 ..
drwxr-xr-x   2 root root       4096 Mai 29 08:00 bin
drwxr-xr-x   4 root root       4096 Mai 29 00:07 boot
drwxr-xr-x   2 root root       4096 Mai 28 23:02 cdrom
drwxr-xr-x  20 root root       4480 Mai 30 11:52 dev
drwxr-xr-x 139 root root      12288 Mai 29 21:38 etc
drwxr-xr-x   5 root root       4096 Mai 28 23:02 home
lrwxrwxrwx   1 root root         33 Mai 29 00:04 initrd.img -> boot/initrd.img-4.10.0-22-generic
drwxr-xr-x  25 root root       4096 Mai 29 00:24 lib
drwxr-xr-x   2 root root       4096 Mai 29 00:06 lib32
drwxr-xr-x   2 root root       4096 Apr 12 05:06 lib64
drwx------   2 root root      16384 Mai 28 22:51 lost+found
drwxr-xr-x   3 root root       4096 Mai 29 08:00 media
drwxr-xr-x   2 root root       4096 Apr 12 05:06 mnt
dr-xr-xr-x 325 root root          0 Mai 30 11:50 proc
drwx------   3 root root       4096 Apr 12 05:17 root
drwxr-xr-x  30 root root        940 Mai 30 11:56 run
drwxr-xr-x   2 root root      12288 Mai 29 00:06 sbin
drwxr-xr-x   2 root root       4096 Apr  6 10:32 snap
drwxr-xr-x   2 root root       4096 Apr 12 05:06 srv
-rw-------   1 root root 1578106880 Mai 28 23:01 swapfile
dr-xr-xr-x  13 root root          0 Mai 30 11:58 sys
drwxrwxrwt  19 root root       4096 Mai 30 11:56 tmp
drwxr-xr-x  11 root root       4096 Mai 29 00:06 usr
drwxr-xr-x  15 root root       4096 Apr 12 05:18 var
lrwxrwxrwx   1 root root         30 Mai 29 00:04 vmlinuz -> boot/vmlinuz-4.10.0-22-generic

新的 ls -alh /swapfile:

-rw------- 1 root root 4,0G 5月30日 22:40 /swapfile

uwe@loopy-ubuntu:~$ free -h 总共已用 空闲 共享 buff/cache 可用 内存:7,7G 3,7G 1,3G 129M 2,8G 3,7G 交换:4,0G 0B 4,0G

journalctl:uwe@loopy-ubuntu:~$ journalctl --boot | pastebinit http://paste.ubuntu.com/24737809/

我自己创建了交换文件。 http://paste.ubuntu.com/24737883/

答案1

部分答案...正在进行中...

步骤1:

您的 SSD 上可能存在某些磁盘损坏。

让我们首先检查您的文件系统是否有错误。

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

  • 启动到 GRUB 菜单
  • 选择高级选项
  • 选择恢复模式
  • 选择 Root 访问
  • 在 # 提示符下,输入sudo fsck -f /
  • 如果有错误,请重复 fsck 命令
  • 类型reboot

步骤#2:在我告诉你之前不要这么做

现在我们开始修复你的 /swapfile 问题。

編輯您的/etc/fstab...

gksudo gedit /etc/fstab

更改此行:

/swapfile   none   swap    sw              0       0

对此:

#/swapfile   none   swap    sw              0       0

保存文件并退出 gedit。

重新启动并注意启动时间是否有所改善。

更多待定...

如果启动时间改善...删除/swapfile...

在 /dev/sdb 上创建交换分区或交换文件...

编辑/etc/fstab...

删除 /dev/sda7 交换分区...

步骤#3:

17.04 和加密交换文件似乎存在问题......并且有一些解决方法......

像这样编辑/etc/crypttab

gksudo gedit /etc/crypttab

更改此行:

cryptswap1 UUID=xxxx-xxxx-xxxx-xxxx /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

对此:

cryptswap1 /swapfile /dev/urandom swap,offset=1024,cipher=aes-xts-plain64

还要确保您的文件/etc/fstab包含以下内容:

/swapfile               none  swap  sw  0  0
/dev/mapper/cryptswap1  none  swap  sw  0  0

参考:

Ubuntu Desktop 17.04 64位启动缓慢

https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1668535

https://bugs.launchpad.net/ubuntu/+source/ecryptfs-utils/+bug/1670336

相关内容