how to use device mount points in lcx. in the wiki no commands are mentioned about it. i'm very new to proxmox and want to attach an existing disk to

sskniranjan

New Member
May 4, 2023
2
1
1
how to use device mount points in lcx. in the wiki no commands are mentioned about it. i'm very new to proxmox and want to attach an existing disk to LXC without wiping it. Have tried to understand the bind mount point and uid mapping and all ..it seems more technical and confusing. so what are the other options to achieve the objective.
 
I am sorry to hear that you are confused. I am afraid I cannot recommend other ways of doing this.

What you could do, though, is make new Containers and VMs that you don't need and then try things out with those. That way you don't lose critical data.
Just try things out, read the docs and the forum, watch videos, read manpages etc. Proxmox, and Linux for that matter, are pretty complex pieces of software and it takes a while to become comfortable with it.

Alternatively, it is pretty easy to move and attach disks in VMs, so if you don't need Containers, it might be easier to use VMs in the beginning.

Best of luck :)
 
the manual talks about device mount points but it fails to provide details on how to achieve that. can you please elaborate onto that
 
  • Like
Reactions: panchuz
the manual talks about device mount points but it fails to provide details on how to achieve that
This is not true: Section 11.4.4 of the admin guide [1] tells you how to use mount points, how to create them from the commandline with pct and how to add them into the config files of containers.
can you please elaborate onto that
Here is an old forum post on how to mount disks form other containers [2].

[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pct_settings
[2]: https://forum.proxmox.com/threads/i...ge-to-a-different-container.69717/post-312751
 
This is not true: Section 11.4.4 of the admin guide [1] tells you how to use mount points, how to create them from the commandline with pct and how to add them into the config files of containers.

Here is an old forum post on how to mount disks form other containers [2].

[1]: https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pct_settings
[2]: https://forum.proxmox.com/threads/i...ge-to-a-different-container.69717/post-312751
This is not true `/pve-docs/chapter-pct.html#_device_mount_points` only says

Device Mount Points

Device mount points allow to mount block devices of the host directly into the container. Similar to bind mounts, device mounts are not managed by Proxmox VE’s storage subsystem, but the quota and acl options will be honored.

Device mount points should only be used under special circumstances. In most cases a storage backed mount point offers the same performance and a lot more features.
The contents of device mount points are not backed up when using vzdump.


I personally wanted to mount the whole block device and then do a integrity check on a new nvme that I got prior to adding to a zfs pool.
I added this options to my /etc/pve/<ctid>.conf file.

Code:
unprivileged: 0
dev0: /dev/nvme0n1p1,mode=0777

lxc.cgroup2.devices.allow: b 259:* rwm
lxc.mount.entry: /dev/nvme0n1 dev/nvme0n1 none bind,optional,create=file
lxc.apparmor.profile: unconfined

I took some advice from ChatGPT so I need to see if all of this is necessary or if only some of these are needed.
Prior to this, I was getting "must be superuser" and "device is read only" when trying to mount an ext4 partition using the mount command in the LxC.
Even at this point, I only mounted a partition and not the block device, but maybe I don't need to for this.
I also wanted to avoid using mp0, etc. as I didn't want to create directories on the host to bind mount to.
Personal choice and I wanted to get device mounts working since they exits.
 
Last edited: