U盘启动linux系统的制作
作者 佚名技术
来源 Linux系统
浏览
发布时间 2012-04-02
llroot=/net coreutils bash SysVinit util-linux vim-enhanced 7、grub-install安装grub程序到U盘 [root@server yum.repos.d]# chroot /net bash-3.2# [root@server yum.repos.d]# chroot /net bash-3.2# grub-install /dev/sdb /dev/sdb: Not found or not a block device. bash-3.2# ls /dev/sdb ls: /dev/sdb: 没有那个文件或目录 bash-3.2# exit exit [root@server yum.repos.d]# mknod /net/dev/sdb b 8 16 [root@server yum.repos.d]# mknod /net/dev/sdb1 b 8 17 [root@server /]# rpm -q kernel-doc kernel-doc-2.6.18-128.el5 [root@server /]# rpm -ivh /var/ftp/rhel5.3/Server/kernel-doc-2.6.18-128.el5.noarch.rpm c-2.6.18-128.el5.noarch.rpm [root@server /]# gedit /usr/share/doc/kernel-doc-2.6.18/Documentation/devices.txt 8 block SCSI disk devices (0-15) 0 = /dev/sda First SCSI disk whole disk 16 = /dev/sdb Second SCSI disk whole disk 32 = /dev/sdc Third SCSI disk whole disk [root@server /]# chroot /net/ bash-3.2# grub-install /dev/sdb df: 警告:无法读取已挂上的文件系统的目录: 没有那个文件或目录 Could not find device for [root@server yum.repos.d]# cp /etc/mtab /net/etc/mtab [root@server yum.repos.d]# vim /net/etc/mtab [root@server yum.repos.d]# cat !$ cat /net/etc/mtab /dev/sdb1 / ext3 rw 0 0 [root@server yum.repos.d]# cp /etc/fstab /net/etc/ [root@server yum.repos.d]# vim /net/etc/fstab [root@server yum.repos.d]# cat !$ cat /net/etc/fstab /dev/sdb1 / ext3 defaults 1 1 [root@server /]# chroot /net bash-3.2# grub-install /dev/sdb Could not find device for /dev/mapper/* Could not find device for /dev/mapper/* Could not find device for /dev/mapper/* Installation finished. No error reported. This is the contents of the device map /boot/grub/device.map. Check if this is correct or not. If any of the lines is incorrect, fix it and re-run the script `grub-install''. (fd0) /dev/fd0 (hd0) /dev/sdb bash-3.2# bash-3.2# bash-3.2# bash-3.2# bash-3.2# sync 测试是否可以设置U盘启动并正常启动起来. 接下来解决init及登录 问题. ==================================================== [root@server ~]# df -h /net 文件系统 容量 已用 可用 已用% 挂载点 /dev/sdb1 1.9G 561M 1.2G 32% /net [root@server ~]# rpm -ivh --root=/net /var/ftp/rhel5.3/Server/passwd-0.73-1.i386.rpm error: Failed dependencies: libuser.so.1 is needed by passwd-0.73-1.i386 cp /etc/shadow /net/etc [root@server yum.repos.d]# yum -y install --installroot=/net passwd [root@server yum.repos.d]# chroot /net bash-3.2# useradd test bash-3.2# passwd test Changing password for user test. New UNIX password: BAD PASSWORD: it is WAY too short Retype new UNIX password: passwd: all authentication tokens updated successfully. bash-3.2# bash-3.2# grep root /etc/passwd root:x:0:0:root:/root:/bin/bash |
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |
你可能对下面的文章感兴趣
上一篇: 初探Linux进程管理机制下一篇: linux挂载ntfs分区的硬盘
关于U盘启动linux系统的制作的所有评论