2 unit 5

###unit.5 LVM###

###1.LVM建立

1.划分物理分区并把分区id修改为8e

[[email protected] ~]# fdisk /dev/vdb

Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.

Be careful before using the write command.

Device does not contain a recognized partition table

Building a new DOS disklabel with disk identifier 0x9546a42c.

Command (m for help): n

Partition type:

p   primary (0 primary, 0 extended, 4 free)

e   extended

Select (default p):

Using default response p

Partition number (1-4, default 1): 1

First sector (2048-20971519, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-20971519, default 20971519): +500M

Partition 1 of type Linux and of size 500 MiB is set

Command (m for help): n

Partition type:

p   primary (1 primary, 0 extended, 3 free)

e   extended

Select (default p):

Using default response p

Partition number (2-4, default 2): 2

First sector (1026048-20971519, default 1026048):

Using default value 1026048

Last sector, +sectors or +size{K,M,G} (1026048-20971519, default 20971519): +500M

Partition 2 of type Linux and of size 500 MiB is set

Command (m for help): t

Partition number (1,2, default 2): 1

Hex code (type L to list all codes): 8e

Changed type of partition ‘Linux‘ to ‘Linux LVM‘

Command (m for help): t

Partition number (1,2, default 2): 2

Hex code (type L to list all codes): 8e

Changed type of partition ‘Linux‘ to ‘Linux LVM‘

Command (m for help): p

Disk /dev/vdb: 10.7 GB, 10737418240 bytes, 20971520 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk label type: dos

Disk identifier: 0x9546a42c

Device Boot      Start         End      Blocks   Id  System

/dev/vdb1            2048     1026047      512000   8e  Linux LVM

/dev/vdb2         1026048     2050047      512000   8e  Linux LVM

Command (m for help): wq

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

pvs|pvdisplay

vgs|vgdisplay

lvs|lvdisplay

监控命令

watch -n 1 \

‘echo"===pvinfo==="\

;pvs\

;echo"===vginfo==="\

;vgs\

;echo"===lvinfo==="\

;lvs\

;df -h /mnt‘

===pvinfo===

PV         VG   Fmt  Attr PSize   PFree

/dev/vdb1  tbr  lvm2 a--  496.00m      0

/dev/vdb2  tbr  lvm2 a--  496.00m 392.00m

===vginfo===

VG   #PV #LV #SN Attr   VSize   VFree

tbr    2   1   0 wz--n- 992.00m 392.00m

===lvinfo===

LV   VG   Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert

lv0  tbr  -wi-ao---- 600.00m

pvcreate /dev/vdb1

vgcreate westos /dev/vdb1

lvcreate -L 100M -n lv0 westos

mkfs.xfs /dev/westos/lv0

mount /dev/westos/lv0 /mnt

lvextend -L 200M /dev/westos/lv0

xfs_growfs /dev/westos/lv0

pvcreate /dev/vdb2

vgextend westos /dev/vdb2

lvextend -L 600M /dev/westos/lv0

xfs_growfs /dev/westos/lv0

fdisk /dev/sdb

umount /mnt/

mkfs.ext4 /dev/westos/lv0

e2fsck -f /dev/westos/lv0

resize2fs /dev/westos/lv0 200M

mount /dev/westos/lv0 /mnt

lvreduce -L 200M /dev/westos/lv0

pvmove /dev/vdb1 /dev/vdb2

vgreduce westos /dev/vdb1

vgreduce --removemissing ##清除不知道的东西

lvcreate -L 10M -n lv0-backup -s /dev/westos/lv0 ##快照

umount /mnt

lvremove /dev/westos/lv0-backup

lvremove /dev/westos/lv0

vgremove westos

pvremove /dev/vdb2

fdisk /dev/vdb

fdisk /dev/vdb

#!/bin/bash

fdisk /dev/vdb << end

n

+1G

wq

end

格式为file.sh 命令为sh file.sh

时间: 2024-08-20 02:29:29

2 unit 5的相关文章

mysqld服务启动失败, Failed to restart mysqld.service: Unit not found.

-bash-4.2# service mysqld restart Redirecting to /bin/systemctl restart mysqld.serviceFailed to restart mysqld.service: Unit not found. 并不存在 mysqld 的服务, -bash-4.2# -bash-4.2# chkconfig -list -list: unknown option -bash-4.2# chkconfig --list Note: Thi

10.23 linux任务计划cron10.24chkconfig工具10.25 systemd管理服务10.26 unit介绍 10.27 target介绍

- 10.23 linux任务计划cron - 10.24 chkconfig工具 - 10.25 systemd管理服务 - 10.26 unit介绍 - 10.27 target介绍 - 扩展 1. anacron http://blog.csdn.net/strikers1982/article/details/4787226  2. xinetd服(默认机器没有安装这个服务,需要yum install xinetd安装) http://blog.sina.com.cn/s/blog_46

CentOS 7 防火墙 出现Failed to start iptables.service: Unit iptables.service failed to load

错误信息如下: [root]# service iptables start Redirecting to /bin/systemctl start iptables.service Failed to start iptables.service: Unit iptables.service failed to load: No such file or directory.解决方法如下: 一直用CentOS 6 习惯了,一下没适应过来.防火墙配置后执行service iptables sav

GRU(Gated Recurrent Unit) 更新过程推导及简单代码实现

GRU(Gated Recurrent Unit) 更新过程推导及简单代码实现 RNN GRU matlab codes RNN网络考虑到了具有时间数列的样本数据,但是RNN仍存在着一些问题,比如随着时间的推移,RNN单元就失去了对很久之前信息的保存和处理的能力,而且存在着gradient vanishing问题. 所以有些特殊类型的RNN网络相继被提出,比如LSTM(long short term memory)和GRU(gated recurrent unit)(Chao,et al. 20

2 unit 4

###unit.4管理系统存储### ###1.分区划分 fdisk /dev/vdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Device does not contain a recognized partition table Buil

(4.5.4)Android测试TestCase单元(Unit test)测试和instrumentationCase单元测试

Android单元和instrumentation单元测试 Developing Android unit and instrumentation tests Android的单元测试是基于JUnit的.可分为: 1.本地单元测试 - 可以在JVM上运行测试(速度快,优先考虑). 2.Instrumented单元测试 - 需要Android系统 Android的Gradle插件支持在JVM上执行Andr??oid单元测试.它使用特殊版本的android.jar(也称为 Android mocka

ABP领域层——工作单元(Unit Of work)

ABP领域层——工作单元(Unit Of work) 点这里进入ABP系列文章总目录 基于DDD的现代ASP.NET开发框架--ABP系列之12.ABP领域层——工作单元(Unit Of work) ABP是“ASP.NET Boilerplate Project (ASP.NET样板项目)”的简称. ABP的官方网站:http://www.aspnetboilerplate.com ABP在Github上的开源项目:https://github.com/aspnetboilerplate 通用

Karma install steps for unit test of Angular JS app

npm install -g karma npm install –g karma-cli Install the plugins (optional)           # Install plugins that your project needs:  npm install karma-jasmine karma-chrome-launcher --save-dev Run following command to do unit test:           C:\Users\Br

.NET MVC4 实训记录之四(Unit of work + Repository)

今日后开启进阶模式! 谈到MVC与EntityFramework,则不得不说一说事务与仓储(Unit of work + Repository). 仓储(Repository):领域对象集合.用于操作领域对象与数据库上下文(DbContext)的交互(在此不得不说一声,领域对象和数据库表对象还是有区别的.领域对象实际上是一组有业务关系的数据库对象的抽象.最简单的形式就是主表.关系表在同一个领域对象中进行定义.例如我们前几章看到的UserProfile,它即定义了用户信息,又定义了用户角色关系信息