我有一台双启动的 Windows 10 和 Ubuntu PC。升级到 Ubuntu 16.04 后,从启动列表中选择 Ubuntu 后出现以下屏幕。
我已经尝试过发布的方法这里这需要从可启动的 USB 启动盘启动,fsck -l
在根分区上运行(显示没有问题)并重新启动,以及本文中的其他操作,但不起作用。它只是返回到紧急模式。
输入后,journalctl -xb
我得到以下输出,我将其放在粘贴箱。
似乎无法挂载交换分区,如上面的日志文件摘录所示:
systemd[1]: dev-sda9.mount: Failed to check directory /dev/sda9: Not a directory
...
systemd[1]: Failed to mount /dev/sda9.
该文件/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=2238a8ba-5029-47d6-8276-472f1bea530e none swap sw 0 0
#cryptswap /dev/sda9 /dev/urandom swap,cipher=aes-cbc-essiv:sha256,size=256
# usb hdd for backups
UUID=34a0826c-00e4-4c65-8b28-feb34a228b55 /mnt/Ext_HD_1TB auto auto,user,rw,exec 0 0
我尝试取消注释倒数第三行(以#cryptswap
.. 开头)并注释掉上面的一行。它所做的只是请求交换分区的密码。我不希望我的交换被加密。
命令fdisk -l
结果如下:
Disk /dev/ram0: 64 MiB, 67108864 bytes, 131072 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 /dev/ram1: 64 MiB, 67108864 bytes, 131072 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 /dev/ram2: 64 MiB, 67108864 bytes, 131072 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 /dev/ram3: 64 MiB, 67108864 bytes, 131072 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 /dev/ram4: 64 MiB, 67108864 bytes, 131072 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 /dev/ram5: 64 MiB, 67108864 bytes, 131072 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 /dev/ram6: 64 MiB, 67108864 bytes, 131072 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 /dev/ram7: 64 MiB, 67108864 bytes, 131072 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 /dev/ram8: 64 MiB, 67108864 bytes, 131072 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 /dev/ram9: 64 MiB, 67108864 bytes, 131072 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 /dev/ram10: 64 MiB, 67108864 bytes, 131072 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 /dev/ram11: 64 MiB, 67108864 bytes, 131072 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 /dev/ram12: 64 MiB, 67108864 bytes, 131072 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 /dev/ram13: 64 MiB, 67108864 bytes, 131072 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 /dev/ram14: 64 MiB, 67108864 bytes, 131072 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 /dev/ram15: 64 MiB, 67108864 bytes, 131072 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 /dev/sda: 931.5 GiB, 1000204886016 bytes, 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
Disklabel type: gpt
Disk identifier: 531392B4-E90D-44D4-B066-9D0760AAE16B
Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M Windows recovery environment
/dev/sda2 1230848 1845247 614400 300M EFI System
/dev/sda3 1845248 2107391 262144 128M Microsoft reserved
/dev/sda4 2107392 161163263 159055872 75.9G Microsoft basic data
/dev/sda5 161163264 317462527 156299264 74.5G Microsoft basic data
/dev/sda6 317462528 348829695 31367168 15G Windows recovery environment
/dev/sda7 348829696 387891199 39061504 18.6G Microsoft basic data
/dev/sda8 387891200 583202815 195311616 93.1G Linux filesystem
/dev/sda9 583202816 598827007 15624192 7.5G Linux swap
/dev/sda10 598827008 1953523711 1354696704 646G Linux filesystem
Disk /dev/mapper/cryptswap: 7.5 GiB, 7999586304 bytes, 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 /dev/sdc: 1.9 GiB, 2014314496 bytes, 3934208 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
Disklabel type: dos
Disk identifier: 0x000a07f3
Device Boot Start End Sectors Size Id Type
/dev/sdc1 2048 3934207 3932160 1.9G b W95 FAT32
答案1
注释掉/etc/fstab
交换分区中的条目可以让您的计算机正常启动,尽管没有交换分区。
在某些时候,您可能有一个加密的交换分区。然后有人试图将其设置为使用常规的未加密交换分区。
既然您知道如何使用 gparted 和 blkid,我将简要回答如何恢复交换分区。
- 启动 gparted 并删除旧的加密 sda9 分区
- 使用 gparted 在相同(现在未分配)空间中重新创建一个新的交换分区。如果您总共有 4G RAM,则可以创建一个比之前的 8G 分区略小的交换分区。将其设为 4G。
- 选择新创建的交换分区,右键单击它并选择 swapon 命令。这将暂时启用交换。
- 在终端中,输入
sudo blkid
并记下新创建的交换分区的 UUID(可能是或不是 sda9)。 在终端中,
sudo gedit -H /etc/fstab
找到注释掉的行#UUID=2238a8ba-5029-47d6-8276-472f1bea530e none swap sw 0 0
删除 #,并将 UUIID 更改为从命令中获取的 UUIID
blkid
。保存并退出 gedit。- 重新启动,并确认
swapon
命令正确显示已启用交换。
答案2
输入您的密码:
sudo -i
fdisk -l
在列表的末尾你应该看到类似这样的内容:
Device Boot Start End Sector Size ID Type**
/dev/xxxxxxxxxxxxx00 1 125000 125000 61M c W95 FAT32 (LBA)
/dev/xxxxxxxxxxxxx11 125000 14334047 14209047 6.8G 83 Linux
我使用了/dev/xxxxxxxxxxx00
类型为 FAT32 的列表 - 请注意xxxxxxxxxxxxx
代表屏幕上显示的其他字符。您的将与我的不同。
以下是我使用的命令:
umount /dev/xxxxxxxxxxxx00
fsck -y /dev/xxxxxxxxxxxx00
reboot
这对我来说很管用。重启后,它运行了大约 3-5 分钟,然后出现了 Kali Linux GUI。