In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces centos 5.x large hard disk management related knowledge, the content is very detailed, interested friends can refer to, hope to be helpful to you.
1. Enter the system for execution:
# parted / dev/sdb
2. Create a disk label:
Mklabel GPT
3. Press the p key to view the free space on the disk, which is displayed in M. 6000G should show disk geometry roughly like: / dev/sdb: 0.000-6000000.000 megabytes
4. Create a partition:
Enter after (parted):
Mkpart and follow the prompts
Partition type? Primary/ primary partition / extended/ extended partition? P (enter e here if you want to create an extended partition)
File system type? [ext2]? (enter directly here, and after the partition is created, the file system is established through mkfs.ext3 / dev/sdb*)
Starting point? 0
End point? -1
5. Press p to see if the partition you just created has been successful.
6. If successful, type quit to exit parted.
7. Use mkfs.ext3 / dev/sdb1 to create a file system
Although the fdisk command is interactive and easy to operate, it is inoperable for disks larger than 2T. What if we want to use disks larger than 2T? You can convert the disk to GPT format.
The disk in GPT format is equivalent to the original MBR disk with 4 partition table and 16 bytes, leaving only the first 16 bytes. Similar to the extended partition, the real partition table disk has no limit of four primary partitions after 512 bytes.
However, fdisk does not support GPT, so we can use parted to operate on GPT disks.
Useful LVM2, now there is not enough space, you need to add another hard disk.
Add the hard drive first, use fdisk-l, you can see the new hard drive.
Partition the newly added hard disk: fdisk / dev/sdb
> n
> t
> 8e (linux LVM)
It is divided into a partition in the format of linux LVM.
Let's start adding partitions to the LVM:
1. Create a physical volume
Pvcreate / dev/sdb1
two。 Add the new physical volume to the volume group
Vgextend VolGroup00 / dev/sdb1
3. Add new space to the logical volume
Lvextend-lumped 10G / dev/VolGroup00/LogVol00
4. After adding to it, you can't see the new space with df-h at present, so you need to activate it.
RHEL 4:
Ext2online / dev/VolGroup00/LogVol00
RHEL 5:
Resize2fs-p / dev/VolGroup01/LogVol00
All done, and then use df-h, you can see the new space.
Several commands:
Extended vg: vgextend vg0 (volume group name) / dev/sdc1 (pv name)
Extended lv: lvextend-L + 200m / dev/vg0/home (lv name)
View information: vgdisplay / dev/vg0, lvdisplay / dev/vg0/logVol00
Data migration: pvmove / dev/sda1 / dev/sdc1
To delete a logical volume:
A.umout all lv
B.lvremove / dev/vgo/logVol00 (delete a snapshot first if there is a snapshot)
C.vgchange-an / dev/vg0 (dormant vg0,-ay is active vg0)
D.vgremove vg0 (remove)
Note:
Note that PE and LE correspond to each other one by one during migration, and the size should be the same, and the size cannot be changed during migration.
Check the current partition size
The code is as follows:
[root@jxxdb2] # df-h
FilesystemSize Used Avail Use% Mounted on
/ dev/mapper/VolGroup00-LogVol00
15g 3.7g 9.9g 27% / u01/oracle/oradata
[root@jxxdb2 ~] # cat / etc/fstab
Check how much space is left unallocated in vg and the current lv size
The code is as follows:
[root@jxxdb2 ~] # vgdisplay | egrep "Volume group | VG Name | Alloc PE | Free PE"
-Volume group
VG Name VolGroup00
Alloc PE / Size 610 / 19.06 GB
Free PE / Size 11107 / 347.09 GB
[root@jxxdb2 ~] # lvdisplay | egrep "Logical volume | LV Name | VG Name | LV Size"
-Logical volume
LV Name / dev/VolGroup00/LogVol00
VG Name VolGroup00
LV Size 14.50 GB
-Logical volume
LV Name / dev/VolGroup00/LogVol01
VG Name VolGroup00
LV Size 4.56 GB
About centos 5.x large hard disk management related knowledge shared 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.