Mount LVM Partition in the RHEL / CentOSМонтирование LVM в RHEL / CentOS

lvm
Mount LVM-partition in Linux differs from typical mounting of standard file system partition (for example, ext2 and ext3). Let’s have a look at our disk:

fdisk -l /dev/hda
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 19457 156183930 8e Linux LVM

lvm
Монтирование LVM-разделов в Linux несколько отличается от типичного монтирования разделов стандартных файловых систем (например, ext2 или ext3). Взглянем на наш диск:

fdisk -l /dev/hda
Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 19457 156183930 8e Linux LVM

If you try to mount LVM in the same way as you do it with other standard Linux partitions, you won’t have a success.

mount /dev/hda2 /tmp/mnt
mount: /dev/hda2 already mounted or /tmp/mnt busy

In order to mount a partition, firstly, define a volume group contained in /dev/hda2:

pvs
 PV         VG         Fmt  Attr PSize   PFree 
  /dev/hda2  VolGroup01 lvm2 a-   148.94G 32.00M
  /dev/hdb2  VolGroup00 lvm2 a-   114.94G 96.00M

And enter the contents VolGroup01:

lvdisplay /dev/VolGroup01
  --- Logical volume ---
  LV Name                /dev/VolGroup01/LogVol00
  VG Name                VolGroup01
  LV UUID                zOQogm-G8I7-a4WC-T7KI-AhWe-Ex3Y-JVzFcR
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                146.97 GB
  Current LE             4703
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/VolGroup01/LogVol01
  VG Name                VolGroup01
  LV UUID                araUBI-4eer-uh5L-Dvnr-3bI6-4gYg-APgYy2
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                1.94 GB
  Current LE             62
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:3

The partition which I want to mount /dev/VolGroup01/LogVol00. Another partition is swap – that is what I don’t need. Now mount LVM-volume group.

mount /dev/VolGroup01/LogVol00 /tmp/mnt

Если попытаться смотнитровать LVM также как мы это делаем с другими стандартными разделами Linux, то у нас ничего не выйдет.

mount /dev/hda2 /tmp/mnt
mount: /dev/hda2 already mounted or /tmp/mnt busy

Для того чтобы смонтировать раздел, сначала определим группу томов содержащихся в /dev/hda2:

pvs
 PV         VG         Fmt  Attr PSize   PFree 
  /dev/hda2  VolGroup01 lvm2 a-   148.94G 32.00M
  /dev/hdb2  VolGroup00 lvm2 a-   114.94G 96.00M

Ну и выведем содержимое VolGroup01:

lvdisplay /dev/VolGroup01
  --- Logical volume ---
  LV Name                /dev/VolGroup01/LogVol00
  VG Name                VolGroup01
  LV UUID                zOQogm-G8I7-a4WC-T7KI-AhWe-Ex3Y-JVzFcR
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                146.97 GB
  Current LE             4703
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:2

  --- Logical volume ---
  LV Name                /dev/VolGroup01/LogVol01
  VG Name                VolGroup01
  LV UUID                araUBI-4eer-uh5L-Dvnr-3bI6-4gYg-APgYy2
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                1.94 GB
  Current LE             62
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           253:3

Раздел, который я хочу смонтировать /dev/VolGroup01/LogVol00. Другой раздел это swap – он мне не нужен. Теперь просто смонитруем LVM-том.

mount /dev/VolGroup01/LogVol00 /tmp/mnt

21 комментарий к “Mount LVM Partition in the RHEL / CentOSМонтирование LVM в RHEL / CentOS

  1. I must thank you for the efforts you have put in writing this site. I really hope to view the same high-grade content from you later on as well. In fact, your creative writing abilities has inspired me to get my own website now 😉

  2. I?m impressed, I have to state. Truly hardly ever do I experience a blog that?s both instructional as well as entertaining, and also let me tell you, you have hit the nail on the head. Your suggestion is outstanding; the concern is something that insufficient people are talking wisely about. I am really delighted that I came across this in my search for something associating with this.

  3. I’m really enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme?
    Excellent work!

  4. The following time I check out a blog site, I wish that it does not disappoint me as much as this. I imply, I understand it was my choice to read, yet I in fact assumed youd have something intriguing to claim. All I listen to is a number of grumbling regarding something that you might repair if you werent also active searching for focus.

Оставить ответ

Ваш адрес email не будет опубликован. Обязательные поля помечены *