筆記本配置:8G內存,200G SSD,先在virbox中成功安裝雙系統,能正常進入並使用 Windows 7 和 CentOS 7。html
網上看到一大堆的安裝 wingrub easyBCD,折騰了一天沒安裝成功,結果仍是 google 找到一篇靠譜的文章,step by step 終於在次日搞定雙系統。linux
這一步比較簡單。開機按 delete 進入BIOS(不一樣電腦進入BIOS方法不一樣),設置 USB 爲第一啓動項。 啓動win7安裝程序windows
一直 【下一步】,在建立分區時,分配100G給 Windows 7,100G預留給 CentOS 7,分別格式化兩個主分區,把 Windows 7 安裝在第一個主分區,N個【下一步】等待一下子,安裝完成進入桌面,Windows 7 安裝成功。centos
關閉Windows 7,插入用 UltraISO 製做的 Centos 7 引導U盤,啓動安裝程序google
第2張圖:選擇磁盤,!!! 必須選擇手動分區,不然新安裝的CentOS 7 會覆蓋以前安裝的 Windows 7 !!!阿里雲
完成第3張圖後,在 New CentOS 7 Installatioin 下面應該會有一欄 /root 10GB(我本身分配的root目錄大小),這時不要點擊 【Done】,接着點擊 第3張圖 中的 【+】號依次添加boot、swap分區,此時New CentOS 7 Installatioin 下應該會有三欄信息 (分區大小根據須要自行設置)spa
/root 10GB3d
/boot 1024MBcode
/swap 1024MBhtm
/ 87GB
此時點擊 【Done】接受更改,安裝程序格式化全部分區,進入正常安裝程序,CentOS 7 安裝完成。
這時重啓電腦,進入的會是 CentOS 7,登陸後 編輯 /etc/grub.d/40_custom 文件,添加以下 內容
menuentry "Windows 7" { set root='(hd0,1)' chainloader +1 }
保存後,執行以下命令:grub2-mkconfig -o /boot/grub2/grub.cfg,若是在屏幕中看到以下內容,則表示雙系統啓動設置成功
grub2-mkconfig -o /boot/grub2/grub.cfg Generating grub configuration file ... Found linux image: /boot/vmlinuz-3.10.0-123.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.el7.x86_64.img Found linux image: /boot/vmlinuz-3.10.0-123.8.1.el7.x86_64 Found initrd image: /boot/initramfs-3.10.0-123.8.1.el7.x86_64.img Found Windows 7 (loader) on /dev/sda1 done
附:若是C盤是NTFS格式,則須要安裝 ntfs-3g。執行下列安裝命令
1、添加阿里雲源 wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 2、yum -y update 3、yum makecache 4、yum -y install ntfs-3g
關機重啓後,出現雙系統引導
啓動 CentOS 7
啓動 Windows 7
參考文章:https://www.dedoimedo.com/computers/dual-boot-windows-7-centos-7.html
-------------------------------------------------------------
重裝windows 7後,重裝GRUB方法,請參閱centos官網說明:
https://wiki.centos.org/zh/TipsAndTricks/ReinstallGRUB?highlight=%28reinstall%29%7C%28grub%29