CentOS6.5 the system uses the logical volume method to add a new hard disk.

Source: Internet
Author: User
An operating system has been installed on a server. after the cabinet is connected, you need to create a logical volume for system mounting. The entire disk is used as a partition, and the CentOS6.3 file system has a maximum of 16 T limit. First clear partition table information on the disk: [root @ SD-H0-ATTACH-G0S0 ~] # Ddif/dev/zeroof/dev/sdabs512count11 + 0 recor

An operating system has been installed on a server. after the cabinet is connected, you need to create a logical volume for system mounting. The entire disk is used as a partition, and the CentOS6.3 file system has a maximum of 16 T limit.
First, clear the partition table information on the disk:

[Root @ SD-H0-ATTACH-G0S0 ~] # Dd if =/dev/zero of =/dev/sda bs = 512 count = 1
1 + 0 records in
1 + 0 records out
512 bytes (512 B) copied, 0.000446406 s, 1.1 MB/s

Create physical volume

[Root @ SD-H0-ATTACH-G0S0 ~] # Pvcreate/dev/sda
Writing physical volume data to disk "/dev/sda"
Physical volume "/dev/sda" successfully created
[Root @ SD-H0-ATTACH-G0S0 ~] # Pvdisplay
--- Physical volume ---
PV Name/dev/sdb2
VG Name vg _ Lvs2
PV Size 1.09 TiB/not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 285762
Free PE 0
Allocated PE 285762.
Pv uuid 93Hrn1-R8m4-fv8S-S7G6-3vpa-N4EH-GOevM9
--- Physical volume ---
PV Name/dev/sda
VG Name vg _ Mongodb
PV Size 18.19 TiB/not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 4767999
Free PE 4767999
Allocated PE 0
Pvuuid nUhMM9-S51t-nlKz-wgVS-nkCh-sgXD-Qr4bZv

Create a physical volume Group

[Root @ SD-H0-ATTACH-G0S0 ~] # Vgcreate vg_mongodb/dev/sda
Volume group "vg_mongodb" successfully created
[Root @ SD-H0-ATTACH-G0S0 ~] # Vgs
VG # PV # LV # SN Attr VSize VFree
Vg_lvs2 1 2 0 wz -- n-1.09 t 0
Vg_mongodb 1 0 0 wz -- n-18.19 t 18.19 t

Create logical volume

[Root @ SD-H0-ATTACH-G0S0 ~] # Lvcreate-l 16 TB-n lv_mongodb vg_mongodb
Logical volume "lv_mongodb" created

Format a file system

[Root @ SD-H0-ATTACH-G0S0 ~] # Mkfs. ext4/dev/vg_mongodb/lv_mongodb
Mke2fs 1.41.12 (17-May-2010)
Filesystem label =
OS type: Linux
Block size = 4096 (log = 2)
Fragment size = 4096 (log = 2)
Stride = 0 blocks, Stripe width = 0 blocks
1073741824 inodes, 4294967295 blocks
214748364 blocks (5.00%) reserved for the super user
First data block = 0
131072 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768,983 04, 163840,229 376, 294912,819 200, 884736,160 5632, 2654208,
4096000,796 2624, 11239424,204 80000, 23887872,716 63616, 78675968,
102400000,214 990848, 512000000,550 73 1776, 644972544,193 4917632,
2560000000,385 5122432
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 22 mounts or
180 days, whichever comes first. Use tune2fs-c or-I to override.

Mount and use

[Root @ SD-H0-ATTACH-G0S0 ~] # Mount/dev/vg_mongodb/lv_mongodb/dragon/data
[Root @ SD-H0-ATTACH-G0S0 ~] #
[Root @ SD-H0-ATTACH-G0S0 ~] # Df-h
Filesystem Size Used Avail Use % Mounted on
/Dev/mapper/vg_lvs2-lv_root
1.1 T 2.5G 1.1 T 1%/
Tmpfs 7.8G 0 7.8G 0%/dev/shm
/Dev/sdb1 485 M 58 M 402 M 13%/boot
/Dev/mapper/vg_mongodb-lv_mongodb
16 T 129 M 15 T 1%/dragon/data
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.