LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem.
Why use LVM?
For a long time I wondered why anyone would want to use LVM when you can use gparted to resize and move partitions just fine. The answer is that lvm can do these things better, and some nifty new things that you just can’t do otherwise. I will explain several tasks that lvm can do and why it does so better than other tools, then how to do them. First you should understand the basics of lvm.
obaby@h4ck:~$ sudo vgdisplay
--- Volume group ---
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 235.42 GiB
PE Size 4.00 MiB
Total PE 60268
Alloc PE / Size 25600 / 100.00 GiB
Free PE / Size 34668 / 135.42 GiB
VG UUID xeAkGF-zg8u-iEMN-DNR9-FeTX-hnHi-UVfS6F
obaby@h4ck:~$ sudo vgdisplay
--- Volume group ---
VG Name ubuntu-vg
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 235.42 GiB
PE Size 4.00 MiB
Total PE 60268
Alloc PE / Size 25600 / 100.00 GiB
Free PE / Size 34668 / 135.42 GiB
VG UUID xeAkGF-zg8u-iEMN-DNR9-FeTX-hnHi-UVfS6F
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 30
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 61714432(4k) blocks long.
obaby@h4ck:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 30
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 61714432 (4k) blocks long.
obaby@h4ck:~$ sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mapper/ubuntu--vg-ubuntu--lv is mounted on /; on-line resizing required
old_desc_blocks = 13, new_desc_blocks = 30
The filesystem on /dev/mapper/ubuntu--vg-ubuntu--lv is now 61714432 (4k) blocks long.
9 comments
你的博客也是放在工控机的?那我不是,工控机放了其他东西,博客还是老老实实在腾讯云续费。
是的,哈哈哈。胆大吧?那个随机小姐姐图片也是用工控机跑的。目前运行了100多天了还是比较稳定的。
数据库是放在nas上的,工控就跑php+nginx,其余的不放在工控机上。
每日一图
欢迎看图
博主,你的评论通知,是使用的插件吗
是的呢,用的WP MAIL SMTP 你可以尝试一下。
好,我去试试,主题自带的,只通知登录用户,有点难受
这会忙不,去聊天广场帮忙做个测试呗!
去拉,有啥新功能?