grub installation

debian3下grub安装

还是grub好用,如何安装?
1)su
2)apt-get install grub
3)vi /boot/grub/device.map:
把"(hd0) /dev/hda"放在第一行
4)grub-install /dev/hda
5)建立/boot/grub/menu.lst文件:
timeout 10
color black/cyan yellow/cyan
i18n (hd0,3)/boot/grub/messages
keytable (hd0,3)/boot/us.klt
altconfigfile (hd0,3)/boot/grub/menu.once
default 0

title Rescueos(deb3r0)
kernel (hd0,0)/vmlinuz root=/dev/hda1 devfs=mount vga=788
initrd (hd0,0)/boot/map

title Winos(2000p)
root (hd0,1)
makeactive
chainloader +1

title Linos(mdk9b1)
kernel (hd0,3)/boot/vmlinuz root=/dev/hda4 devfs=mount vga=788
initrd (hd0,3)/boot/initrd.img
6)ok!

另:mdk9使用很方便内容很新

/etc不能单独作为一个分区否则启动时找不到


这个grub设置了三个操作系统:debian3r(hda1),windows2000(hda2),mandrake9(hda4).
其实这个menu.lst文件是从mandrake9里拷来的(也在/boot/grub/menu.lst下).我忘了改文件头上第一个title前的部分了不过也能工作.应该把前面那一段的(hda,3)都换成(hda,0).
这说明了debian下的grub是一样好用的,只是有两点不同:
1)要编辑/boot/grub/device.map文件,它定义了把grub安装在那里.
2)debian下面对应于一般linuxos的vmliuz在/下(是个符号连接),而对应于一般linuxos的initd.img文件则是/boot/map.

认清了这些你可在机上装N个LINUX!


do as

1)apt-get intall grub
2)grub-install
3)vi /boot/grub/device.map
4)cp menu.lst /boot/grub/menu.lst
5)grub-install
6)if need us.klt messages menu.once,you can cp from other linux os.

### GRUB Bootloader Usage and Troubleshooting in Linux Systems #### Understanding GRUB Configuration Issues When encountering issues where GRUB loads but drops into the rescue shell without any errors, this situation might occur due to a missing or incorrectly placed `grub.cfg` file. Specifically, when installing GRUB2 UEFI with the `--boot-directory` option, if the `grub.cfg` is absent, such problems arise. Additionally, changes in the boot partition's number, which is hardcoded into the `grubx64.efi`, can also lead to similar failures[^1]. For instance, suppose one encounters this issue while working within a UEFI environment. In that case, verifying the presence of `grub.cfg` under `/boot/grub/` or ensuring the correct identification of the boot partition becomes crucial. #### Utilizing GRUB Menuentries for Booting ISO Images Directly from Hard Drive Another aspect involves utilizing GRUB menu entries to boot ISO images directly from a hard drive instead of creating physical media like CDs/DVDs. This method applies particularly to distributions like Ubuntu and certain utility ISOs along with other Linux operating systems. By configuring appropriate GRUB configurations, users eliminate the necessity for external storage mediums entirely[^2]. An example configuration snippet could look something like: ```bash menuentry "Ubuntu Live ISO" { set root=(hd0,msdos1) loopback loop /path/to/ubuntu.iso linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=/path/to/ubuntu.iso quiet splash --- initrd (loop)/casper/initrd.lz } ``` This script sets up a new entry named `"Ubuntu Live ISO"` allowing direct booting from specified paths on local drives. #### Handling Multi-Distribution Scenarios Through GRUB Menus In environments hosting multiple distributions alongside each other—such as having both Fedora and Ubuntu installed—the GRUB startup menus play an essential role. After rebooting, selecting options through these menus enables switching between different OS installations seamlessly. For example, choosing the Ubuntu option presented during initial boot leads further into its own specific bootloader interface before finally loading selected kernels based upon user preferences or predefined timeouts[^3]. #### Adjustments Post-Recovery Mode Boots It is worth noting special conditions following boots into recovery modes or instances where previous attempts at starting failed. Under those circumstances, rather than adhering strictly to configured time limits defined inside `/etc/default/grub`, interactive selections become mandatory until valid choices are made by end-users[^5]. --- --related questions-- 1. How does changing the boot order affect how GRUB handles multi-boot scenarios? 2. What steps should be taken to ensure proper installation of GRUB onto removable USB devices intended for live sessions? 3. Can custom scripts automate updates to GRUB configurations whenever system packages change significantly? 4. Is there support for secure boot mechanisms provided natively within modern versions of GRUB? 5. Which tools outside of standard package managers offer advanced diagnostics capabilities concerning GRUB-related issues?
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值