快速业务通道

U盘启动linux系统的制作

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-02
********************************************************************** 如何制作一个U盘上的linux系统,并且支持启动,以下是简要过程: 1、制作成一个分区,并设置为活分区 2、制作ext3文件系统 3、安装文件系统树结构的包,filesystem,setup 4、安装grub程序包 5、kernel and initrd 6、安装程序(命令和库文件) 7、grub-install安装grub程序到U盘 ********************************************************************** 1、制作成一个分区,并设置为活分区 fdisk /dev/sdb n添加新的分区 a设置为活动分区 2、制作ext3文件系统 mkfs.ext3 /dev/sdb1 [root@server ~]# mount -t ext3 /dev/sdb1 /net [root@server ~]# df -h /net 文件系统 容量 已用 可用 已用% 挂载点 /dev/sdb1 1.9G 35M 1.8G 2% /net 3、安装文件系统树结构的包,filesystem ,setup [root@server Server]# rpm -ivh --root=/net setup-2.5.58-4.el5.noarch.rpm [root@server Server]# rpm -ivh --root=/net filesystem-2.4.0-2.i386.rpm [root@server Server]# ls /net bin etc lost found opt sbin sys var boot home media proc selinux tmp dev lib mnt root srv usr 4、安装grub程序包 [root@server boot]# rpm -ivh --root=/net --nodeps /var/ftp/rhel5.3/Server/grub-0.97-13.2.i386.rpm [root@server Server]# ls /net/sbin/grub grub grub-md5-crypt grub-install grub-terminfo [root@server Server]# ls /net/boot/grub/ 5、kernel and initrd [root@server boot]# cp /boot/vmlinuz-2.6.18-128.el5 /net/boot/ [root@server boot]# mkinitrd --with=usb-storage --with=ext3 --with=sd_mod --with=scsi_mod --with=ohci_hcd --with=ehci_hcd /net/boot/initrd-usb.img `uname -r` [root@server grub]# cat /net/boot/grub/grub.conf defaultl=0 timeout=5 title rhel5u3 usb linux for sulinux(2.6.18-128.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-128.el5 ro root=/dev/sdb1 init=/bin/bash initrd /boot/initrd-usb.img [root@server grub]# ls /net/boot/vmlinuz-2.6.18-128.el5 /net/boot/vmlinuz-2.6.18-128.el5 [root@server grub]# ls /net/boot/initrd-usb.img /net/boot/initrd-usb.img ----------------------------------------- [root@server grub]# cat /boot/grub/device.map # this device map was generated by anaconda (hd0) /dev/sda [root@server grub]# cp /boot/grub/device.map /net/boot/grub/ [root@server grub]# vim /net/boot/grub/device.map [root@server grub]# cat /net/boot/grub/device.map # this device map was generated by anaconda (hd0) /dev/sdb 6、安装程序(命令和库文件) +++++++++++++++++++++++++++++++++++ [root@server yum.repos.d]# pwd /etc/yum.repos.d [root@server yum.repos.d]# cp rhel-debuginfo.repo xx.repo [root@server yum.repos.d]# vim xx.repo [root@server yum.repos.d]# cat xx.repo [base] name=Red Hat Enterprise Linux baseurl=file:///var/ftp/rhel5.3/Server enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release +++++++++++++++++++++++++++++++++++ [root@server /]# yum -y install --insta

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号