NOOB: Mount logical volume in container

Henry

Member
Jan 1, 2016
83
0
6
51
Still learning Proxmox...

I have a container that has an 8gb LVM root disk and works.

I now want to add a 2nds 100gb LVM disk to the container and have it mounted at /mnt/data

In kvm I could do this easily however I am still getting my head around containers and none of my research has resulted in an answer

Thanks in advance...
 
Hi,
this is an experimental this is the reason why it is not on the GUI.

You have to use
Code:
pct set <vmid> -mp[d] volume:name,mp=<MP_in the container>
pct set 100 -mp0 local:vm-100-disk-1.raw,mp=/mp1
 
Yes you have to set it when the ct is stopped.
And if you ad it you will see it in the config and the GUI.
So yes it is persistence.
 
Hi Wolfgang, this worked perfectly.

Now I know how at add a 2nd disk to a CT how do I remove it as this cannot be done in the GUI either at this point.
 
Hi Wolfgang, still waiting on an answer to this question please.

Can I also ask as a variation of the original question how I can add a physical disk to a CT.
i.e. On my host I have /dev/sdc1 which I wish to be able to access in a CT
 
The mountpoints/disk you have to add manually with pct.
It is not on the GUI because it is a experimental feature.
 
Hi Wolfgang and thank you for reply.

To be clear, am I correct in my understanding that to add a hdd to a CT I need to:
a) mount the storage
b) add the mounted storage to promox as a directory
b) use the pct command to add the directory to the CT

Finally I am still unsure of how to remove an item that has been added to a CT using the pct command.
 
You can just use `pct set 123 -mp1 /dev/sdx5,mp=/a/path`.
And to remove it agan: `pct set 123 -remove mp1`
Note that when you remove mountpoints which use disks backed by our storage subsystem they'll first be added as 'unused', and to finally kill the data you remove the unused disk via `pct set 123 -remove unused0`.
The GUI for mountpoint editing and removal should be available with pve-manager>=4.1-16
 
I have a need to mount an external hdd inside a CT. The CT user is "plex" however this user has not permissions for the HDD. When I try to set the permissions inside the CT I am denied.

root@pve:~# pct set 1018 -mp0 /dev/sdc1,mp=/mnt/External-HDD
root@pve:~# pct start 1018
root@pve:~# pct enter 1018
root@media:~# ls -l /mnt
total 696
dr-x------ 1 root root 712704 Aug 29 2015 External-HDD
root@media:~# id plex
uid=105(plex) gid=112(plex) groups=112(plex)
root@media:~# chmod 555 /mnt/External-HDD/
chmod: changing permissions of '/mnt/External-HDD/': Read-only file system
root@media:~#
 

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!