Can't mount vm logical volume for file editing

everwisher

Member
Jun 23, 2019
15
0
6
38
As I need to edit a file residing in a logical volume, I tried to mount it but failed. But I can't tell what is going wrong after searching the Internet for answers. Please help.

Here's the list of my lvs:
Code:
  LV                        VG          Attr                  LSize            Pool Origin        Data%    Meta%  Move Log Cpy%Sync Convert
  data                    pve         twi-aotz--        203.23g                                    50.94      3.06                            
  root                    pve         -wi-ao----         12.00g                                                           
  swap                  pve         -wi-ao----         8.00g                                                           
  vm-101-disk-0  pve         Vwi-aotz--       160.00g        data                     35.74                                  
  vm-102-disk-0  pve         Vwi-a-tz--        160.00g        data                     23.56                                  
  vm-102-disk-1  pve         Vwi-a-tz--        4.00m           data                       3.12                                   
  vm-199-disk-0  pve         Vwi-a-tz--        52.00m         data                     65.87                                  
  vm-199-disk-1  pve         Vwi-a-tz--        8.00g            data                      17.31

This is the response I get from $ mount /dev/pve/vm-199-disk-0 /mountpoint0
mount: /mountpoint0: wrong fs type, bad option, bad superblock on /dev/mapper/pve-vm--199--disk--0, missing codepage or helper program, or other error.
 
Usually guest-disks do have a partition table and the filesystem where the data is at is on one of the partitions (or on a LV/ZFS/...)

you can read and activate the partitions with kpartx - but make sure to remove the association after you've copied your file

Also keep in mind that the guest needs to be shutdown during this operation (else you would have access from two point, which can lead to data-corruption)

I hope this helps!
 
Usually guest-disks do have a partition table and the filesystem where the data is at is on one of the partitions (or on a LV/ZFS/...)

you can read and activate the partitions with kpartx - but make sure to remove the association after you've copied your file

Also keep in mind that the guest needs to be shutdown during this operation (else you would have access from two point, which can lead to data-corruption)

I hope this helps!

kpartx works! Thank you very much
 

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!