Linux
Linux

lvm-扩容


LVM逻辑卷管理器

建立pv; pvcreate xx
加入vg,可以指定名称;vgcreate vg-zjg /dev/sdb1
建立逻辑券lv,可指定大小,可指定名称 lvcreate -l 100%VG lv-zjg vg-zjg

扩容:
vgextend vg-zjg /dev/sdb2
lvextend -L +5G /dev/vg-zjg/lv-zjg
resize2fs /dev/vg-zjg/lv-zjg

Linux 2>&1

主要是中间的 2>&1的意思
这个意思是把标准错误(2)重定向到标准输出中(1),而标准输出又导入文件output里面, www.2cto.com
所以结果是标准错误和标准输出都导入文件output里面了。
至于为什么需要将标准错误重定向到标准输出的原因,那就归结为标准错误没有缓冲区,而stdout有。
这就会导致 >output 2>output 文件output被两次打开,而stdout和stderr将会竞争覆盖,这肯定不是我门想要的.

这就是为什么有人会写成:
nohup ./command.sh >output 2>output出错的原因了

Redhat 安装 httpd

yum -y install httpd 
#停止firewall
systemctl stop firewalld.service
#禁止firewall开机启动
systemctl disable firewalld.service

Redhat 7.2 grub 设置内核启动顺序

查看可以修改的内核选项
cat /boot/grub2/grub.cfg |grep menuentry

修改默认内核
grub2-set-default "Red Hat Enterprise Linux Server (4.4.0) 7.2 (Maipo)"

验证是否成功,并重启服务器
grub2-editenv list
saved_entry=Red Hat Enterprise Linux Server (4.4.0) 7.2 (Maipo)

Redhat 7.2更新yum 源

vi /etc/yum.repos.d/rhel-Base.repo

#CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$7 - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates
[updates]
name=CentOS-$7 - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$7 - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$7&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$7 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7