0

Is it possible to mount an already mounted LVM volume somewhere else ?

I have LXC using an LVM volume as storage, and I would mount the volume on the host for easier backup management.

When I try to mount the volume, here is what I got :

# mount /dev/lxc/bdd /mnt/bdd
mount: /mnt/bdd : /dev/mapper/lxc-bdd already mounted or mount point busy.

If it's not possible, how can I managed "persistent volume" with LXC using LVM backend storage ?

3

One does not "mount" LVM logical volumes or any other block abstraction. Those are block devices, which can contain filesystems on them. These filesystems can be mounted to directory hierarchies.

However, if you wish to mount a filesystem on more than one machine, then that filesystem needs to be clustered or shared in some way.

NFS, CIFS, and GlusterFS are examples of filesystems that are shared. These filesystems can me mounted by any number of machines, and follow a client / server model. These shared filesystems are backed by more "traditional" filesystems on machines that are being used as fileservers.

Alternatively, there are clustered filesystems, such as OCFS2 or GPFS. These filesystems can be mounted to multiple machines at one time in a cluster, and internally handle the details of cross-node replication or distribution and resource locking.

If you try to mount a filesytsem that is not shared or clustered (such as traditional filesystems like EXT{3,4}, BTRFS, XFS) multiple times on one machine, it will fail with the error you see above. Most filesystems like this will also fail to mount on another separate machine while it's mounted elsewhere (in the case of shared block storage across mutiple nodes with a non-clustered filesystem on top). However, in a worst case scenario another machine won't be aware that a local filesystem has been mounted by another, and both will mutually destroy the dual-mounted filesystem.

The long and short of it is, all actions done to a filesystem must be accounted for. Actions that are not caught by an accountability mechanism are effectively corruptions. Accountability mechanisms on local-only filesystems are not designed to be clustered, and are restricted to a single kernel and a single mount point.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.