考试网 >> IT认证 >> Linux >> Linux指导 >> 如何在移动驱动器上安装Linux

如何在移动驱动器上安装Linux

发布时间:2006-06-28 11:09     点击:
分页:上一页  1 2 3 4 5 [6] 7 8  下一页

这在各种环境中都有用,但是为了便于说明,我们将仅使用我们的迷你环境重新扫描SCSI总线,等待外置磁盘被识别,然后切换为使用该磁盘作为真实的根继续引导。

为了使用这种方法,我们需要创建两项,内核和initrd映像。

内核就是具有内置initrd支持的普通内核。initrd映像是包含我们的迷你根文件系统的回送文件系统映像(此映像可以使用gzip进行压缩以减少其大小)。

有关创建或定制自己的initrd映像的详细信息,可以查看参考资料部分。

在initrd映像中,有一个名为linuxrc的文件。当加载initrd时会执行此文件,所以确保其具有执行权限!我们为了进行说明,所以 linuxrc非常简单:

清单 1. initrd linuxrc

#!/bin/sh

REAL_ROOT=/dev/sda1

# mount the /proc filesystem

mount -t proc none /proc

#for scsi-emulation

# modprobe sd_mod

#for pcmcia

# modprobe pcmcia_core

#for FireWire

# modprobe ieee1394

# modprobe ohci1394

# modprobe raw1394

# modprobe sbp2

#for USB

# modprobe usbcore

# modprobe ohci-hcd

# modprobe uhci-hcd

# modprobe usb-storage

# loop rescanning the scsi bus + rerunning devfsd

retries=5

i=1

until [ -e $REAL_ROOT ]

do

if [ $i -gt $retries ]

then

echo "Unable to mount real root ($REAL_ROOT) - Giving up!"

/bin/ash

exit

fi

echo "Real root ($REAL_ROOT) not found, retrying ($i)"

sleep 1
分页:上一页  1 2 3 4 5 [6] 7 8  下一页
版权申明:未经书面授权请勿转载本站信息!!作品版权归所属媒体与作者所有!!
发表评论: 匿名发表 用户名: 查看评论
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容
本站提醒:不要进行人身攻击。谢谢配合。
在本站搜索相关信息
2003-2005 Ksw123.com All Rights Reserved. - TOP
Copyright © 2006 Ksw123.com. All rights reserved.中国考题网 版权所有