日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux双系统启动引导,linux windows 双系统并存与启动引导

發布時間:2023/12/20 linux 51 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux双系统启动引导,linux windows 双系统并存与启动引导 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

發現網站這類文章不好找 找到的分析也不太詳細???? 小弟不才今天就寫這么一個文章

PS: 文章是否保留出處屬于個人意愿 本人不喜歡強制要求

一般安裝WINDOWS 和 LINUX 并存的有兩種方式

1: 先安裝windows xp???? 在安裝LINUX???? 靠 LINUX 的grub 來選擇引導兩個

2: 先安裝LINUX 在安裝WINDOWSXP???? 靠 WINDOWS XP C盤根目錄下的 boot.ini 來引導 grub FOR DOS (這個是個軟件可以下載到) 在引導LINUX

我的硬盤情況

/media/hda1???????? //WINDOWS C盤的

/media/hda2???????? //硬盤擴展分區

/media/hda3???????? // LINUX SWAP 分區

/media/hda4???????? // LINUX 根分區/

/media/hda5???????? //WINDOWS D盤的

………………………………………………………………………………………………………………………………

一些補充: LINUX 設備中 第一塊ATA 硬盤 為hda 第一個分區為 hda1

hda1-4都為主分區???? hda5 開始為邏輯分區

………………………………………………………………………………………………………………………………

先講第一種情況 先安裝 WINDOWS XP 在安裝 LINUX 的

這種出現比較常見的情況 就是 可以引導LINUX 但是不了WINDOWS

這個原因是 LINUX 最后安裝重新刷新了 mbr(主引導記錄)???? grub 的配置不正確或者 grub 無法識別 WINDOWS 分區

出現這樣的情況解決辦法就是重新修改grub 配置文件

這個文件一般在LINUX 分區????? /boot/grub/.conf?????? 或者/boot/grub/menu.lst 詳細根據LINUX發行版本不同而不同

………………………………………………………………………………………………………………………………

補充:.conf 為隱藏文件 需要用ls -a 命令可以看見 或者在 X WIN 設置顯示隱藏文件也可見

一些人分區直接 就一個根分區 / 和 SWAP 就完了 這樣不科學 建議設置一個/BOOT 分區 方便以后好恢復

如果沒有分/boot 分區????? 默認的路徑就是/grub

………………………………………………………………………………………………………………………………

那么怎么來修改這個配置文件~??????? 看個例子~以下是我計算機上的grub 配置文件

# menu.lst - See: grub(8), info grub, update-grub(8)

#????????????? grub-install(8), grub-floppy(8),

#????????????? grub-md5-crypt, /usr/share/doc/grub

#????????????? and /usr/share/doc/grub-doc/.

## default num

# Set default entry to entry number NUM. Numbering starts from 0, and

# the entry number 0 is the default if the command is not used.

#

# You can specify 'saved' instead of a number. In this case, the default entry

# is the entry saved with the command 'savedefault'.

# WARNING: If you are using dmraid do not change this entry to 'saved' or your

# array will desync and will not let you boot your system.

default????????? 0

## timeout sec

# Set a timeout, in SEC seconds, before automatically booting the default entry

# (normally the first entry defined).

timeout????????? 10?????????????????????? //超時時間

## hiddenmenu

# Hides the menu by default (press ESC to see the menu)

#hiddenmenu

# Pretty colours

#color cyan/blue white/blue

## password ['--md5'] passwd

# If used in the first section of a menu file, disable all interactive editing

# control (menu entry editor and command-line) and entries protected by the

# command 'lock'

# e.g. password topsecret

#??????? password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/

# password topsecret

#

# examples

#

# title????????? Windows 95/98/NT/2000

# root????????? (hd0,0)

# makeactive

# chainloader????? +1

#

# title????????? Linux

# root????????? (hd0,1)

# kernel????? /vmlinuz root=/dev/hda2 ro

#

#

# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST

## lines between the AUTOMAGIC KERNELS LIST markers will be modified

## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##

## default kernel options

## default kernel options for automagic boot options

## If you want special options for specific kernels use kopt_x_y_z

## where x.y.z is kernel version. Minor versions can be omitted.

## e.g. kopt=root=/dev/hda1 ro

##??????? kopt_2_6_8=root=/dev/hdc1 ro

##??????? kopt_2_6_8_2_686=root=/dev/hdc2 ro

# kopt=root=UUID=39578435-c0d9-45c6-bb67-a147d26bee3a ro

## Setup crashdump menu entries

## e.g. crashdump=1

# crashdump=0

## default grub root device

## e.g. groot=(hd0,0)

# groot=(hd1,1)

## should update-grub create alternative automagic boot options

## e.g. alternative=true

##??????? alternative=false

# alternative=true

## should update-grub lock alternative automagic boot options

## e.g. lockalternative=true

##??????? lockalternative=false

# lockalternative=false

## additional options to use with the default boot option, but not with the

## alternatives

## e.g. defoptions=vga=791 resume=/dev/hda5

# defoptions=quiet splash

## should update-grub lock old automagic boot options

## e.g. lockold=false

##??????? lockold=true

# lockold=false

## Xen hypervisor options to use with the default Xen boot option

# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option

# xenkopt=console=tty0

## altoption boot targets option

## multiple altoptions lines are allowed

## e.g. altoptions=(extra menu suffix) extra boot options

##??????? altoptions=(recovery) single

# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst

## only counts the first occurence of a kernel, not the

## alternative kernel options

## e.g. howmany=all

##??????? howmany=7

# howmany=all

## should update-grub create memtest86 boot option

## e.g. memtest86=true

##??????? memtest86=false

# memtest86=true

## should update-grub adjust the value of the default booted system

## can be true or false

# updatedefaultentry=false

## ## End Default Options ##??????? // LINUX 引導配置

title????????? Ubuntu, kernel 2.6.20-16-generic

root????????? (hd0,1)

kernel????????? /vmlinuz-2.6.20-16-generic root=UUID=39578435-c0d9-45c6-bb67-a147d26bee3a ro quiet splash

initrd????????? /initrd.img-2.6.20-16-generic

quiet

savedefault

title????????? Ubuntu, kernel 2.6.20-16-generic (recovery mode)

root????????? (hd0,1)

kernel????????? /vmlinuz-2.6.20-16-generic root=UUID=39578435-c0d9-45c6-bb67-a147d26bee3a ro single

initrd????????? /initrd.img-2.6.20-16-generic

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian

# ones.

title????????? Other operating systems:

root

# This entry automatically added by the Debian installer for a non-linux OS????? //windows 系統引導配置

# on /dev/hda1

title????????? Windows NT/2000/XP

root????????? (hd0,0)

savedefault

makeactive

chainloader????? +1

………………………………………………………………………………………………

#號是注釋掉的部分 沒用

………………………………………………………………………………………………

linux 引導配置

第一個是 title名字???? - -|~ 可以不鳥

第二個是root 系統所在 磁盤分區?????? hd0,1表示 hda2???? hd0,0 表示 hda1

第三個是kernel 加載內核路徑???? 以及參數

第四個是 initrd???? 系統進程

………………………………………………………………………………………………

windows引導配置

第一個是title????????? Windows NT/2000/XP

第二個是root 系統所在 磁盤分區?????? hd0,0????? 就是 hda1 c盤

………………………………………………………………………………………………

其他沒什么好講了 就根據自己的硬盤分區情況 改修里面的配置文件就可以實現雙系統啟動了

建議C盤的 格式為FAT32 不然一些grub 確實無法識別~

第二種情況:

先安裝LINUX 在安裝WINDOWSXP???? 靠 WINDOWS XP C盤根目錄下的 boot.ini 來引導

這個情況個因為windwsxp 最后安裝 所以造成重刷MBR 是引導的 WINDOWS

需要來修改C 盤下的配置文 件boot.ini來實現 雙系統引導???? 還需要一個軟件 grub for dos

把grub for dos 下載下來之后 有 一個grldr 這個文件沒后綴的???? 復制到c盤根目錄 以及一些相關文件都弄在C盤 在修改 bootini

[boot loader]

timeout=3

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=" Windows XP????? " /noexecute=optin /fastdetect

c:\grldr=" Linux?????? "

………………………………………………………………………………………………

c:\grldr=" Linux?????? "??????? 這個是后來添加的 當然也可以改路徑

grub for dos 里面也有個配置文件 叫 menu.lst 根據 上面講的 grub 配置根據實際情況修改一下 就可以實現windows 引導LINUX 了

完~ - -|

總結

以上是生活随笔為你收集整理的linux双系统启动引导,linux windows 双系统并存与启动引导的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。