fdisk -l(82是虚拟内存)
[root@localhost ~]# fdisk -l
Disk /dev/sda: 85.8 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 10443 83778975 8e Linux LVM
----------------
[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
77G 2.5G 70G 4% /
/dev/sda1 99M 12M 82M 13% /boot
tmpfs 44M 0 44M 0% /dev/shm
/dev/hdc 2.9G 2.9G 0 100% /media/RHEL_5.3 i386 DVD
[root@localhost ~]#
----------------
1.新增磁盘添加swap分区
[root@localhost ~]# fdisk /dev/sda
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
更改swap分区需要:
1)n-->p-->3 添加分区
2)t-->l-->82 改变分区的id
Command (m for help): w
[root@localhost ~]# partprobe /dev/sda
#mdswap /dev/sda3
//添加到文件系统表里,系统重启时会自动加载swap分区(swap分区是没有挂载点的)
#vim /etc/fstab
/dev/sda3 swap swap defaults 0 0
[root@localhost ~]# vim /etc/inittab
//定义个级别和终端的控制文件
