挂载分区

挂载分区

这是一次尝试,但失败了,Ubuntu 和 Windows 10 双启动。

眼镜:Alienware Area-51,操作系统:Ubuntu 18.04.2,无法访问的操作系统:Windows 10

以下是一些信息Boot Repair

Boot successfully repaired.

Please write on a paper the following URL:

http://paste.ubuntu.com/p/4367sGzjPG/

In case you still experience boot problem, indicate this URL to:
[email protected] or to your favorite support forum.

You can now reboot your computer.
Please do not forget to make your BIOS boot on sdb2/EFI/ubuntu/shimx64.efi file!

The boot files of [The OS now in use - Ubuntu 18.04.2 LTS] are far from the start of the disk. Your BIOS may not detect them. You may want to retry after creating a /boot/efi partition (FAT32, 100MB~250MB, start of the disk, boot flag). This can be performed via tools such as gParted. Then select this partition via the [Separate /boot/efi partition:] option of [Boot Repair].

我还更新了/etc/grub.d/40_custom以下内容:

menuentry "Windows 10" {
        insmod part_gpt
        insmod chain
        set root='(hd0,msdos2)'
        chainloader +1
}

但是,我只是从我在 Google 上找到的一个随机教程中复制粘贴了这段代码。因此,虽然“Windows 10”显示在 GRUB 中;但代码在这里显然不兼容,因为当我在 GRUB 中单击它时,就会出现这个代码

error: disk 'hd0,msdos2' not found.

Press any key to continue...

我尝试了很多教程中的方法;但似乎都没有用。

我怎样才能解决这个问题?

答案1

您的外星人很可能正在运行适用于 Windows 10 的 Intel RST Premium。当我尝试首次双启动时,我的 flex 5 就出现了这种情况。在重启期间,通过按 f2(或删除或任何其他有效的方法)打开您的 BIOS。查找显示 RST Premium 的内容并将其切换到 AHCI,然后它有望正常工作。我遇到了类似的事情,所以这可能有效。

答案2

挂载分区

首先确保你已经挂载了你的窗口分区

$ lsblk -o NAME,FSTYPE,LABEL,SIZE,MOUNTPOINT
NAME        FSTYPE  LABEL                    SIZE MOUNTPOINT
sdb                                         14.4G 
├─sdb4      iso9660 Ubuntu 18.04 LTS amd64   1.4G /media/rick/Ubuntu 18.04 LTS amd64
├─sdb2                                         1M 
├─sdb5      ext4    casper-rw                6.4G /media/rick/casper-rw
├─sdb3      vfat    usbboot                  244M 
└─sdb1      ntfs    usbdata                  6.4G /media/rick/usbdata
sr0                                         1024M 
sda                                        931.5G 
├─sda4      ntfs    WINRETOOLS               450M 
├─sda2                                       128M 
├─sda5      ntfs    Image                   11.4G 
├─sda3      ntfs    HGST_Win10               919G /mnt/d
└─sda1      vfat    ESP                      500M 
nvme0n1                                      477G 
├─nvme0n1p5 ext4    NVMe_Ubuntu_16.0        44.6G /
├─nvme0n1p3                                   16M 
├─nvme0n1p1 ntfs                             450M 
├─nvme0n1p8 ext4    Ubuntu18.04             23.7G 
├─nvme0n1p6 swap    Linux Swap               7.9G [SWAP]
├─nvme0n1p4 ntfs    NVMe_Win10             391.2G /mnt/c
├─nvme0n1p2 vfat                              99M /boot/efi
└─nvme0n1p7 ntfs    Shared_WSL+Linux           9G /mnt/e

30_os-探测器

确保您的30_os-prober被标记为可执行文件,如下所示:

$ ll /etc/grub.d/30_os-prober
-rwxr-xr-x 1 root root 11736 Jun 29  2018 /etc/grub.d/30_os-prober*

总结

我的 AW17R3 运行 Intel RAID 时没有问题,但因为另一个问题我将其切换到 AHCI,并且无法再切换回来。

我的 Windows 10 如下所示:

menuentry 'Windows 10' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
    savedefault
    insmod part_gpt
    insmod fat
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root  D656-F2A8
    else
      search --no-floppy --fs-uuid --set=root D656-F2A8
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

但是我运行了一个小脚本来为 grub 菜单选项赋予有意义的名称:

# NAME: my-update-grub
# PATH: /mnt/e/bin
# DESC: Run update-grub and then rename menu entries
# DATE: July 13, 2018. (yah it's a Friday)

# sudo required when calling script
if [[ $(id -u) != 0 ]]; then
    zenity --error --text "You must call this script using sudo. Aborting."
    exit 99
fi

#sudo update-grub # Optional remove # in column 1

sed -i "s|Windows Boot Manager (on /dev/nvme0n1p2)|Windows 10|g" /boot/grub/grub.cfg
sed -i "s|Windows Boot Manager (on /dev/sda1)|Windows 10 original|g" /boot/grub/grub.cfg
sed -i "s|Ubuntu 16.04.5 LTS (16.04) (on /dev/nvme0n1p7)|Broken Ubuntu 16.04|g" /boot/grub/grub.cfg
sed -i "s|Ubuntu 18.04.1 LTS (18.04) (on /dev/nvme0n1p10)|Ubuntu 18.04|g" /boot/grub/grub.cfg

exit 0

我确实将 BIOS 改为每次启动时不从硬盘重新加载,这样可以节省 4 秒钟左右。我还将 BIOS 改为不从 NIC 卡读取,这样可以节省几秒钟。BIOS POST 过去需要大约 16 秒,我将其缩短到 5 秒。但我认为还是太长了,因为 Dell Inspiron 17R 7720SE 只需要一两秒。

在 BIOS 中,确保 TPM 和安全启动已关闭。此外,您可能还想按照boot-repair建议将分区移至磁盘前面:

$ sudo fdisk -l
Disk /dev/nvme0n1: 477 GiB, 512110190592 bytes, 1000215216 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: gpt
Disk identifier: 43583516-680C-4323-A4B1-592DF4DEEB70

Device              Start        End   Sectors   Size Type
/dev/nvme0n1p1       2048     923647    921600   450M Windows recovery environment
/dev/nvme0n1p2     923648    1126399    202752    99M EFI System
/dev/nvme0n1p3    1126400    1159167     32768    16M Microsoft reserved
/dev/nvme0n1p4    1159168  762818491 761659324 363.2G Microsoft basic data
/dev/nvme0n1p5  819851264  821610495   1759232   859M Windows recovery environment
/dev/nvme0n1p6  821610496  916246527  94636032  45.1G Linux filesystem
/dev/nvme0n1p7  916246528  964739071  48492544  23.1G Linux filesystem
/dev/nvme0n1p8  964739072  983709695  18970624     9G Microsoft basic data
/dev/nvme0n1p9  983709696 1000214527  16504832   7.9G Linux swap
/dev/nvme0n1p10 762818560  819851263  57032704  27.2G Linux filesystem

Partition table entries are not in disk order.


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: 8BEC7AEB-4576-42B0-8A8A-D40779A80126

Device          Start        End    Sectors  Size Type
/dev/sda1        2048    1026047    1024000  500M EFI System
/dev/sda2     1026048    1288191     262144  128M Microsoft reserved
/dev/sda3     1288192 1928626175 1927337984  919G Microsoft basic data
/dev/sda4  1928626176 1929547775     921600  450M Windows recovery environment
/dev/sda5  1929547776 1953523711   23975936 11.4G Windows recovery environment

您的整个30_os-prober部分都显示为损坏(它是空的),而我的部分在到达重要部分之前有 100 行:

$ grep 30_os-prober -A110 /boot/grub/grub.cfg
   (...SNIP...)
menuentry 'Windows 10' --class windows --class os $menuentry_id_option 'osprober-efi-D656-F2A8' {
    savedefault
    insmod part_gpt
    insmod fat
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root  D656-F2A8
    else
      search --no-floppy --fs-uuid --set=root D656-F2A8
    fi
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

相关内容