Virtual machine (CentOS system) mount another Linux hard drive __linux

Source: Internet
Author: User
Tags uuid

Server hard disk is broken, and then repaired after found Hyperv virtual machine can not start, all kinds of error, edit grub, I will not ah, do. I thought of a way to mount the data before the hard drive on a new virtual machine.

Follow the steps to order a look at it, the following is the results of Baidu, posted over to make a memo.


Vgscan//Scan all volume groups
Vgdisplay//Display of more volume group information

Vgrename old GUID vg01//Renaming the volume group name of the mounted disk, the LVM partition cannot be mounted because it is the same as the volume group name of the virtual machine itself, and must be renamed (to modify the volume group name of the mounted disk, which is to be numbered and which is mounted), and here the serial number is the VG UUID. , the volume group name is the same, and only the VG UUID can be used to modify the volume group name

See the bottom volume Group "VolGroup00" successfully renamed to "VG01" is the name of success

Vgdisplay//You can see that there is already a renamed VG01

Lvscan//See above two disks that are hanging up, no activation

VGCHANGE-AY/DEV/VG01//excited this volume group

Lvscan//See if the VG01 volume group is active

MKDIR/MNT/HDB//Create a new folder to use as a mount point

mount/dev/vg01/Logical volume name (e.g. LogVol00)/MNT/HDB//Mount Vg01/logvol00

Uninstall when you are finished using

Umount/mnt/hdb

Vgchange-an/dev/vg01 to remove active LVM partitions

Modify the volume group name of this hard drive is no longer boot, should be the default boot boot is to boot to the VOLGROUP00 volume group, so modify the volume group name of the hard drive to still reboot, you must change the volume group name to the default VolGroup00
However, it cannot be modified on a virtual machine that already has a VolGroup00 volume group. Here we set up a separate partition format is not a Linux LVM format of the virtual machine to mount the hard disk, its format is ext3 (shown as Linux)

Fdisk-l//See if the hard drive is recognized

Vgscan//Scan Volume group

Lvscan//See if the volume group to be renamed is activated, if activated, you cannot modify the volume group name, if directly modified will prompt the error

VGCHANGE-AN/DEV/VOLGROUP00//If the previous step is active, you need to modify this command to not activate the state

Lvscan//See if modified to inactive

Vgrename vg01 VolGroup00//modified to inactive the volume group name can be modified

The way to mount a hard disk on a Linux LVM partition directly on a virtual machine on a ext3 format partition is as follows:

Fdisk-l//See if the hard drive is recognized

Vgscan//Scan Volume group

Vgdisplay//Show All volume groups

Lvscan//View the volume group of the mounted disk is in an active state

VGCHANGE-AY/DEV/VOLGROUP00//If you see no activation in the previous step, execute this command

MKDIR/MNT/HDB//Create mount point folder

MOUNT/DEV/VOLGROUP00/LOGVOL00/MNT/HDB//Mount, after mount, you can access the/MNT/HDB

UMOUNT/MNT/HDB//Uninstall disk

VGCHANGE-AN/DEV/VOLGROUP00//Remove activation status of mounted disk volume group

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.