Introduction of hard disk mounting method in Linux Vps/xen system

Source: Internet
Author: User
Tags vps hex code

Xen architecture of the VPS typically not less than 10G (there are also special examples), generally based on the Xensystem panel VPS default Mount 10G hard disk (the first disk), the remaining capacity (the second disk) need to be mounted manually.
1. View the hard drive condition
We use

Fdisk-l

To view the current hard drive condition

"disk/dev/xvdb:32.2 GB" means that the second virtual hard disk has 32.2GB capacity, "/dev/xvda 10.7GB" indicates "/" is currently assigned 10.7MB (on the first virtual disk).


2. Format the disk
General/dev/xvdb (second disk) mounted to Xen system disk, first format second disk

3. New section Tutorial

The code is as follows Copy Code

Command (M for help): N #新建分区
Command Action
E Extended
P primary partition (1-4)
P #设置为主分区
Partition number (1-4): 1 #主分区号
The cylinder (1-2610, default 1): 1 #开始扇区 (direct return)
Using Default value 1
Last cylinder, +cylinders or +size{k,m,g} (1-3916, default 3916): 3916
Using Default value 3916 #结束扇区 (direct default carriage return)
Command (M for help): T #指定分区类型
Selected partition 1 #选择1号分区
Hex code (type L to list codes): 8e #8e为LVM
Changed system type of partition 1 to 8e (Linux LVM)

Command (M for help): W #保存
The partition table has been altered!

Calling IOCTL () to re-read partition table.
Syncing disks.

4. Reread the partition table

Partprobe
5. View Volume Group

Vgdisplay

The above code shows the current VG details, where you need to record the following: VG Name
6. Create Add Volume Group
Create a new PV and add the/dev/xvdb to the "VG name" listed in the previous command, and the VPS's VG name is VolGroup0064 (check your VG name)

The code is as follows Copy Code


Pvcreate/dev/xvdb1
Vgextend VOLGROUP0064/DEV/XVDB1

7. View Check Volume group


Lvdisplay

Vgdisplay

View the VG and record the values for free pe/size

8. Add Volume Group table

That is to add the VG of/dev/volgroup0064/logvol101 free pe/size to the/dev/volgroup0064/logvol100.

Lvresize-l +959/dev/volgroup0064/logvol00
Above +959 is the value of vgdisply result free pe/size (figure), also can fill 29.97GB
Resize2fs/dev/volgroup0064/logvol00

Here the entire graphics and text tutorial is complete, next will bring you some related hard disk mount tutorial.
Hang after completion you can try restarting the machine to solve other problems

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.