Hi everyone, new to Proxmox and Linux as a whole.
Over the last week or so, I've been trying to setup my storage (among other things). While I've been largely successful at setting up the rest of my server, setting up my storage the way I want has been a huge challenge.
What I want is:
What I did and what worked:
Conclusion
Wat do? I know I can just bind mount all my drives directly from my host node into every LXC but that's such a huge waste of time and also redundant. So is editing every LXC's
Over the last week or so, I've been trying to setup my storage (among other things). While I've been largely successful at setting up the rest of my server, setting up my storage the way I want has been a huge challenge.
What I want is:
- All 5 of my internal NTFS HDDs displayed in Proxmox and accessible by my host node, all my LXCs as well as the machines on my local network.
- I will be reformating these SATA HDDs to ext4 at some point in the future once I get a 6th HDD and am able to move files off them. For now, NTFS.
- Any USB Drives I plug in, regardless of format (most likely NTFS for compatibility with Windows and other devices) must be 'plug and play'.
- Time efficiency.
What I did and what worked:
- Installed
ntfs-3g
on host node.- I checked every LXC with
ntfs-3g --version
and it looks like its installed on every LXC as well as the host node?
- I checked every LXC with
- Mounted an NTFS USB Flash Drive to my host node.
- Added the USB Drive to
/etc/fstab
so that it would auto mount
- Added the USB Drive to
- Created a privileged LXC and installed Samba on that LXC.
- Mounted that USB Drive onto the Samba LXC and created a share for the whole drive.
- This USB Drive is now visible on my Windows PC from my Proxmox box. Excellent.
- Created a privileged LXC for Plex Media Server.
- Enabled "cifs" in LXC features.
- Installed
smbclient
andcifs-utils
on my Plex LXC.- I can see all the shares I created on the smb LXC by typing
smbclient -L <ip-of-samba-LXC>
- I can see all the shares I created on the smb LXC by typing
- Successfully mount the USB Drive share that is mounted on the Samba LXC to the Plex LXC using the following command:
mount -t cifs -o username=x,password=x,uid=x,gid=x,vers=3.0,iocharset=utf8 "//192.168.0.x/Josh's USB" /mnt/drives/usb-key/
- It seems USB Drive is 'plug and play'.
- The mounted share on the Plex LXC disappears after reboot of LXC/server because I do not have an
/etc/fstab
entry.- I was hoping that adding the entry to the Samba LXC
/etc/fstab
would work, but it does not. Since it doesn't, this makes mounting shares to my LXCs 100x more tedious since I would have to edit/etc/fstab
for every LXC and add an entry for every mount I want to share. Unless I'm missing something and the Samba server/etc/fstab
really is where you add the entries. The command below is what I entered: "//192.168.0.x/Josh's USB" /mnt/drives/usb2C-key/ cifs _netdev,x-systemd.automount,x-systemd.requires=network-online.target,uid=x,gid=x,username=x,password=x,vers=3.0,iocharset=utf8 0 0
- Note: I get an error when I enter the command
mount -a
with the above in my/etc/fstab
. - The error:
mount: /etc/fstab: parse error at line 1 -- ignored
- I was hoping that adding the entry to the Samba LXC
- I decided to change course and try to add CIFS storage via the Proxmox WebUI.
- It seems the Proxmox WebUI does not like shares with spaces in their name. The share I created for my USB Drive comes up as "USB" not "Josh's USB".
- Trying to add that share spits out an error:
create storage failed: error during cfs-locked 'file-storage_cfg' operation: storage 'usb-key' is not online (500)
- However, using the pvesm command works perfectly. Full command below.
pvesm add cifs usb-key --server 192.168.0.103 --share "Josh's USB" --username x --password x --smbversion 3.0
- I do not know where to go from here though. Is this even what I want? Would I still need to edit
/etc/fstab
endlessly?
- While I was at it, I tried to add some shares from my Windows machine and it also seems there's weird crap going on there too.
- Many of my Windows shares are labelled according to the drive that they are on. So my Backup folder on my "Storage 3" drive is named "[S3]Backup". When I shared that on my home network, Windows renames and shares it as "S3 Backup".
- I have 7 Backup folders (7 drives). Proxmox WebUI detects one as "Backup". I do not know which folder that is, specifically.
- When I try to add the Backup folder that Proxmox detects, I get an error:
create storage failed: error during cfs-locked 'file-storage_cfg' operation: storage 'backup' is not online (500)
- That error is the same for every share, except for one share that is a folder without spaces or square brackets in the share or actual folder name. That share is detected correctly by Proxmox.
- Unlike above where
pvesm
worked, sharing "Josh's USB", I get the same error as with the WebUI.
Conclusion
Wat do? I know I can just bind mount all my drives directly from my host node into every LXC but that's such a huge waste of time and also redundant. So is editing every LXC's
/etc/fstab
for Samba sharing. Is there no better, cleaner way to do what I want? Also, why aren't my Windows share's being added? Proxmox bug? Or does Linux simply not like square brackets and spaces?
Last edited: