16 Jul

mounting an LVM volume partition

Let’s say you have a hard-drive to mount, and you try it:

mount /dev/sdc2 /mnt/hdc2

…and it reports an error.

mount: unknown filesystem type 'lvm2pv'

Took me a while to get this, but basically, you’re trying to load a partition from a volume, which is a pseudo file system. What you see in /dev (/dev/sdc2) is not actually the partition you think it is – it’s a container. the partition is contained /inside/ it (please correct me if I’m wrong).

So, the way you do this is:

[root@localhost ~]# pvscan
  PV /dev/sdc2   VG VolGroup01   lvm2 [74.41 GB / 32.00 MB free]
  Total: 1 [74.41 GB] / in use: 1 [74.41 GB] / in no VG: 0 [0   ]
[root@localhost ~]# lvchange --available y /dev/VolGroup01/LogVol00
[root@localhost ~]#

Then the mount is done using the name noted above (LogVol00 is obtained by looking in /dev/VolGroup01/).

[root@localhost ~]# mount /dev/VolGroup01/LogVol00 /mnt/hdc2
[root@localhost ~]#

et violin, you’re set.

4 thoughts on “mounting an LVM volume partition

Comments are closed.