海运的博客

CentOS6调整LVM SWAP分区大小

发布时间:December 25, 2012 // 分类:CentOS,LVM // No Comments

通过网络TXT模式给XenServer制作Centos6模板时不能自定义分区,安装完成后SWAP有点大,有点浪费系统有限的空间,记录下缩小LVM SWAP过程。
查看当前LVM卷:

lvscan 
  ACTIVE            '/dev/VolGroup00/LogVol00' [37.88 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [2.00 GB] inherit

查看当前挂载的SWAP分区:

swapon -s
Filename                Type        Size    Used    Priority
/dev/mapper/VolGroup00-LogVol01         partition    2097144    0    -1

调整SWAP所在LV大小:

lvreduce -L 512M /dev/mapper/VolGroup00-LogVol01 
#调整为512M大小,也可使用+/-

重新挂载SWAP:

swapoff -a
#关闭SWAP
mkswap /dev/mapper/VolGroup00-LogVol01
#重新创建调整过的LV为SWAP
swapon /dev/mapper/VolGroup00-LogVol01
#开启SWAP

扩充剩余的PE到主分区LV:

lvresize -l +48  /dev/mapper/VolGroup00-LogVol00
resize2fs /dev/mapper/VolGroup00-LogVol00

调整后的LV卷:

lvscan 
  ACTIVE            '/dev/VolGroup00/LogVol00' [39.38 GB] inherit
  ACTIVE            '/dev/VolGroup00/LogVol01' [512.00 MB] inherit

Centos第三方软件源RepoForge

发布时间:August 4, 2012 // 分类:CentOS // No Comments

RepoForge源可以做为Centos官方EPEL源的补充,这样Centos下常用软件基本都可使用yum安装了。
Centos5:

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

Centos6:

rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -ivh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

国内使用sohu提供的镜像:

cat > /etc/yum.repos.d/mirrors-rpmforge <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/rpmforge
EOF
cat > /etc/yum.repos.d/mirrors-rpmforge-extras <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/extras
EOF
cat > /etc/yum.repos.d/mirrors-rpmforge-testing <<EOF
http://mirrors.sohu.com/dag/redhat/el6/en/$ARCH/testing
EOF

Centos安装EPEL扩展源。

发布时间:March 17, 2012 // 分类:CentOS // No Comments

Centos官方很多软件都没有,编译安装又比较麻烦,可以安装EPEL源解决此问题。
EPEL即Extra Packages for Enterprise Linux,也就是为企业级 Linux提供的扩展软件源,适用于 RHEL,CentOS,Scientific Linux系统。
Centos5安装

rpm -ivh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

centos6安装

rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Centos7安装:

rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

国内访问修改为sohu提供的镜像:

cat > /etc/yum.repos.d/epel.repo <<EOF
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
baseurl=http://mirrors.sohu.com/fedora-epel/6/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
baseurl=http://mirrors.sohu.com/fedora-epel/6/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
EOF
分类
最新文章
最近回复
  • crowjin: 你确定这能过滤??不是所有请求都返回空地址::?
  • : linux系统上单个网卡多条宽带拨号获取公网IP,外网可以访问这些IP,有偿! Q:25299...
  • 硅谷少年: 非常有用,感谢分享
  • spartan2: https://dashboard.hcaptcha.com/welcome_accessib...
  • 海运: 应该能,在购买页面先手工跳过cf机器验证,后续一定时间内不更换ip应该不会再次验证。
  • spartan: 大佬斯巴达开启了CF的机器识别验证,请问插件能自动跳过吗? 另外这个脚本有没有简单使用说明,新...
  • vincent: 膜拜大佬
  • 海运: proxy-header或proxy_protocol
  • liangjw: 如果是 内部调用 或者 中间存在 代理 而上一个代理又在内网 ,那怎么处理来自代理私有IP?
  • chainofhonor: 感谢,用dnsmasq设置自动判断BIOS和UEFI成功了