Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1615040
  • 博文数量: 409
  • 博客积分: 6240
  • 博客等级: 准将
  • 技术积分: 4908
  • 用 户 组: 普通用户
  • 注册时间: 2011-06-01 00:04
文章分类

全部博文(409)

文章存档

2021年(1)

2019年(1)

2017年(1)

2016年(13)

2015年(22)

2013年(4)

2012年(240)

2011年(127)

分类: LINUX

2012-01-16 20:53:09

#继续从其他地方迁移博客
1.在32位系统下扩展内存,让系统可以使用大的内存空间(2^32=4GB),安装完毕kernel-PAE,修改/boot/grub/grub.conf,重启服务器即可。还有grub.conf的详解。
2.王集root密码,这个搞过好几次了,老忘记。。。
3.yum的高端用法,毕竟大家都是不想花钱,又想使用redhat,安装软件没那么容易啊!
------------------------
Grub 的配置文件位于 "/boot/grub/grub.conf", 更改后将对以后的每次启动有效。 此配置文件可分为两个大的部分:全局配置和菜单项配置(好比win开机选择Windows xp professional、一键ghost,或者其他系统的引导菜单):
      A. 全局配置命令
            全局配置命令从配置文件最上方到第一个 "title" 命令之前结束(语法格式)。
            default 0
            timeout 10
            splashimage (hd0,2)/boot/grub/splash.xpm.gz
            password --md5 $1$tBWhgwVY$sIzNYKY/iV9rZ4keYAkaQ/ #设置了密码的才有此项
            a. default 菜单号: 指定 Grub 默认启动项(默认引导的系统), 菜单号从0 开始, 0 表示下面的第一个菜单项(i即表示下面第i+1个菜单的第一启动优先级)。当与 "savedefault" 命令同时使用时可以有 "default saved" 的特殊格式, 表示默认由 "savedefault" 所保存过的菜单项。
            b. timeout seconds: 从 Grub 启动界面出现到以默认启动项引导系统之间等待用户选择的时间。
            c. splashimage full_path_of_xpm_or_xpm.gz: 指定启动菜单的背景文件(xpm 图像或其gzip 压缩文件)。
      B. 菜单项配置
            从”title”开始到下一个 "title" 之前为一个启动菜单项, 即引导一个操作系统所需的参数。Grub 对不同的操作系统有不同的引导方式, 对 Linux 系统 Grub 可直接加载其内核并启动; 对Windows/Solaris 系统 Grub 不能直接加载其系统核心文件进行引导, 而是通过调用 Windows 自身的启动引导器, 通常为 Windows 所在分区的引导扇区(不是整个硬盘的首扇区 MBR)。
            a. 配置Linux 的启动菜单项 (以 RedHat Linux 9 和 OpenDesktop 1.0 ()为例):
                  i. RedHat Linux 9:
                  title Red Hat Linux (2.1.20-8)
                  root (hd0,0)
                  kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
                  initrd /boot/initrd-2.4.20-8.img
                  title: 定义启动菜单项的名称
                  root: 设置 Grub 的根设备 (root)为 Linux 内核所在分区
                  kernel: 后跟 Linux 内核文件为参数, 加载 Linux 内核文件
                  initrd: 加载镜像文件
                  ii. OpenDesktop 1.0:
                  title OpenDesktop 1.0 (2.4.22-1.3)
                  root (hd0, 4)
                  knernel /boot/vmlinuz-2.4.22-1.3.OpenDesktop.1.nptl ro root=/dev/hda4 vga=791 splash=silent
                  initrd /boot/initrd-2.4.22-1.3.OpenDesktop.1.nptl.img
            b. 配置非Linux 的启动菜单项(以Windows 2000 为例, 其它非Linux 系统也类似, 如Solaris 10 x86):
            title Microsoft Windows 2000 Professional
            rootnoverify (hd0,0)
            chainloader +1
            rootnoverify: 设置 Grub 的根设备(root)为 Windows 系统所在分区, 但不加载文件系统。
            Chainloader: 调用 Windows 分区的引导器引导 Windows 系统 
------------------------
[root@testcms ~]# cat  /boot/grub/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-194.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00
 initrd /initrd-2.6.18-194.el5.img
[root@testcms ~]#
-----------------------------------------------
[root@testcms ~]# yum -y install kernel-PAE
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * rpmforge: fr2.rpmfind.net
 * updates: mirrors.163.com
addons                                                                    |  951 B     00:00     
base                                                                      | 1.1 kB     00:00     
extras                                                                    | 2.1 kB     00:00     
rpmforge                                                                  | 1.1 kB     00:00     
rpmforge/primary                                                          | 4.0 MB     00:03     
rpmforge                                                                             11027/11027
updates                                                                   | 1.9 kB     00:00     
updates/primary_db                                                        | 196 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-PAE.i686 0:2.6.18-274.3.1.el5 set to be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================
 Package               Arch            Version                          Repository          Size
=================================================================================================
Installing:
 kernel-PAE            i686            2.6.18-274.3.1.el5               updates             18 M
Transaction Summary
=================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)
Total download size: 18 M
Downloading Packages:
kernel-PAE-2.6.18-274.3.1.el5.i686.rpm                                    |  18 MB     00:02     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : kernel-PAE                                                                1/1
Installed:
  kernel-PAE.i686 0:2.6.18-274.3.1.el5                                                          
Complete!
[root@testcms ~]#
-----------------------------
[root@testcms ~]# cat  /boot/grub/grub.conf 
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
#          initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title ed Hat Enterprise Linux AS (2.6.18-274.3.1.el5PAE)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-274.3.1.el5PAE ro root=/dev/VolGroup00/LogVol00
 initrd /initrd-2.6.18-274.3.1.el5PAE.img
title CentOS (2.6.18-194.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00
 initrd /initrd-2.6.18-194.el5.img
[root@testcms ~]# 
------------------------------------
[root@testcms ~]# cat /etc/redhat-release 
ed Hat Enterprise Linux AS release 4
[root@testcms ~]#
//修改default=0,init 6 重启系统,然后就可以了,查看是否配置成功的方法,看起读秒,查看这个界面:
 

 -----------------------------------------------------------------------------------------------------------------------------------------------------------------
2011-12-05

 我在我32位的虚拟机里面弄过之后,这次就再也开不了机了。。。
提示:memory crash for kernel (0x0 0x0) nowwithin permissible range

网上说是个警告,没事儿,但是还是不行,想试试百度一哥们的方法,还没来的及试。方法是:
在我平时进入单用户模式的时候(重新设置root密码、输入single 的时候),输入:crashkernel=128M@16M
然后启动。

-------------//
linux忘记root密码,重启系统,在启动出来“red hat Linux”的时候(这个时候系统读秒),按e,出现boot和kernel(还有项,共三项)的时候,选中kernel,按e,在新出来的界面,按空格,然后出入single,回车,进入单用户模式,重新设置password。
-----------------------
¥excel转置:复制,邮件,选择性粘贴,转置,确定,ok!

----------------------------------
yum的高端用法,前面已经写过一篇在redhat下配置免费的yum服务,但是服务是经常更新的,还是会有很多软件包不容易找到,用下面的方法就可以解决在redhat下安装软件的难题。当然你会说挂在光盘,但是毕竟光盘不是侬想挂就就有就可以挂的啊!
-------------------
/var/cache/yum/updates/packages/kernel-PAE-2.6.18-274.3.1.el5.i686.rpm  
whereis yum.conf   find / -name "" -type f
配置yum.conf
[root@testcms cache]# cat /etc/yum.conf 
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h
# Default.
# installonly_limit = 3
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[root@testcms cache]# 
//将keepcache的值改为1,这样,yum下载的软件包就会保存到相应的目录下面了。用这种方法,就可以解决redhat下面的软件找不到,通过centos找就可以了!!!

-----------------------------------------------------------------------------------------------------------------------------------------------------------------
2011-12-05 
面对上面的yum的写法,自己当时觉得很牛逼,关键当时想这个问题很久了,终于找到这个方法,其实很傻很天真。。。今天在群里看一个很犀利的哥们的一句话,豁然开朗,其实没必要这么麻烦。。。对于centos分为两步:
1.[root@testcms ~]# yum -y install yum-downloadonly

2.测试一下:
[root@testcms ~]# yum  -y install vsftpd --downloadonly --downloaddir=/home/kaige/

[root@testcms ~] ll vsftpd-2.0.5-21.el5.i386.rpm 

-rw-r--r-- 1 root root 145229 Sep  4 03:03 vsftpd-2.0.5-21.el5.i386.rpm

ok,下载完成!!!
阅读(1297) | 评论(0) | 转发(0) |
0

上一篇:风险管理

下一篇:redhat 5.4 免费yum的使用

给主人留下些什么吧!~~