即使遵循先前的建議,交換也不起作用

即使遵循先前的建議,交換也不起作用

我之前發過一篇問題其中 SolsTiCe 向我展示如何在 GPT 分割區上設定交換。它工作了一段時間,但現在我又遇到了問題。沒有再次偵測到交換。我遵循了完全相同的建議,但這次不起作用。重新啟動後,會出現 cryptswap 訊息,詢問我是否要跳過安裝等freesudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x055144b6

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/cryptswap: 7999 MB, 7999586304 bytes
255 heads, 63 sectors/track, 972 cylinders, total 15624192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xe001aed0

Disk /dev/mapper/cryptswap doesn't contain a valid partition table

blkid與上一個問題的輸出完全相同, 也是如此sudo gdisk /dev/sda

的輸出/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/sda8 during installation
UUID=775b2ce6-e738-40e5-828f-eccdf49cd63a /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=B639-EA4B  /boot/efi       vfat    defaults        0       1
# /home was on /dev/sda10 during installation
UUID=22c6084f-1225-48eb-a295-5d1a0d3d8830 /home           ext4    defaults        0       2
# /windows was on /dev/sda7 during installation
UUID=6D02-3AEA  /windows        vfat    utf8,umask=007,gid=46 0       1
# swap was on /dev/sda9 during installation
#UUID=cfa1562c-1530-4bf6-85c0-babe65ae4e05 none            swap    sw              0       0
#/dev/mapper/cryptswap1 none swap sw 0 0
/dev/mapper/cryptswap        none            swap    defaults        0       0

並且/etc/crypttab是:

#cryptswap1 UUID=cfa1562c-1530-4bf6-85c0-babe65ae4e05 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
cryptswap   /dev/sda9    /dev/urandom     swap,cipher=aes-cbc-essiv:sha256,size=256

答案1

找到了答案這裡:

更改/etc/crypttab為包括:

cryptswap   /dev/sda9    /dev/urandom     swap,cipher=aes-cbc-essiv:sha256,size=256

/etc/fstab包括:

cryptswap   /dev/sda9    /dev/urandom     swap,cipher=aes-cbc-essiv:sha256,size=256

現在free -m顯示:

             total       used       free     shared    buffers     cached
Mem:          3377        543       2834         17         57        226
-/+ buffers/cache:        260       3117
Swap:         7628          0       7628

相關內容