现在碰到一怪事我如果删除/boot下面的所有文件怎么我的系统还可以正常启动??
时间:2006-03-18
来源:互联网
作者: zhuningwll 发布时间: 2006-03-18
作者: shannleon 发布时间: 2006-03-18
楼主没搞错吧系统引导第一阶段.读取mbr里的lilo,再由lilo载入内核,内核默认都是放在/boot里的(当然你放在其他地方也可以).比如你放在/分区,在修改/etc/lilo.conf指向/分区的内核,运行lilo后,把/boot里的东西都删了也没问题(但强烈建议你遵linux的规范!!!)
作者: r00to 发布时间: 2006-03-18
作者: windrose 发布时间: 2006-03-18
我试过,确实,就是把那分区Del掉都能启动。所以我这么认为。不知道对不对就是。 :)
作者: 独行侠 发布时间: 2006-03-21
作者: wjping119 发布时间: 2006-03-22
作者: wjping119
搞笑,lilo肯定要载入内核的,那内核又放在哪儿呢?一般都在/boot下,删掉了lilo】去哪儿找内核?
|
1. 运行 lilo
2. mv /boot /boot.orig
3. reboot
4. 上来给你回这个帖子。
# /etc/lilo.conf boot=/dev/hda prompt timeout=1200 default=Linux-2.6 image=/boot/vmlinuz root=/dev/hda1 label=Linux-2.4 read-only image=/boot/2.6.X/vmlinuz root=/dev/hda1 label=Linux-2.6 read-only other=/dev/hda2 label=Windows
作者: shannleon 发布时间: 2006-03-22
是不是因为文件删了, 但文件内容还在磁盘?
或者另用备份?
作者: pointer 发布时间: 2006-03-22
简单的回答:你删除的 boot 不是系统用到的 boot,不然就会找不到内核,你想启动也启动不了。(用其他内核的话,那这个 boot 也就没有用咯)。
如 windrose 所说,贴出 lilo 配置文件就知道为什么了。
作者: 晨想 发布时间: 2006-03-22
作者: guduzhu 发布时间: 2006-03-22
When Lilo boots the system, it uses BIOS calls to load the Linux kernel off the disk (IDE drive, floppy or whatever). Therefore, the kernel must live in some place that can be accessed by the bios.
At boot time, Lilo is not able to read filesystem data, and any pathname you put in /etc/lilo.conf is resolved at installation time (when you invoke /sbin/lilo). Installation time is when the program builds the tables that list which sectors are used by the files used to load the operating system. As a consequence, all of these files must live in a partition that can be accessed by the BIOS (the files are usually located in the /boot directory, this means that only the root partition of your Linux system needs to be accessed via the BIOS).
上面说lilo调用bios来读内核,lilo在安装时计算出boot image所在的扇区,并告诉bios。看来独行侠说的有道理。
作者: windrose 发布时间: 2006-03-22
没事的,你只要记下了你的分区的磁道数,很容易恢复的。或者你备份一下MBR512字节。
作者: 独行侠 发布时间: 2006-03-24
作者: seamonkey 发布时间: 2006-03-24
而Lilo好就好在放在了MBR或分区头里,只要MBR不出问题,引导就相对很独立,简单。
作者: 独行侠 发布时间: 2006-03-24
作者: seamonkey 发布时间: 2006-03-24
作者: shannleon 发布时间: 2006-03-24
作者: seamonkey 发布时间: 2006-03-24
作者: windrose
http://gluv.univalle.edu.co/HOWTO/mini/LILO-2.html
When Lilo boots the system, it uses BIOS calls to load the Linux kernel off the disk (IDE drive, floppy or whatever). Therefore, the kernel must live in some place that can be accessed by the bios. At boot time, Lilo is not able to read filesystem data, and any pathname you put in /etc/lilo.conf is resolved at installation time (when you invoke /sbin/lilo). Installation time is when the program builds the tables that list which sectors are used by the files used to load the operating system. As a consequence, all of these files must live in a partition that can be accessed by the BIOS (the files are usually located in the /boot directory, this means that only the root partition of your Linux system needs to be accessed via the BIOS). 上面说lilo调用bios来读内核,lilo在安装时计算出boot image所在的扇区,并告诉bios。看来独行侠说的有道理。 |
用 shred 擦掉里边的内容后,还能运行不?。:ask
作者: 晨想 发布时间: 2006-03-24
作者: seamonkey
/boot不单独分区,就更无法体现了,原来的文件所在的磁盘物理位置更容易被覆盖了。
|
作者: shannleon 发布时间: 2006-03-24
Win出错的几率,似乎稍微比 Linux 高一点,对于两者都熟悉的人。
作者: 晨想 发布时间: 2006-03-24
作者: shannleon 发布时间: 2006-03-24
作者: shannleon
今天中午的时候不知道怎么回事Windows没响应,下意识地连按了三次 CTRL+ALT+F1
|
作者: biinn 发布时间: 2006-03-24
听独行侠和Windrose的解释后就清楚了
作者: soloforce 发布时间: 2006-03-24
作者: shannleon
今天中午的时候不知道怎么回事Windows没响应,下意识地连按了三次 CTRL+ALT+F1
|
原来 lilo 还有这个功能。。算灵活,还是算死板?。。。
作者: 晨想 发布时间: 2006-03-24
作者: shannleon
呃……我的意思是,即便你干掉了Linux(有意或无意),至少你还能进Windows,呵呵
|
这种情况我试过多次了。
作者: wjping119 发布时间: 2006-03-24
呃……我的意思是,即便你干掉了Linux(有意或无意),至少你还能进Windows,呵呵 |
Linux下形成的习惯带到Windows也麻烦。
呃……我的意思是,即便你干掉了Linux(有意或无意),至少你还能进Windows,呵呵 |
Linux下形成的习惯带到Windows也麻烦。
作者: seamonkey 发布时间: 2006-03-24
作者: seamonkey
grub还有个命令行呢。
Linux下形成的习惯带到Windows也麻烦。 |
作者: shannleon 发布时间: 2006-03-24
作者: seamonkey 发布时间: 2006-03-24
Grub菜单都显示不了,哪里来的命令行? |
作者: shannleon 发布时间: 2006-03-24
geometry (hd0)
root (hd0,0)
makeactive
chainloader +1
boot
这几个命令就可以引导入windows的,假定windows是在hda1上。
作者: seamonkey 发布时间: 2006-03-24
你确定你那里可以在删除Linux分区,重新格式化以后,重新启动还能使用Grub的命令行么?你是如何安装Grub的,是否有特别之处,另外你用的Grub是什么版本的?
作者: shannleon 发布时间: 2006-03-24
http://www.linuxjournal.com/article/4622
后面的评论
http://www.linuxquestions.org/questi...d.php?t=403638
问题在于,chainloader是否在载入stage2以后进行的?,但stage2是需要访问文件系统的,如果linux分区被删除,那么stage2也应该访问不了,那么导致的结果是chainloader不会成功,倒真是有些不解了。
前面的命令有些问题,对于windows应该用rootnoverify。
又搜索了一下本论坛:
http://www.linuxsir.org/bbs/showthread.php?p=1315586
http://south.linuxsir.org/bbs/showthread.php?t=121703
啊,stage1定位stage2也是通过block number而不是文件系统?
大概是这样的,反正记得grub启动软盘就是用dd做的。
stage 1是可以直接载入stage 2,这时它肯定是通过硬盘物理地址定位stage 2的,因为stage 1本身不知道任何文件系统,启动软盘就是这样的,根本没有stage 1.5的存在。
stage 1.5又起了什么作用?当stage 1不能直接定位stage 2,stage 1.5肯定起了中介作用,比如stage 2磁盘物理位置变动,因为stage 1.5可以被安装到固定的位置(stage 2太大),且能访问文件系统。那么,stage 1.5是不是始终起作用的?比如stage 2所在磁盘物理位置无变动,stage 1是不是会跳过stage 1.5而试图直接载入stage 2?
当stage 2被载入了,那么肯定是直接访问文件系统的,如果编码入其中的配置文件,比如menu.lst找不到,就直接进入grub的提示符。
作者: seamonkey 发布时间: 2006-03-24
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28