In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces Centos7 extended disk space (LVM management) and shares it with you. Details are as follows:
Check the disk condition
# fdisk-1 / dev/sdaDisk / dev/sda: 21.5GB, 21474836480 bytes, 41943040 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk label type: dosDisk identifier: 0x00063fa6 Device Boot Start End Blocks Id System/dev/sda1 * 2048 1026047 512000 83 Linux/dev/sda2 1026048 20971519 99727368e Linux LVM/dev/sda3 2097152041943039 10485760 8e Linux LVM
The disk size is now 21.5 GB. Disk usage is as follows:
# df-hFilesystem Size Used Avail Use% Mounted on/dev/mapper/centos-root 19G 8.1G 11G 44% / devtmpfs 482M 0 482M 0 / devtmpfs 497M 88K 497M 1% / dev/shmtmpfs 497M 7.0M 490M 2% / runtmpfs 497M 0497M 0% / sys/fs/cgroup/dev/sda1 497M 157M 341M 32% / bootShare 10363G 67G 35% / media/sf_ Sharetmpfs 100M 4.0K 100m 1% / run/user/42tmpfs 100M 12K 100m 1% / run/user/0
Try creating a block file of 1GB size with the dd command:
# dd if=/dev/zero of=1.0G.img bs=1M count=1000dd: writing `1.0G.img: No space left on device1+0 records in0+0 records out8192 bytes (8.2kB) copied, 0.00300509 s, 2.7MB/s
Indicates that there is insufficient disk space, indicating that although enough space has been allocated to the virtual machine, the system does not recognize it.
Let's adjust the file system of the virtual machine operating system to identify the new space.
1. Create a new partition
# fdisk / dev/sdan {new partition} p {primary partition} 3 {partition number} [you will be prompted to modify the size and select enter directly by default] t {change partition id} 3 {partition number} 8e {Linux LVM partition} w
If there is a hint such as setting the size in the middle, enter directly.
When you are finished, if prompted:
PS: after actual testing, there is no such prompt, but you still have to restart the system to see if the disk space has been recognized.
WARNING: Re-reading the partition table failed with error 16: equipment or resources are busy. The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe (8) or kpartx (8)
Just restart the system.
two。 Check to see if the newly added sda3 is marked as LVM, if reboot is not needed
PS: after actual testing, sda3 is already LVM, but the system still does not recognize the disk space.
3. Resize LVM
View Volume Group name
# vgdisplay-Volume group-VG Name centos System ID Format lvm2
4. Create a new physical volume for the newly allocated space
# pvcreate / dev/sda3
5. Extend LVM's VolGroup with a new physical volume
# vgextend centos / dev/sda3 No physical volume label read from / dev/sda3 Writing physical volume data to disk "/ dev/sda3" Physical volume "/ dev/sda3" successfully created Volume group "vg_aimin" successfully extended
6. Extend the logical volume centos-root of LVM
First look at the logical volume:
# lvdisplay-Logical volume-LV Path / dev/centos/root LV Name root VG Name centos# lvextend / dev/centos/root / dev/sda3
7. Resize logical volumes
# xfs_growfs / dev/centos/root
PS: I don't know whether to adjust or synchronize. After actual testing, I need to use the xfs_growfs command instead of the resize2fs command.
8. View the result
# lvscan ACTIVE'/ dev/centos/root' [18.46 GiB] inherit ACTIVE'/ dev/centos/swap' [1.00 GiB] inherit
The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.