折騰deeplin系統


1.雙系統失敗記錄

多系統啟動問題

先安裝完deepin,發現再安裝windows怎么都起不起來,哪怕他們已經安裝在不同的盤

(體現再Windows7通過ghost位於另外一個盤,但就是沒有啟動項)

為了裝雙系統,損失慘重,sda2盤不幸被格式化,千萬不要幻想pe工具可以把系統寫到磁盤的中間區域,

它一定是從磁盤的起始區域開始寫,所以通過壓縮卷弄出來的空間裝系統一定不靠譜,會導致數據覆蓋的!!!

window7  sda2

deepin     sdb

不得不佩服deepin,無論bios如何設置,deepin系統總是能啟動起來,哪怕開機啟動項里已經完全排除了sdb盤。

deepin這樣做真的好嗎,安裝的時候求着我要一個EFI格式分區(sdb1),可裝完就翻臉不認人了,直接把我的bios

啟動順序給無視了(被欺騙的感覺),使用efibootmgr可以發現,它完全自己搞了一套啟動順序

sain@Linux:~/Desktop$ efibootmgr
BootCurrent: 0000 Timeout: 1 seconds BootOrder: 0000,0001,0002,0005,0006 Boot0000* deepin Boot0001* Hard Drive Boot0002 UEFI OS Boot0005 UEFI OS Boot0006 USB

/etc/grub.d/40_custom (用於生成/boot/grub/grub.cfg中的自定義引導項)

sain@Linux:/etc/grub.d$ ls
00_header  05_debian_theme  10_linux  20_linux_xen  30_os-prober  30_uefi-firmware  40_custom  41_custom  README

READEM


All executable files in this directory are processed in shell expansion order.

00_*: Reserved for 00_header.
10_*: Native boot entries.
20_*: Third party apps (e.g. memtest86+).

The number namespace in-between is configurable by system installer and/or
administrator. For example, you can add an entry to boot another OS as
01_otheros, 11_otheros, etc, depending on the position you want it to occupy in
the menu; and then adjust the default setting via /etc/default/grub.

文件/etc/default/grub也並無想要的東西

# Written by com.deepin.daemon.Grub2
GRUB_BACKGROUND="/boot/grub/themes/deepin/background.png" GRUB_CMDLINE_LINUX="" GRUB_CMDLINE_LINUX_DEFAULT="splash quiet" GRUB_DEFAULT="0" GRUB_DISTRIBUTOR="`/usr/bin/lsb_release -d -s 2>/dev/null || echo Deepin`" GRUB_GFXMODE="1920x1080" GRUB_THEME="/boot/grub/themes/deepin/theme.txt" GRUB_TIMEOUT="5"

 

修改

/etc/grub.d/40_custom

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Windows 7 (loader) (on /dev/sda2)' --class windows {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos2'
    chainloader +1
}

重新生成 /boot/grub/grub.cfg

sudo grub-mkconfig -o /boot/grub/grub.cfg

打開設置那里,可以發現菜單多了選項

其實這樣也只不過是菜單上多了個win7選項,肯定還是無法啟動的

反復修改,都無法啟動,提示找不到磁盤或者invalid EFI file path

UUID的獲取sudo blkid
menuentry 'Windows 7 (loader) (on /dev/sda2)' --class windows {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 000598F0000980AD
    chainloader +1
}

error: invalid EFI file path

安裝過win7系統所在磁盤EFI目錄文件如下:

sain@Linux:/media/sain/000598F0000980AD/EFI/Microsoft/Boot$ ls
BCD  BCD.LOG  BCD.LOG1    BCD.LOG2  bootmgfw.efi    bootmgr.efi  BOOTSTAT.DAT  en-US  Fonts  memtest.efi  zh-CN

 正確的配置

exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Windows 7 (loader) (on /dev/sda2)' --class windows {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 000598F0000980AD
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

 安裝原版windows 系統

 BIOS-->MBR-->DPT-->PBR--> Bootmgr-->bcd-->Winload.exe-->內核加載 -->整個windows7系統

https://baike.baidu.com/item/bootmgr/7141238?fr=aladdin

2.失敗原因分析

感覺原理沒問題了,可最終還是失敗了,盡量不要嘗試先裝deepin,再裝windows,糾結了好幾天,也沒搞出來原因

后來再重裝時才突然為什么重啟就不行

    set root='(hd0,msdos1)' search --no-floppy --fs-uuid --set=root 000598F0000980AD chainloader /EFI/Microsoft/Boot/bootmgfw.efi

因為我當時磁盤的划分不是mbr而是gpt引導, 整個硬盤多出來一個100多兆的分區存放索引信息,gpt支持2T以上的銀盤,mbr不支持的,這就導致gpt實際上多出了一個磁盤分區,如下圖

這對用deepin引導是致命的

 

 3.雙系統正確的裝法

先裝win10,再裝deepin,很簡單就好了

ssd   分出一部分   裝win10,為了方便deepin引導,分區堅決使用mbr

ssd  分出一部分    裝deepin ,  其中home分區掛載hdd上

為保證系統的獨立性,deepin必須的EFi分區放在hdd上,這樣兩個系統的引導信息就在不同的盤上,而且系統主體都在ssd上,保證了系統的啟動速度

附張圖:

SSD  240G

HHD  320G

 

 

 

menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 000BA64600056356
    chainloader +1
}

 裝完雙系統默認已經生成了一個,不過會卡屏一下才啟動,自己寫的更好一些

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 10 (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-000BA64600056356' {
    insmod part_msdos
    insmod ntfs
    set root='hd0,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  000BA64600056356
    else
      search --no-floppy --fs-uuid --set=root 000BA64600056356
    fi
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Windows 10 (loader) (on /dev/sda1)' --class windows {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 000BA64600056356
    chainloader +1
}
### END /etc/grub.d/40_custom ###

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM