[root@redhat52 ~]# vgdisplay
No volume groups found
[root@redhat52 ~]# lvscan -v
Finding all logical volumes
No volume groups found
[root@redhat52 ~]# losetup -a
[root@redhat52 ~]# losetup /dev/loop0 pvrhel52.img
[root@redhat52 ~]# losetup -a
/dev/loop0: [0801]:5767411 (pvrhel52.img)
[root@redhat52 ~]# kpartx -av /dev/loop0
add map loop0p1 : 0 208782 linear /dev/loop0 63
add map loop0p2 : 0 7968240 linear /dev/loop0 208845
[root@redhat52 ~]# vgdisplay|grep "VG Name"
VG Name VolGroup00
※このvgdisplayで「No volume groups found」となった場合はvgscanを実行してみます。
[root@redhat52 ~]# lvscan -v
Finding all logical volumes
inactive '/dev/VolGroup00/LogVol00' [3.00 GB] inherit
inactive '/dev/VolGroup00/LogVol01' [800.00 MB] inherit
[root@redhat52 ~]# vgchange -a y /dev/VolGroup00
2 logical volume(s) in volume group "VolGroup00" now active
[root@redhat52 ~]# lvscan -v
Finding all logical volumes
ACTIVE '/dev/VolGroup00/LogVol00' [3.00 GB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [800.00 MB] inherit
[root@redhat52 ~]# mount /dev/VolGroup00/LogVol00 /mnt
[root@redhat52 ~]# ls /mnt
bin etc lost+found mnt poweroff sbin sys usr
boot home media net proc selinux tftpboot var
dev lib misc opt root srv tmp
[root@redhat52 ~]# cat /mnt/etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
[root@redhat52 ~]# umount /mnt
[root@redhat52 ~]# vgchange -a n /dev/VolGroup00
0 logical volume(s) in volume group "VolGroup00" now active
[root@redhat52 ~]# lvscan -v
Finding all logical volumes
inactive '/dev/VolGroup00/LogVol00' [3.00 GB] inherit
inactive '/dev/VolGroup00/LogVol01' [800.00 MB] inherit
[root@redhat52 ~]# kpartx -dv /dev/loop0
del devmap : loop0p1
del devmap : loop0p2
[root@redhat52 ~]# lvscan -v
Finding all logical volumes
No volume groups found
[root@redhat52 ~]# vgdisplay
No volume groups found
[root@redhat52 ~]# losetup -d /dev/loop0
[root@redhat52 ~]# losetup -a
[root@redhat52 ~]#
|