이전 조언을 따른 후에도 스왑이 작동하지 않습니다.

이전 조언을 따른 후에도 스왑이 작동하지 않습니다.

나는 이전에 포스팅한 적이 있다.질문solsTiCe는 GPT 파티션에서 스왑을 설정하는 방법을 보여주었습니다. 한동안 효과가 있었지만 지금은 다시 문제가 발생합니다. 스왑이 다시 감지되지 않았습니다. 나는 똑같은 조언을 따랐지만 이번에는 작동하지 않습니다. 재부팅 후 마운트를 건너뛸 것인지 묻는 cryptswap 메시지가 나타납니다. 로그인한 후 free스왑이 표시되지 않고 sudo 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

관련 정보