当前位置:网站首页>LVM management exercise
LVM management exercise
2022-06-13 08:16:00 【BT youth】
subject :
1. Add one swap Partition
Add a new... To your system swap Partition , And meet the following requirements :
swap The partition capacity is 512 MiB
When your system starts ,swap The partition should be able to boot and mount automatically
Do not remove or modify other existing in your system swap Partition
2. Create a logical volume
Please create a new logical volume according to the following requirements :
Create a file called datastore The volume group , The size of the volume group is 4G
The name of the logical volume is database , The volume group is datastore, The logical volume size is 3G
Format the new logical volume as xfs file system , When the system is required to start , The logical volume can be automatically mounted to /database
3. Expand the volume group and expand the last question database The size of the logical volume is 5G.
4. Delete all logical volumes and restore them to the original state of the system
Environmental Science :
linux Have a piece 10G Of sdb Hard disk unassigned
1、
lsblk # View the tree structure disk partition
Fdisk /dev/sdb # Get into LVM Management division
# establish swap Partition 512M And rewrite it id Number is swap
p
n
+512M
t
82
p
w
mkswpa /dev/sdb5 # format swap
swapon /dev/sdb5 # Activate swap Partition ( Check the size before activating )
free -m # see swap size
Vim /etc/fstab # Get into /etc/fstab File add boot auto start
restart
2、
fdisk /dev/sdb # Give a new partition to divide logical volumes ( to 4G)
pvcreate /dev/sdb6 # establish pv
vgcreate datastore /dev/sdb6 # establish vg The volume group datastore
lvcreate -L 3G -n database datastore # establish 3G The size of lv Logic volume
mkfs.xfs /dev/datastore/database # format xfs Type of logical volume
mkdir /database # Create mount directory
mount /dev/datastore/database /database/# mount
blkid # see UUID
/dev/sdb7:UUID="5KqydD-OHKG-EHi9-XZIU-puRv-A7im-s0m6xO" TYPE="LVM2_member" PARTUUID="7bb7f8aa-07"
vim /etc/fstab # Add power on self start
UUID=630da09a-551e-4c57-8654-9f0cdb838105 /database xfs defaults 0 0
df -h
3、
# see lv、vg、pv Volume discovery vg There are not enough rolls for lv branch 2G, So let's divide another one sdb7 To add to pv Middle feeding vg
lvs
vgs
pvs
fdisk /dev/sdb # establish sdb7 Partition +2G
pvcreate /dev/sdb7 #sdb7 Add to pv In the volume
vgextend datastore /dev/sdb7 #vg Volume group added sdb7 size
lvextend -L +2G /dev/datastore/database #lv Logic volume +2G Size
df -h # It has not been synchronized yet
xfs_growfs /dev/datastore/database #( error : The mount directory must be formatted /database)
xfs_growfs /database/ #xfs System synchronization format
notes : If encountered ext4 The format is :
resize2fs /dev/datastroe/database #ext System synchronization format
df -h # Mount successfully
4、
umount /database # Cancel the mount
df -h # View the mount
vim /etc/fstab # Remove the boot auto start to prevent the system from starting up
lvremove /dev/datastore/database # remove lv Logic volume
vgremove datastore # remove vg The volume group
pvremove /dev/sdb5 /dev/sdb7 # remove pv Physical volume
fdisk /dev/sdb # Get into LVM Manage deleting created partitions
reboot # restart
边栏推荐
- 钉钉小程序如何隐藏tab
- Sizeof, strlen find character length
- 关于redis使用分布式锁的封装工具类
- Start from scratch - implement the jpetstore website -1- establish the project framework and project introduction
- 适合生鲜批发行业的几种精准接单方式
- BD新标签页(BdTab)插件如何登入?
- 第115页的gtk+编程例子——最简单的进度条2附带使用Anjuta写gtk程序的步骤
- redis面试题
- 20 | pipeline oriented instruction design (Part 1): Modern CPU with multi-purpose
- Structural analysis of hyperledger fabric (I)
猜你喜欢
Install cuda+cusp environment and create the first helloword starter project
酒水批发行业应当如何高效管理商品与库存
将solidworks建的机器人模型导入到ros中
Altium Designer中导入和导出设置的方法
Dfinity (ICP) basic development tutorial-5
C盘爆满?简单几招教你释放、清理C盘几十G空间,最有效的C盘清理方法
Recognition of COVID-19 based on paddlepaddle
第115页的gtk+编程例子——最简单的进度条2附带使用Anjuta写gtk程序的步骤
CCNP_ BT static routing
Methods of importing and exporting settings in Altium Designer
随机推荐
Give code vitality -- the way to read code neatly
Examination question bank and simulation examination for special operation certificate of safety management personnel of hazardous chemical business units in 2022
杨氏矩阵查找数字是否存在
Cosmos star module development
【完全信息静态博弈-Nash均衡的特性】
Effective Go - The Go Programming Language
5. fabric2.2 installation and submission contract (using official demo)
水仙花升级版(自幂数)
Cosmos star application case
星巴克创始人:出于安全考量 或不再向非店内消费者开放“公厕”
P7712 [Ynoi2077] hlcpq
Overall process analysis of account book operation in fabric0.6
钉钉小程序 父子传参数对象 子组件页面不更新?
母婴用品批发行业使用管理软件提高效率 实现降本增效
[game theory complete information static game] Nash equilibrium
Determine whether a string is rotated from another string
Detailed explanation of digital certificate and Ca
23 | adventure and prediction (II): relay race in the assembly line
Install cuda+cusp environment and create the first helloword starter project
Founder of Starbucks: no longer open "public toilets" to non store consumers for safety reasons