[SOLVED] How to mount an LXC snapshot? [device /dev/vg/snap does not exist]

moxfan

Active Member
Aug 28, 2013
104
6
38
Hi Guys,

Is it even possible to mount an LXC snapshot?

Code:
root@prox1:~# lvcreate -s --name snap vg/vm-100-disk-0
  Logical volume "snap" created.

root@prox1:~# lvs
  LV            VG  Attr       LSize   Pool Origin        Data%  Meta%  Move Log Cpy%Sync Convert
  cts           vg twi-aotz--   1.68t                    1.25   0.23
  snap          vg Vwi---tz-k 100.00g cts  vm-100-disk-0
  vm-100-disk-0 vg Vwi-aotz-- 100.00g cts                21.55

root@prox1:~# mkdir snapmount

root@prox1:~# mount /dev/vg/snap snapmount
mount: /root/snapmount: special device /dev/vg/snap does not exist.

root@prox1:~# mount /dev/mapper/vg-snap snapmount
mount: /root/snapmount: special device /dev/mapper/vg-snap does not exist.
 
you probably have to activate the snapshot with lvchange first before udev creates the /dev/mapper or /dev/vg links
 
you probably have to activate the snapshot with lvchange first before udev creates the /dev/mapper or /dev/vg links

Thanks for giving me the clue.

This didn't work:

Code:
lvchange -ay vg/snap

This worked and prepared the snapshot for mounting:

Code:
lvchange -ay -Ky vg/snap

From "man lvchange" :

Code:
-K|--ignoreactivationskip
              Ignore the "activation skip" LV flag during activation to allow LVs with the flag set
              to be activated.

A re-writeable snapshot mount was ready in less than 1 minute (a 20GB container). A read-only mount was instantly available, as expected.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!