更新后交换似乎没有挂载

更新后交换似乎没有挂载

我已更新至 Ubuntu 15.04,现在我的交换分区似乎无法挂载。我不是专家,但看起来该分区似乎不再具有 UUID。如何让交换分区再次激活?

sudo journalctl -b | grep swap
Apr 26 21:21:13 MacBook systemd[1]: Activating swap Swap Partition...
Apr 26 21:21:13 MacBook swapon[355]: swapon: /dev/sda5: read swap header failed
Apr 26 21:21:13 MacBook systemd[1]: dev-sda5.swap swap process exited, code=exited status=255
Apr 26 21:21:13 MacBook systemd[1]: Failed to activate swap Swap Partition.
Apr 26 21:21:13 MacBook systemd[1]: Unit dev-sda5.swap entered failed state.
Apr 26 21:22:41 MacBook systemd[1]: Job swap.target/start failed with result 'dependency'.
Apr 26 21:22:41 MacBook systemd[1]: Job dev-disk-by\x2duuid-3e396c03\x2d9185\x2d47b6\x2d9f68\x2d3450be86289f.swap/start failed with result 'dependency'.
Apr 26 21:24:12 MacBook systemd[1]: Job dev-disk-by\x2duuid-3e396c03\x2d9185\x2d47b6\x2d9f68\x2d3450be86289f.swap/start failed with result 'dependency'.

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/sda3 during installation
UUID=f25d1301-fc5c-4f42-862b-c0097261522c /               ext3    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=3e396c03-9185-47b6-9f68-3450be86289f none            swap    sw              0       0

lsblk -f
NAME   FSTYPE  LABEL        UUID                                 MOUNTPOINT
sda                                                              
├─sda1 vfat    EFI          2860-11F4                            
├─sda2 hfsplus Macintosh HD 6c563b0e-e711-3a7a-8ac8-3baedccb3282 
├─sda3 ext3                 f25d1301-fc5c-4f42-862b-c0097261522c /
├─sda4 ntfs    WinXP        36202C2F202BF511                     
└─sda5                                                           
sr0                          

答案1

似乎你的交换分区格式错误或没有格式化。(或者以某种方式损坏)

将 sda5 重新格式化为 SWAP(使用 GParted、parted 或 fdisk)并确保 fstab 中的 UUID 与 中的匹配sudo blkid

sudo swapon /dev/sda5如果您不想重新启动,请运行以启用到该分区的交换。

相关内容