gaga 发表于 2005-4-6 16:30

Linux 装在USB硬盘上启动速度缓慢?

在USB活动硬盘上装了一个Linux,这样插在别的计算机上重启动就可以进入自己的‘活动’linux系统。

问题是Lilo菜单下选择编译好的kernel映像后,回车开始装载的时候极其缓慢,“Loading”后面每显示一个.号大概要1到2秒(根据机子的不同有差别),整个过程要半分钟到一分钟。而同样的机子启动IDE硬盘上的Linux系统总是1秒不到就装载完毕。

有谁知道原因吗?如果是BIOS的问题,为什么启动硬盘里的就快?而USB2.0硬盘上的Linux启动虽然慢,可是kernel装载完毕后运行速度却没有影响,感觉不到差异。

oUo 发表于 2005-4-7 11:49

niu!
I would like to make it too, How do U make it? How big should the USB-Disk be?

3x!

gaga 发表于 2005-4-7 12:40

问题出在Lilo的CMOS data checking,不过仍然不清楚为什么ide盘会快很多,懒得去跟踪代码,直接换了grub,启动速度减少到3到5秒,基本可以忍受。

不过grub装在usb盘的mbr上后,将ide硬盘识别成第二硬盘,导致win/dos无法启动,而grub提供的map解决办法似乎不起作用,好像grub文档里都是在ide硬盘之间map来map去,没提到usb/scsi盘是否存在问题。

关于USB Linux的安装,网上可以搜到很多相关资料。主要问题是USB盘的驱动初始化速度慢而导致kernel引导过程中无法及时mount usb盘的root。目前两个主要的解决办法一是修改kernel的引导程序,不断重试加载usb root区;二是启动映像里增加initrc模块,采用人工延时数秒的方式等待usb驱动的装载完成。

建议第一种方式,比较灵活。

gaga 发表于 2005-4-7 13:05

Originally posted by oUo at 2005-4-7 12:49
niu!
I would like to make it too, How do U make it? How big should the USB-Disk be?

3x!

it depends. could be couple of mega up to giga
my steps are:
1, hack a kernel to solve the usb driver loading problem. and compile it.
2, mount your usb disk, install a 'normal' system from your linux installation cdroms.
3, copy the hacked kernel image to the usb disk. install and configure the grub so that the new kernel can be load
4, copy the other modules which are not compiled statically into the hacked kernel.
5, boot it.

after u get a bootable usb linux box, it's always a good idea to have the latest kernel source installed since probably u'll need to add some new modules/drivers for different hardware platforms.

gaga 发表于 2005-4-7 16:57

有时间我找个新盘重做一次,全部详细过程贴上来。这两天忙。

文选流氓 发表于 2005-4-8 11:56

嗯,好,弄好了把新硬盘寄给我,我也省得自己折腾了,嘿嘿嘿。蛋壳蛋壳:)

gaga 发表于 2005-4-8 17:05

Originally posted by 文选流氓 at 2005-4-8 12:56
嗯,好,弄好了把新硬盘寄给我,我也省得自己折腾了,嘿嘿嘿。蛋壳蛋壳:)
寄一纸条,写仨大字 “新 硬 盘”
比特比特
页: [1]
查看完整版本: Linux 装在USB硬盘上启动速度缓慢?