Linux LVM管理 【内部操作手册】

LVM 管理手册

创建PV
pvcreate /dev/sdb1
pvcreate /dev/sdc1
pvcreate /dev/sdd1
pvcreate /dev/sde1

创建VG
vgcreate mygrp /dev/sdb1 /dev/sdd1

创建LV
lvcreate -L 350G -n disk1 mygrp

格式化分区
mkfs.xfs /dev/mygrp/disk1
mount -t xfs /dev/mygrp/disk1 /mnt/disk1/

新增硬盘到VG卷
vgextend mygrp /dev/sdc1
使用vgdisplay 可以查看到新增的分区

LV分区 新增空间
lvextend -L +10G /dev/mygrp/disk1
让它生效
xfs_growfs /dev/mygrp/disk1
会显示
meta-data=/dev/mapper/mygrp-disk1 isize=256 agcount=4, agsize=22937600 blks
= sectsz=512 attr=2
data = bsize=4096 blocks=91750400, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal bsize=4096 blocks=44800, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 91750400 to 94371840
完成了

LV分区 减少空间
lvreduce -L -190G /dev/mygrp/disk1
提示信息
WARNING: Reducing active and open logical volume to 130.00 GiB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce disk1? [y/n]: y 输入y确认
Reducing logical volume disk1 to 130.00 GiB
Logical volume disk1 successfully resized

格式化 查看更改
mkfs.xfs -f /dev/mygrp/disk1
**Note with xfs filesystem It’s not posible shrink the filesystem,
you have to back up your files before the resize and format the volume.
With ext2/3 the utility resize2fs or resize4fs for ext4,
also with reiserfs you can use resize_reiserfs.

VG卷 从VG卷移除硬盘
首先移动数据
pvmove /dev/sdb1 /dev/sde1
然后 把 sdb1 移除
vgreduce mygrp /dev/sdb1
Removed “/dev/sdb1” from volume group “mygrp”
现在在移除 PV
pvremove /dev/sdb1

CentOS 配置iSCSI 远程存储 【内部操作手册】

服务器
yum -y install scsi-target-utils
/etc/init.d/tgtd restart
chkconfig tgtd on

如果没真实硬盘
使用当前文件系统建立一个镜像文件做测试
dd if=/dev/zero of=/usr/disk.img bs=1M count=512
添加设备
tgtadm –lld iscsi –op new –mode logicalunit –tid 1 –lun 1 -b /usr/disk.img
测试
tgtadm –lld iscsi –op show –mode target Continue reading “CentOS 配置iSCSI 远程存储 【内部操作手册】”

相关:

  • 需要:httpd-mmn = 20051115
  • spokenkbd
  • polep2r
  • HQEN
  • directzon
  • centos安装iscsi
  • centos iscsi服务
  • bentz54
  • bellb1j
  • 822D

cPanel服务器 修复Perl

一客户的cPanel机器悲剧了
把Perl升级到最新的版本 然后不能使用了
又让我们帮恢复

使用这个命令恢复

相关:

  • cpanel 反向代理

httpd-mmn = 20051115 is needed by mod_wsgi-3.2-3.el6.x86_64

昨天一台代维客户的cPanel机器 计划更新软件包
尝试yum update后
出现一堆依赖包错误

其中就包括
httpd-mmn = 20051115 is needed by mod_wsgi-3.2-3.el6.x86_64
这个是非常古老了 cPanel官方论坛的解释是这个非必要
然后直接删了

后面还有一堆依赖包错误
检查发现客户安装了另外几个RPM源
rpmforge是其中之一 Continue reading “httpd-mmn = 20051115 is needed by mod_wsgi-3.2-3.el6.x86_64”

相关:

  • httpd-mmn
  • httpd-mmn = 20051115 is needed by php-5 3 3-3 el6_1 3 x86_64
  • httpd-mmn = 20051115 is needed by (installed) php-5 3 3-49 el6 x86_64
  • httpd-mmn = 20051115 is needed by (installed) php-5 3 3-48 el6_8 x86_64
  • httpd-mmn = 20051115
  • weighj5o
  • hornzoq
  • feedqnh
  • facta9g
  • educationpx7

自动Kill使用太多处理器资源的进程

#!/bin/bash

# March-13-2006
# CPUuse trigger script by Noel
#
# bash code to watch a running program’s CPU usage.
# if it’s above a set value, it will auto send an email.
# You will need to set a Cron job to run this script every xx minutes
#
# Set some needed things:
#
processToWatch=”convert” # in my case I need to watch convert
emailAddress=”root@host” # this is my main emailaddress
triggerValue=90 # if the CPU use is above 90% send an email. DO NOT USE a DOT or COMMA!
tempFileName=tmp-cpu # some name of the temp file for the ps, grep data Continue reading “自动Kill使用太多处理器资源的进程”

相关:

  • aboveArchives-
  • whmcs pptp
  • Directadmin varnish
  • directadmin 使用1 4
  • directadmin 内网
  • apache error AH01215
  • DirectAdmin 链接数据库
  • DirectAdmin插件
  • processtowatchArchives-
  • directadmin 配置varnish

Posts navigation

1 2 3 4 5 6 7 8 9
Scroll to top