How to create a Media-Files Data-Pool on an existing LVM? Error: "No Disks Unused"

Hi! New to Proxmox and Linux but managed to have Proxmox and Home Assistant running on my HP MiniPC. What unfortunately doesn’t work: I would like to create a media data area on the internal M.2 SSD (a ton of FLAC, MP3, images…) and provide 600 GB for this. All VMs and external devices (e.g. my AV receiver, Home Assistant and Win11) should be able to access this data - it is a media pool on the MiniPC (Samba Share, LXC, SMB mount?).

However, when I want to create this area on Proxmox, I always get the message “No Disks Unused”. Volume group, thinpool or Create Directory - doesn’t work. Apparently the entire M.2 (1TB) has already been assigned to a LVM and I can’t assign anything to it, separating a pool from it. How does it work correctly? See my actual config on the image. Thanks for any help!

This can be more complicated than it appears on the surface because there are several ways to do this depending on your situation and few are accomplished from the UI. I don’t think it’s necessary to do anything to the disk if you’ve already got it formatted and assigned, but there are a few different ways to handle this.

If multiple LXC containers need access, I’d create a directory and bind mount that directory to the containers. If you can get by with just one container sharing the data, you can add a 600GB mount point to the container from the UI and then share that out using sshfs and/or samba.

1 Like

Thx for the reply, but to be honest I even don’t know where to start now. :smiley: Do I have to make that directory first via the Proxmox shell? What would be the command for this? My DOS days are long behind me and for a Windows user Linux still is a mystery. :wink:

Yeah, no problem. I totally get that this is a lot for someone just getting started with it. Here’s one way to do this:

Make a Directory

Go into the PVE shell and run a command to make a directory wherever you want it to live.

In Unix-y systems / is the root of the file system and everything else is a file under that root. So if you wanted your shared folder to be called “storage”, use the command:

mkdir /srv/storage

That would make that directory under the existing directory /srv.

Attach Directory to Container

While you’re in the shell, you’ve got to add the newly created directory to your LXC. You do that by editing the config file for the container. The simplest copy/paste-friendly way of doing it would be to append a the needed line:

echo "mp0: /srv/storage,mp=/srv/storage" >> /etc/pve/lxc/101.conf

That will mount your newly made /srv/storage folder on the host to the same path inside LXC #101 (change the ID number if your container uses a different one).

Permissions

If you left the “Unprivileged” setting ticked when you made the container (you should in most cases), you’ll need to change the permissions on the directory so the container can see it. The reasons for this are kind of tough to explain in short order, so I’ll just say, from the PVE shell run the command chown 100000:100000 /srv/storage. That will make it so from inside the container’s perspective, that directory is owned by the root user.

Caveats

If you had installed your Proxmox system using ZFS (which is almost always my preference) the first step would be a little different. There are a lot of good reasons to use ZFS and if you’re planning to use this machine for a while, it may be worth reinstalling PVE so you can take advantage of ZFS’s benefits.

Lastly, if this is more a machine for hosting services without having to think much about it, you might be better off skipping all of the stuff I just mentioned and looking into installing CasaOS. I think you can do it right on top of you Proxmox installation and then you’ll be able to do all of the basics from within the CasaOS ecosystem, which is much more consumer focused. Give it a look, anyway.

1 Like

Thank you! I have now installed CasaOS (looks nice and fast), Win11 is now also running (albeit surprisingly slow) and I have also installed Plex-VM to see if it works as a media player. I have also created a “media” directory under mnt/bindmounts/ - at least I think so. :smiley: Assignment to all IDs is done, I think (see picture). However, this media directory does not appear under “mnt” in CasaOS. The mnt directory in the root is empty.

The file system is still a mystery to me anyway. The command lines are very similar to the old MS DOS and yet it is different. “ls” apparently only shows file uploads, “lsblk” shows me a directory structure, but also only the PVE structure, not the directories that I can see in the root under CasaOS, for example. Puzzling, this Linux :wink: And what do the blue dots on the CasaOS and Plex VM actually mean?

Keep tinkering and you’ll figure it all out. One great way to learn these things is to check out the manuals for each command. For ls, you can type man ls into the terminal and it will bring up a page with all of the flags and their meanings—for example, ls -l shows the contents of the current directory in list form.

By the way, ls is a different command from lsblk. The latter is a program that lists block devices (hard drives and partitions), while the former shows the contents of directories.

It looks like the commands you included were correct. I think you have to stop and start the containers in order for them to see that there’s a change in the config file. One thing to think about that I may not have mentioned earlier: what happens if two containers try to use the same file at once? That’s one possible downside to bindmounting in multiple containers. It may never matter to your use case, but it’s worth knowing about. I have a few containers that have my media directory bindmounted and I usually use a read-only bindmount. To do that, you edit the config file (something like nano /etc/pve/lxc/101.conf) and add ,ro to the end of the line that you added in with those previous commands.

Lastly, those blue dots indicate that you added a tag or keyword to those two containers.

2 Likes