更新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
然后,在/etc/crypttab中更新正确的UUID,并按照这里列出的步骤进行操作: 如何设置加密交换文件? 然而,问题仍然存在,当我重新启动计算机时,/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
升级到14.04版(从13.04版)后,我的电脑出现了严重的减速问题。在运行top命令时,我注意到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的设置出了问题,但由于它被加密了,我不知道该如何修复。希望能得到一些帮助,指导下一步该怎么做。