手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Linux认证辅导:fs-增加swap

[日期:2011-12-26] 来源:Linux社区  作者:sweetsingle [字体:大 中 小]

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

//定义个级别和终端的控制文件

linux
相关资讯      
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款