[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to use LVM on a file? (as opposed to on a block device)



On 3/3/2010 1:50 PM, Alexander Samad wrote:
On Thu, Mar 4, 2010 at 6:29 AM, Clive McBarton<clivemcbarton@web.de>  wrote:

I have a file which is a dump of a disk partition. It has LVM on it and
a couple of LVs in the LVM, each containing a filesystem. How do I
access them? The lvm tools like lvdisplay, vgdisplay, lvs, lvscan,
lvdiskscan expect block devices and do not have the option of using a
file instead of /dev/something. I'd like to use the LVM on the file
without writing it out as a real disk partion. How do I do that?

I would guess you could look in /etc/lvm/lvm.conf  - it defines where
it looks for pv


If your kernel is recent enough, look to the device mapper. A file can be mounted. We do it regularly with ISOs. Loopback is harder with LVM involved, but it's the same principle. The usual application, these days, is for encryption.

Mark Allums


Reply to: