10年工作经验,专研网站运维。
全部博文(454)
分类: LINUX
2012-04-16 16:23:11
[root@pilot12b ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 287G 132G 140G 49% /
/dev/sda1 251M 16M 222M 7% /boot
tmpfs 2.0G 960M 1.1G 49% /dev/shm
/dev/sdb1 459G 253G 183G 59% /storage
/RHEL5.7.iso 3.1G 3.1G 0 100% /mnt/iso
1. 在/storage目录下增加交换文件:
[root@pilot12b ~]# dd if=/dev/zero of=/storage/swap bs=1024 count=2048000
2048000+0 records in
2048000+0 records out
2097152000 bytes (2.1 GB) copied, 10.3428 seconds, 203 MB/s
2. 查看交换文件:
[root@pilot12b ~]# ls /storage/
lost+found R12
Oracle E-Business Suite Release 12.1.1 Update Media Pack v1 for Linux x86 R12-install-file
Oracle Strategic Network Optimization 12.1.3 standalone v1 Media Pack swap
3. 生成交换分区:
[root@pilot12b ~]# mkswap /storage/swap
Setting up swapspace version 1, size = 2097147 kB
[root@pilot12b ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 287G 132G 140G 49% /
/dev/sda1 251M 16M 222M 7% /boot
tmpfs 2.0G 960M 1.1G 49% /dev/shm
/dev/sdb1 459G 255G 181G 59% /storage
/RHEL5.7.iso 3.1G 3.1G 0 100% /mnt/iso
[root@pilot12b ~]# fdisk -l
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 33 265041 83 Linux
/dev/sda2 34 288 2048287+ 82 Linux swap / Solaris
/dev/sda3 289 38913 310255312+ 83 Linux
Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 60801 488384001 8e Linux LVM
[root@pilot12b ~]#
4. 启用交换分区:
[root@pilot12b ~]# swapon /storage/swap
[root@pilot12b ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 287G 132G 140G 49% /
/dev/sda1 251M 16M 222M 7% /boot
tmpfs 2.0G 960M 1.1G 49% /dev/shm
/dev/sdb1 459G 255G 181G 59% /storage
/RHEL5.7.iso 3.1G 3.1G 0 100% /mnt/iso
[root@pilot12b ~]#
5. 查看交换分区:
[root@pilot12b ~]# free -m
total used free shared buffers cached
Mem: 3976 3823 152 0 13 3263
-/+ buffers/cache: 546 3429
Swap: 4000 0 4000
6. 设置开机启用交换分区:
[root@pilot12b ~]# vim /etc/fstab