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/01 Report--
This article will explain in detail about CentOS general partition expansion and partition table, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
Case sharing:
Host system centos7.5
The default system has a 40G system disk sda and a 350G data disk sdb. Each disk has one partition, and the partition type is ordinary partition. Now that the 350G data disk is full, it is required to extend the sdb1 to 450G.
First expand the SDB disk space to 450G on the "physical"; here we only discuss file system extension and partitioning. It is troublesome to extend ordinary partitions without lvm. Fortunately, sdb has only one partition.
1) first check the usage of the hard disk and the type of file system
] # df-TH / data/ File system type is ext4
2) uninstall the data disk
] # umount / dev/sdb1
3) delete the partition on the sdb and re-partition; leave it all by default, because the default is to use all the space on the hard drive.
] # fdisk / dev/sdb
Command (m for help): d
Selected partition 1
Partition 1 is deleted
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):
First sector (2048-943718400, default 2048):
Using default value 2048
Last sector, + sectors or + size {KMagne Mpeng} (2048-943718400, default 943718400):
Using default value 943718400
Partition 1 of type Linux and of size 450 GiB is set
4) notify the system to reread the partition table
] # partprobe / dev/sdb
5) Mount
] # mount / dev/sdb1 / data
At this time] # lsblk can see that the sdb1 is 450G; but] # df-TH / dev/sdb1 sees that the size is still 350g, because the file system has been made on the first 350g sector, and there is no file system on the newly added 100g sector after re-partition. The df command depends on the partition usage.
6) extend the file system; previously checked that the file system type of sdb1 is ext4
] # resize2fs / data / / xfs file system command: xfs_growfs; extends the file system to the physical partition size; you can also use the fsadm command to manually resize the file system (which is useful when reducing partition space).
7) check the verification partition size again
] # df-TH / data/
Ps: with regard to the third step, the operability is that there are no other partitions after the partition to be extended and there is free space available. The partition information of each disk is recorded on sector 0. The size of a single sector of a traditional disk is 512byte, the former 446byte is MBR (master boot record), the partition table information is 446-510, and the last two byte are the ending flag bits. Both deleting and creating partitions modify the 64byte information between the 446-510byte of sector 0.
Having said that, the first 455 bytes of data are corrupted (since mbr,455-446=9byte does not exist on the sdb, that is, the first nine bytes in the partition table information) the partitioned table remains intact:)
After destroying 460-446=14byte bytes, the partition table can't be read-- in this case, it doesn't matter if the partition table is gone, just follow the third step to rebuild the partition. As long as there is no misoperation, the data is fine, and the partition starts from sector 2048 by default, that is, the space for 2048*512byte=1M is reserved after sector 0.
From this point of view, it is feasible to resize a normal partition without lvm, as long as there is enough free space available after the partition. But there is no certainty, plus the risk of misoperation, so it is best to plan well at the beginning and try to avoid later trouble.
On the CentOS general partition expansion and partition table is how to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.