从 14.04 升级到 16.06 后出现交换问题

从 14.04 升级到 16.06 后出现交换问题

将 Ubuntu 从 14.04 升级到 16.04 后,启动开始变得非常慢。这似乎是交换分区的问题。下面我附上了一些详细信息。

猫/var/log/boot.log

[FAILED] Failed to activate swap /dev/mapper/ubuntu--vg-swap_1.
See 'systemctl status "dev-mapper-ubunt...\x2dvg\\x2dswap_1.swap"' for details.
[DEPEND] Dependency failed for Swap.
...
[ TIME ] Timed out waiting for device dev-di...\x2db1dc\x2dae7fb1c172e6.device.
[DEPEND] Dependency failed for Cryptography Setup for cryptswap1.
[DEPEND] Dependency failed for dev-mapper-cryptswap1.device.
[DEPEND] Dependency failed for /dev/mapper/cryptswap1.
[DEPEND] Dependency failed for Encrypted Volumes.

猫/etc/fstab

/dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=d57910fd-a1ae-4721-8da0-af0677f5a869 /boot           ext2    defaults        0       2
/dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0

猫/etc/ctypttab

sda5_crypt UUID=cc64c6e4-f704-4f8e-8801-c9fe847b99c1 none luks,discard
cryptswap1 UUID=7ad77809-b29c-4434-b1dc-ae7fb1c172e6 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

lsblk

NAME                    MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                       8:0    0 238,5G  0 disk  
├─sda1                    8:1    0   243M  0 part  /boot
├─sda2                    8:2    0     1K  0 part  
└─sda5                    8:5    0 238,2G  0 part  
  └─sda5_crypt          252:0    0 238,2G  0 crypt 
    ├─ubuntu--vg-root   252:1    0 206,6G  0 lvm   /
    └─ubuntu--vg-swap_1 252:2    0  31,7G  0 lvm   
sr0                      11:0    1  1024M  0 rom 

猫/ proc / swaps

Filename                Type        Size    Used    Priority

ll /dev/mapper/

crw-------  1 root root 10, 236 sie 23 14:29 control
lrwxrwxrwx  1 root root       7 sie 23 14:29 sda5_crypt -> ../dm-0
lrwxrwxrwx  1 root root       7 sie 23 14:29 ubuntu--vg-root -> ../dm-1
lrwxrwxrwx  1 root root       7 sie 23 14:29 ubuntu--vg-swap_1 -> ../dm-2

答案1

您需要从 CD 或 USB 启动 Ubuntu,然后选择选项“尝试 ubuntu”,运行GParted。

如果需要,请删除旧的交换分区并创建一个新的交换分区。

/etc/fstab 应该有类似这样的一行

UUID=some-unique-id-for-the-partition swap swap defaults 0 0

获取唯一 IDblkid在终端中运行

相关内容