add swap using directory on rhel5


“df -h”查看一下在现有的磁盘分区中,哪个分区的空间比较空闲?
从/dev/mapper/VolGroup00-LogVol00上取一部分磁盘空间,然后输出出来给”/root/swapfile01”,block size=1k,取count次,总共2G
[root@rhel5u4test ~]# dd if=/dev/mapper/VolGroup00-LogVol00 of=/root/swapfile01 bs=1k count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 97.3524 seconds, 21.5 MB/s

dd之前,磁盘分区的情况如下:
[root@rhel5u4test ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
38G  4.6G   32G  13% /
/dev/mapper/VolGroup00-LogVol02
38G  2.4G   34G   7% /opt
/dev/sda1             190M   12M  169M   7% /boot
tmpfs                 506M     0  506M   0% /dev/shm

dd过后:
[root@rhel5u4test ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
38G  6.6G   30G  19% /
/dev/mapper/VolGroup00-LogVol02
38G  2.4G   34G   7% /opt
/dev/sda1             190M   12M  169M   7% /boot
tmpfs                 506M     0  506M   0% /dev/shm

2G的空间已经取走了。

把/root/swapfile01搞成swap
[root@rhel5u4test ~]# mkswap /root/swapfile01
Setting up swapspace version 1, size = 2097147 kB
把刚刚创建的swap激活起来
[root@rhel5u4test ~]# swapon /root/swapfile01
[root@rhel5u4test ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
38G  6.6G   30G  19% /
/dev/mapper/VolGroup00-LogVol02
38G  2.4G   34G   7% /opt
/dev/sda1             190M   12M  169M   7% /boot
tmpfs                 506M     0  506M   0% /dev/shm
查看swap分区的情况,发现变成4047了,我随后swapoff掉,看看原来是多大
[root@rhel5u4test ~]# free -m
total       used       free     shared    buffers     cached
Mem:          1010        992         18          0        328        558
-/+ buffers/cache:        105        904
Swap:         4047         30       4017
swapoff之后,发现原来没增加swap之前,大小是2047
[root@rhel5u4test ~]# swapoff /root/swapfile01
[root@rhel5u4test ~]# free -m
total       used       free     shared    buffers     cached
Mem:          1010        991         19          0        328        558
-/+ buffers/cache:        105        905
Swap:         2047         30       2017
好了,整个用文件夹当swap的过程就结束了,可能收尾的工作就是/etc/fstab的事情。你可以试试reboot服务器之后
看看swap是否还能生效,如果失效,可能需要/etc/rc.local这样去加脚本,或者就是/etc/fstab里面加内容

oracle 10.2.0.1 install on rhel5 x86的相关问题

在rhel5 x86上安装oracle 10.2.0.1的时候一直顾虑缺少rpm包的问题,在doc上发现需要如下的rpm包
binutils-2.15.92.0.2-13.EL4
compat-db-4.1.25-9
compat-libstdc++-296-2.96-132.7.2
control-center-2.8.0-12
gcc-3.4.3-22.1.EL4
gcc-c++-3.4.3-22.1.EL44
glibc-2.3.4-2.9
glibc-common-2.3.4-2.9
gnome-libs-1.4.1.2.90-44.1
libstdc++-3.4.3-22.1
libstdc++-devel-3.4.3-22.1
make-3.80-5
pdksh-5.2.14-30
sysstat-5.0.5-1
xscreensaver-4.18-5.rhel4.2
setarch-1.6-1
其中gnome-libs的包很麻烦,去google上找了类似的gnome-libs包,打上总是会报dependecy的错误
error: Failed dependencies:
ORBit is needed by gnome-libs-1.4.1.2.90-24.2.i386
imlib is needed by gnome-libs-1.4.1.2.90-24.2.i386
libgdk_imlib.so.1 is needed by gnome-libs-1.4.1.2.90-24.2.i386
libIIOP.so.0 is needed by gnome-libs-1.4.1.2.90-24.2.i386
libORBitCosNaming.so.0 is needed by gnome-libs-1.4.1.2.90-24.2.i386
libORBit.so.0 is needed by gnome-libs-1.4.1.2.90-24.2.i386
libORBitutil.so.0 is needed by gnome-libs-1.4.1.2.90-24.2.i386
libpng.so.2 is needed by gnome-libs-1.4.1.2.90-24.2.i386
没办法,在缺少这个包的情况下硬着头皮上,尽然安装+建库成功,没有任何的问题。
此次安装主要解决了两个疑惑:
1.gnome-libs在rhel5 x86上安装oracle的时候,缺少也没有关系
2.内核参数、limits如果不手工更改,oracle安装的时候不会自己帮你更改,所以还是手动更改吧