海运的博客

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安装

#http://www.haiyun.me
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
分类
最新文章
最近回复
  • 海运: 正常情况下编译整个内核执行make menuconfig后就不会出现此提示,当单独编译单个模块...
  • oijq: 就是用的armbian的配置文件哈,按你的教程做的,在执行make LOCALVERSION=...
  • 海运: 使用armbian的配置文件,其它添加或修改自己懂的部分,不懂的就不要碰了。
  • oijq: 编译时这些选项全部选Y吗?Actions Semi Platforms (ARCH_ACTIO...
  • 海运: n1编译bbr内核模块参考这个:https://www.haiyun.me/archives/...
  • jiqz: make M=net/ipv4/ CONFIG_TCP_CONG_BBR=m modules编...
  • ruralhunter: 哦,文档里应该是对的,是.config
  • ruralhunter: cp /mnt/boot/config-4.18.7-aml-s9xxx .config这里应...
  • 海运: 你是编译不成功呢?还是编译后不能运行呢?还是运行后不能访问web界面呢?
  • 白墨: 可能不清楚就是编译安装后启动后访问不了web界面