更新3:
我决定从头开始重新安装系统,以消除所有旧的碎片,因为升级后我也遇到了其他问题。但是,此问题仍然存在。
在全新安装中,选择使用“加密主目录”进行安装会导致损坏的加密交换配置。
更新2:
我修复了cfdisk抱怨的分配顺序,但是他的问题仍然存在。现在,交换位于/ dev / sda6上,我可以按以下步骤启动和运行它:
~$ sudo mkswap /dev/sda6
Setting up swapspace version 1, size = 7998460 KiB
no label, UUID=18881d0f-d9ec-43be-a23f-0cbd78ea6d22
$sudo nano /etc/crypttab # Update crypttad with new UUID
$ sudo /etc/init.d/cryptdisks reload
* Stopping remaining crypto disks...
* cryptswap1 (stopped)... [ OK ]
* Starting remaining crypto disks...
* cryptswap1 (starting)..
* cryptswap1 (started)... [ OK ]
$ sudo swapon -a
$ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 May 11 09:04 08b07f88-6da5-4b40-b062-42b3bb1c5f00 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 11 09:08 18881d0f-d9ec-43be-a23f-0cbd78ea6d22 -> ../../sda6
lrwxrwxrwx 1 root root 10 May 11 09:04 19aa372c-05c8-4226-8f09-c54e5566e816 -> ../../sda5
lrwxrwxrwx 1 root root 10 May 11 09:04 A800B16E00B143DA -> ../../sda1
lrwxrwxrwx 1 root root 10 May 11 09:04 D28230E68230D129 -> ../../sda2
lrwxrwxrwx 1 root root 10 May 11 09:08 fcc8c419-8fec-4d4d-b55e-9e4c3b04d21d -> ../../dm-0
但是重新启动交换后,激活失败,再次显示如下:
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 May 11 09:12 08b07f88-6da5-4b40-b062-42b3bb1c5f00 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 11 09:12 19aa372c-05c8-4226-8f09-c54e5566e816 -> ../../sda5
lrwxrwxrwx 1 root root 10 May 11 09:12 A800B16E00B143DA -> ../../sda1
lrwxrwxrwx 1 root root 10 May 11 09:12 D28230E68230D129 -> ../../sda2
我目前的猜测是,将磁盘设置为加密状态时,Linux不再能够识别分区类型,因此无法正确加载该分区类型,从而导致该磁盘无法注册其UUID,因此cryptswap找不到导致故障的分区。但我不知道如何解决。
更新的问题:
进一步的测试表明,我可以通过运行$ mkswap / dev / sda5来启动交换并运行
然后使用正确的UUID更新/ etc / crypttab,并按照此处概述的步骤进行操作: 如何设置加密的交换文件?
但是,当我重新启动计算机时,问题仍然存在,当我运行时/ dev / sda5不会出现
$ ls -l /dev/disk/by-uuid/
如果我做:
$ cfdisk /dev/sda
我收到以下错误:
FATAL ERROR: Bad logical partition 6: enlarged logical partitions overlap
Press any key to exit cfdisk
图形化“磁盘”实用程序在使用磁盘打开磁盘时不会抱怨任何错误。
$ sudo fdisk -l
Disk /dev/sda: 256.1 GB, 256060514304 bytes
255 heads, 63 sectors/track, 31130 cylinders, total 500118192 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 identifier: 0x619aebf1
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 206847 102400 7 HPFS/NTFS/exFAT
/dev/sda2 206848 100870143 50331648 7 HPFS/NTFS/exFAT
/dev/sda3 191397888 192397311 499712 83 Linux
/dev/sda4 192399358 500117503 153859073 5 Extended
/dev/sda5 484118528 500117503 7999488 82 Linux swap / Solaris
/dev/sda6 192399360 484118527 145859584 83 Linux
Partition table entries are not in disk order
原始问题:
从13.04升级到14.04之后,我的计算机一直在严重减速,当我运行kswap0时,我注意到kswap0占用了大量的cpu时间。我还注意到我没有任何交换空间!
$ sudo swapon -a
swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory
我的加密交换设置似乎存在一些问题(甚至不知道我有一个)
$ cat /etc/crypttab
cryptswap1 UUID=abe3c568-c8fd-4dfb-b8e9-0520d442dd61 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 May 6 11:00 08b07f88-6da5-4b40-b062-42b3bb1c5f00 -> ../../sda3
lrwxrwxrwx 1 root root 10 May 6 11:00 19aa372c-05c8-4226-8f09-c54e5566e816 -> ../../sda6
lrwxrwxrwx 1 root root 10 May 6 11:00 A800B16E00B143DA -> ../../sda1
lrwxrwxrwx 1 root root 10 May 6 11:00 D28230E68230D129 -> ../../sda2
看着我的fstab
$ 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/sda6 during installation
UUID=19aa372c-05c8-4226-8f09-c54e5566e816 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda3 during installation
UUID=08b07f88-6da5-4b40-b062-42b3bb1c5f00 /boot ext2 defaults 0 2
# swap was on /dev/sda5 during installation
#UUID=abe3c568-c8fd-4dfb-b8e9-0520d442dd61 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
我的猜测是sda5的设置有问题,但是我不知道如何解决它,因为它已设置为要加密。希望对如何进行提供一些帮助。