如何调整LV磁盘分区大小

这次新上架一个KT服务器,官方技术还是把根目录只分区了20G,按照普通用户的习惯,所有资料都放根目录,显然空间是不够的。利用lvresize命令,可以调整LV逻辑卷大小,调整完毕后,用resize2fs更新下文件系统大小,就可以了。具体可以参考下面的操作过程。

[root@SAT18-C53-5 /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
20G 2.0G 17G 11% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 239M 33M 194M 15% /boot
/dev/mapper/rootvg-tmplv
2.9G 12M 2.8G 1% /tmp
/dev/mapper/rootvg-usrlv
20G 1.2G 18G 7% /usr
/dev/mapper/rootvg-varlv
4.8G 148M 4.5G 4% /var

lvresize -l +13232 /dev/rootvg/rootlv

[root@SAT18-C53-5 /]# lvresize -l +13232 /dev/rootvg/rootlv
Size of logical volume rootvg/rootlv changed from 20.00 GiB (640 extents) to 433.50 GiB (13872 extents).
Logical volume rootlv successfully resized

resize2fs /dev/rootvg/rootlv

[root@SAT18-C53-5 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rootvg-rootlv
427G 2.4G 403G 1% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 239M 33M 194M 15% /boot
/dev/mapper/rootvg-tmplv
2.9G 12M 2.8G 1% /tmp
/dev/mapper/rootvg-usrlv
20G 1.2G 18G 7% /usr
/dev/mapper/rootvg-varlv
4.8G 151M 4.4G 4% /var

附上pvdisplay,vgdisplay,lvdispaly信息:

继续阅读如何调整LV磁盘分区大小

linux下创建LV逻辑卷并挂载磁盘过程

买了个KT服务器,KT官方技术只给/home分了2G,也是醉了。教程参考http://jingyan.baidu.com/article/6079ad0e9d7d9e28fe86db11.html

创建PV:

扫面系统PV:pvscan

查看PV:pvdisplay

[root@DQ5620-C5-4-SAS ~]# pvscan
PV /dev/sda2 VG rootvg lvm2 [464.47 GiB / 425.47 GiB free]
Total: 1 [464.47 GiB] / in use: 1 [464.47 GiB] / in no VG: 0 [0 ]
[root@DQ5620-C5-4-SAS ~]# pvdisplay
— Physical volume —
PV Name /dev/sda2
VG Name rootvg
PV Size 464.48 GiB / not usable 16.00 MiB
Allocatable yes
PE Size 32.00 MiB
Total PE 14863
Free PE 13615
Allocated PE 1248
PV UUID pU8XYG-Au6O-vNrY-CMMa-2dzD-MuVP-ywykAh

继续阅读linux下创建LV逻辑卷并挂载磁盘过程

CentOS7单网卡绑定多IP

CentOS7越来越流行了,用CentOS7的朋友越来越多,可能有的朋友还不会在centos7系统里面,单网卡绑定多IP,今天老易以KT服务器,默认5IP的机器,来绑定一下多IP。

[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 38:60:77:bd:5c:1a brd ff:ff:ff:ff:ff:ff
inet 98.126.16.130/29 brd 98.126.16.135 scope global enp1s0
valid_lft forever preferred_lft forever
inet6 fe80::3a60:77ff:febd:5c1a/64 scope link
valid_lft forever preferred_lft forever

上面查看了下,网卡是ifcfg-enp1s0,这个可以进cd /etc/sysconfig/network-scripts里面查看机器的网卡情况。 继续阅读CentOS7单网卡绑定多IP

CentOS系统如何绑定多IP

Gateway 98.126.16.129
Broadcast Address 98.126.16.135
Usable Address 98.126.16.130 – 98.126.16.134
Subnet Mask 255.255.255.248

CentOS的话,单网卡绑定多IP,其实比较简单了。

vi /etc/sysconfig/network-scripts/ifcfg-eth0-range0

以上面提供的IP信息为例,里面写上内容:

IPADDR_START=98.126.16.131
IPADDR_END=98.126.16.134
CLONENUM_START=0
GATEWAY=98.126.16.129
NETMASK=255.255.255.248

保存好,然后重启网络服务service network restart就可以了。

[root@AT18-438 network-scripts]# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]