centos BBS,centos官网

CentOS系统中lvcreate命令的常见用法详解

4个 lvcreate常用命令举例

逻辑卷管理(LVM)是广泛使用的技术,并拥有极其灵活磁盘管理方案。主要包含3个基础命令:

创建物理卷使用pvcreate

创建卷组并给卷组增加分区vgcreate

创建新的逻辑卷使用lvcreate

下列例子主要讲述在已经存在的卷组上使用lvcreate创建逻辑卷。lvcreate命令可以在卷组的可用物理扩展池中分配逻辑扩展。通常,逻辑卷可以随意使用底层逻辑卷上的任意空间。修改逻辑卷将释放或重新分配物理卷的空间。这些例子已经在CentOS 5, CentOS 6, CentOS 7, RHEL 5, RHEl 6和 RHEL 7版本中测试通过。

4个lvcreate命令例子

在名为vg_newlvm的卷组中创建15G大小的逻辑卷:

复制代码代码如下:[root@centos7~]# lvcreate-L 15G vg_newlvm

在名为vgnewlvm的卷组中创建大小为2500MB的逻辑卷,并命名为centos7newvol,这样就创建了块设备/dev/vgnewlvm/centos7newvol:

复制代码代码如下:[root@centos7~]# lvcreate-L 2500-n centos7_newvol vg_newlvm

可以使用lvcreate命令的参数-l来指定逻辑卷扩展的大小。也可以使用这个参数以卷组的大小百分比来扩展逻辑卷。这下列的命令创建了centos7newvol卷组的50%大小的逻辑卷vgnewlvm:

复制代码代码如下:[root@centos7~]# lvcreate-l 50%VG-n centos7_newvol vg_newlvm

使用卷组剩下的所有空间创建逻辑卷

复制代码代码如下:[root@centos7~]# lvcreate--name centos7newvol-l 100%FREE vgnewlvm

更多帮助,使用lvcreate命令--help选项来查看:

复制代码代码如下:[root@centos7~]# lvcreate--help

lvcreate: Create a logical volume(创建逻辑卷)

lvcreate

[-A|--autobackup{y|n}](自动备份)

[-a|--activate [a|e|l]{y|n}]

[--addtag Tag](增加标签)

[--alloc AllocationPolicy](分配策略)

[--cachemode CacheMode](Cache模式)

[-C|--contiguous{y|n}]

[-d|--debug]

[-h|-?|--help]

[--ignoremonitoring](忽略监控)

[--monitor{y|n}](监控)

[-i|--stripes Stripes [-I|--stripesize StripeSize]]

[-k|--setactivationskip{y|n}]

[-K|--ignoreactivationskip]

{-l|--extents LogicalExtentsNumber[%{VG|PVS|FREE}]|(逻辑扩展数)

-L|--size LogicalVolumeSize[bBsSkKmMgGtTpPeE]}(逻辑卷大小)

[-M|--persistent{y|n}] [--major major] [--minor minor]

[-m|--mirrors Mirrors [--nosync] [{--mirrorlog{disk|core|mirrored}|--corelog}]](镜像)

[-n|--name LogicalVolumeName](逻辑卷名字)

[--noudevsync]

[-p|--permission{r|rw}]

[--[raid]minrecoveryrate Rate]

[--[raid]maxrecoveryrate Rate]

[-r|--readahead ReadAheadSectors|auto|none](读取头扇区)

[-R|--regionsize MirrorLogRegionSize](镜像逻辑区域尺寸)

[-T|--thin [-c|--chunksize ChunkSize](块大小)

[--discards{ignore|nopassdown|passdown}]

[--poolmetadatasize MetadataSize[bBsSkKmMgG]]]

[--poolmetadataspare{y|n}]

[--thinpool ThinPoolLogicalVolume{Name|Path}](精简池逻辑卷)

[-t|--test]

[--type VolumeType](卷类型)

[-v|--verbose]

[-W|--wipesignatures{y|n}]

[-Z|--zero{y|n}]

[--version]

VolumeGroupName [PhysicalVolumePath...]

centos7.x下美国主机安装宝塔面板教程

一、前往宝塔官网 bt.cn/new/download.html,下载“宝塔SSH终端”并解压安装。

二、在终端中输入美国云主机的IP地址和登录密码,保存并连接。

三、执行宝塔安装代码 bt.cn/bbs/thread-19376-...

若以上节点无法使用,请使用以下备用节点:备用节点【香港】:(香港主机不推荐)备用节点【美国】:(宝塔推荐使用价格厚道,高性能的欧路云服务器安装)复制美国节点的安装代码,粘贴并回车运行。

提示:Do you want to install Bt-Panel to the/www directory now?(y/n):输入:y,然后回车。

安装错误提示:Installing collected packages: pycparser, cffi, cryptography, pyOpenSSl ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.... You should consider upgrading via the'/www/server/panel/pyenv/bin/python3.7-m pip install--upgrade pip' command.

安装完成提示:Complete! success

Congratulations! Installed successfully!

外网面板地址: 46.33.11.151:31889/c618...

内网面板地址: 46.33.11.151:31889/c618...

username: y8ex5ehu

password: 14592e7d

If you cannot access the panel, release the following panel port [31889] in the security group

若无法访问面板,请检查防火墙/安全组是否有放行面板[31889]端口

因已开启面板自签证书,访问面板会提示不匹配证书,请参考以下链接配置证书 bt.cn/bbs/thread-105443...

面板安装完成,接下来是面板使用。登录后提示选择一键安装,结束后查看执行日志。若安装LNMP失败,打开SSL终端执行echo'128.1.164.196 download.bt.cn'>>/etc/hosts,然后重新安装LNMP。

附:面板疑难问题 bt.cn/bbs/thread-87257-...

本文转载自:centos7.x下美国主机安装宝塔面板教程- icmarkets

CentOS7实现DNSDHCP动态更新详解

windows域里有一个功能,dhcp把新分发的ip数据发给DNS服务器,这样只要知道一个人的电脑名字就可以很方便的远程。

linux当然也能很好的实现类似的功能。man 5 dhcpd.conf有详细描述。

昨天运维帮组织线下的沙龙,又拍云的运维总监邵海杨先生分享了一句“千金难买早知道”。是啊,就在实现动态更新的功能上,在网上找了不少博客,照着做又遇到各种问题,最后不不知道到底什么原理实现的。早知道认真看一下man,问题早解决了,对实现的原理也理解得深些。所以,在这个信息爆炸的时代,很多时候真的互联网没有让人更聪明,反而大量的信息经常把人淹没了。技术,还是需要静下心来去钻研的。

dhcp和dns的基本配置资料比较完善,此处不再赘述。有心的朋友认真看一下man 5 dhcpd.conf,瞧一眼下面配置中标红的部分,相信就能搞定了。

另外分享一个dns chroot的流程,先安装 bind,调通named,然后再安装bind-chroot

执行/usr/libexec/setup-named-chroot.sh/var/named/chroot on

停用named,启用named-chroot即可

systemctl disabled named; systemctl stop named

systemctl enable named-chroot;systemctl start named-chroot

[root@pxe~]# cat/etc/dhcp/dhcpd.conf

ddns-update-style interim;

ddns-updates on;

do-forward-updates on;

allow client-updates;

allow bootp;

allow booting;

#allow client-updates;

option space Cisco_LWAPP_AP;

option Cisco_LWAPP_AP.server-address code 241= array of ip-address;

option space pxelinux;

option pxelinux.magic code 208= string;

option pxelinux.configfile code 209= text;

option pxelinux.pathprefix code 210= text;

option pxelinux.reboottime code 211= unsigned integer 32;

option architecture-type code 93= unsigned integer 16;

subnet 192.168.1.0 netmask 255.255.255.0{

authoritative;

option routers 192.168.1.1;

option subnet-mask 255.255.255.0;

option broadcast-address 192.168.1.255;

option domain-name"it.lab";

option domain-name-servers 192.168.1.200;

range dynamic-bootp 192.168.1.100 192.168.1.199;

key SEC_DDNS{

algorithm hmac-md5;

secret 7ObhTIhKeDFMR2SbbS5s8A==;

};

ddns-domainname"it.lab";

zone it.lab.{

primary 192.168.1.200;

key SEC_DDNS;

}

zone 1.168.192.in-addr.arpa.{

primary 192.168.1.200;

key SEC_DDNS;

}

default-lease-time 600;

max-lease-time 7200;

class"pxeclients"{

match if substring(option vendor-class-identifier, 0, 9)="PXEClient";

next-server 192.168.1.200;

if option architecture-type= 00:07{

filename"uefi/syslinux.efi";}

else{

filename"bios/pxelinux.0";}

#filename"pxelinux.0";}

}

}

[root@pxe~]# cat/etc/named.conf

//

// named.conf

//

// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS

// server as a caching only nameserver(as a localhost DNS resolver only).

//

// See/usr/share/doc/bind*/sample/ for example named configuration files.

//

options{

listen-on port 53{ 127.0.0.1;192.168.1.200;};

listen-on-v6 port 53{::1;};

directory"/var/named";

dump-file"/var/named/data/cache_dump.db";

statistics-file"/var/named/data/named_stats.txt";

memstatistics-file"/var/named/data/named_mem_stats.txt";

allow-query{ any;};

/*

- If you are building an AUTHORITATIVE DNS server, do NOT enable recursion.

- If you are building a RECURSIVE(caching) DNS server, you need to enable

recursion.

- If your recursive DNS server has a public IP address, you MUST enable access

control to limit queries to your legitimate users. Failing to do so will

cause your server to become part of large scale DNS amplification

attacks. Implementing BCP38 within your network would greatly

reduce such attack surface

*/

recursion no;

dnssec-enable yes;

dnssec-validation yes;

dnssec-lookaside auto;

/* Path to ISC DLV key*/

bindkeys-file"/etc/named.iscdlv.key";

managed-keys-directory"/var/named/dynamic";

pid-file"/run/named/named.pid";

session-keyfile"/run/named/session.key";

};

logging{

channel default_debug{

file"data/named.run";

severity dynamic;

};

};

zone"." IN{

type hint;

file"named.ca";

};

include"/etc/named.rfc1912.zones";

include"/etc/named.root.key";

key SEC_DDNS{

algorithm hmac-md5;

secret 7ObhTIhKeDFMR2SbbS5s8A==;

};

zone"it.lab" IN{

type master;

file"it.lab.forward";

allow-update{ key SEC_DDNS;};

};

zone"1.168.192.in-addr.arpa" IN{

type master;

file"1.168.192.reverse";

allow-update{ key SEC_DDNS;};

};

阅读剩余
THE END