Objective
This article describes how to mount a Linux Logical Volume Manager (LVM) partition located inside a virtual disk (VDI) in a XenServer Host.
If a Linux Virtual Machine (VM) with an LVM partition crashes, then the LVM partition cannot be accessed directly with kpartx. Red Hat Enterprise Linux (RHEL) 5 by default uses LVM for installing the root partition.
Instructions
To mount a Linux Logical Volume Manager (LVM) partition, complete the following procedure:
-
Check for the universal unique identifier (UUID) of the virtual machine using the following commands:
Note: You will need the VDI-UUID later as this is the disk which has the LVM partition or partitions.
# xe vm-list name-label=<vm-name>
# xe vm-disk-list uuid=<vm-uuid> -
Run kpartx command to create loop devices for the partitions inside the Logical volume.
-
Find out the LV volume file that is related to the particular VDI listed in the previous step:
# xe sr-list type=lvm -
Use the SR-UUID where the VDI is located to find out the volume group (VG) and activate all LVs in that group:
# vgchange –ay VG_XenStorage-<sr-uuid> -
List all disks in that VG group:
# ll /dev/VG_XenStorage-<sr-uuid> -
Map the LV using the kpartx command. This is the VDI disk of the particular virtual machine:
# kpartx –a /dev/VG_XenStorage-<sr-uuid>/LV-<vdi-uuid> -
Check the mapped partitions in /dev/mapper to validate LV-<vdi-uuid>p<partition_number>.
For example:
# ll /dev/mapper# LV-c4d1f0af-b0c4-413c-8832-2c1bfd90d118p1
# LV-c4d1f0af-b0c4-413c-8832-2c1bfd90d118p2
-
The following command scans partitions for LVM and adds this new volume group to the XenServer Host. Run the following command to see the VG name related to /dev/mapper:
# pvscan
-
Run the following command to see all VGs name inside the virtual machine:
For example:
# vgscanIf the VG inside the virtual machine was named as system, should see a similar row:
# Found volume group “system” using metadata type lvm2
-
Use the following commands to make all logical volumes in the group active:
# lvchange -ay <vg-name>
(same VG name from the previous command)
For example:
# lvchange –ay system
-
Verify the volume group has active logical volumes listed as follows:
A similar output appears to include VG system with two partitions:
# lvscan# ACTIVE ‘/dev/system/root’ [7.43 GB] inherit
# ACTIVE ‘/dev/system/swap’ [512.00 MB] inherit
-
Create a directory, mount this logical volume, and access its data using the following commands:
# mkdir /mnt/partition
# mount /dev/<vg-name>/<partition> /mnt/partition
# cd /mnt/partition
# ls
Reverse Procedure
To unmount a mounted devise, complete the following procedure:
-
Run the following command to unmount mounted devices:
# umount /mnt/disk
-
Deactivate the logical volumes on the VG:
# vgchange –an <VG-name>
-
Delete partition mappings with kpartx:
# kpartx –d /dev/ VG_XenStorage-<sr-uuid>/LV-<vdi-uuid>
This is similar to the previous command except for the option which has changed from “-a” to “-d”Note: Deactivate all LV in the group, otherwise the command will fail.
Additional Resources
To prevent file system errors, use check disk before mounting the partition (before proceeding with step 9). This applies only to EXT3 file systems:
# fsck.ext3 /dev/<vg-name>/<partition>
For example: # fsck.ext3 /dev/system/root
Supporto Citrix
Traduzione automatica
Questo articolo ?? ¨ stato tradotto da un sistema di traduzione automatica e non ?? ¨ stata valutata da persone. Citrix fornisce traduzione automatica per aumentare l'accesso per supportare contenuti; tuttavia, articoli automaticamente tradotte possono possono contenere degli errori. Citrix non ?? ¨ responsabile di incongruenze, errori o danni derivanti dell'uso di articoli automaticamente tradotte.
Citrix技術支持
自動翻譯
這篇文章被翻譯由一個自動翻譯系統,並沒有受到人們的審查。 Citrix提供自動翻譯,增加獲得支持的內容;但是,自動翻譯的文章可能可以包含錯誤。思傑不負責不一致,錯誤或損壞因使用自動翻譯的文章的結果。
Поддержка Citrix
Tradução automática
Эта статья была переведена автоматической системой перевода и не был рассмотрен людьми. Citrix обеспечивает автоматический перевод с целью расширения доступа для поддержки контента; Однако, автоматически переведенные статьи могут может содержать ошибки. Citrix не несет ответственности за несоответствия, ошибки, или повреждения, возникшие в результате использования автоматически переведенных статей.
시트릭스 지원
자동 번역
이 문서 자동 번역 시스템에 의해 번역 된 사람들에 의해 검토되지 않았다. 시트릭스는 컨텐츠를 지원하기 위해 접근을 높이기 위해 자동 번역을 제공합니다; 그러나, 자동으로 번역 기사 오류를 포함 할 수있다. 시트릭스는 자동으로 번역 된 기사의 사용의 결과로 발생하는 불일치, 오류 또는 손해에 대해 책임을지지 않습니다.