about passthrough

lyan_fr

New Member
Jun 11, 2024
6
0
1
hi there,
i've built a container with a physical disk passthrough and it work nice.
since it is a backup server, i would like to have the possibility to detach the disk from server and access data connecting the disk to other pc.
actually, if i connect the data hdd to other pc i can't see what is inside. i can see some space is used, but i only see a lost+found folder.
is that possible? can someone help me?
thanks from a newbie
 
hi there,
i've built a container with a physical disk passthrough and it work nice.
Just to double check: It is a (unprivileged) container and not a VM? And it is done via mounting the disk on the host and passing it as a mountpoint?
since it is a backup server, i would like to have the possibility to detach the disk from server and access data connecting the disk to other pc.
actually, if i connect the data hdd to other pc i can't see what is inside. i can see some space is used, but i only see a lost+found folder.
If you used a mountpoint in a container (to a disk mount on the host), then something went wrong or got unmounted and the data is not stored on the disk but inside the container.
is that possible? can someone help me?
Yes, storing backups on the mount point without anything being mounted there (by accident) is quite common.
thanks from a newbie
Show the container configuration file and the host /etc/fstab and your mounts to check where it might have gone wrong.
 
this is the ct configuration:
Code:
root@pve:~# cat /etc/pve/lxc/114.conf
arch: amd64
cores: 1
dev0: /dev/sda1,mode=0777
features: nesting=1
hostname: sftp-server
memory: 512
net0: name=eth0,bridge=vmbr0,firewall=1,gw=192.168.1.1,hwaddr=BC:24:11:7D:74:BD,ip=192.168.1.151/24,type=veth
ostype: debian
rootfs: local-lvm:vm-114-disk-0,size=50G
swap: 512
unprivileged: 1

/etc/fstab
Code:
root@sftp-server:~# cat /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM
UUID=bd774fb7-9c70-4f6a-8e72-e2c8ab102f38 /media/hdd ext4 rw 0 2
 
dev0: /dev/sda1,mode=0777
I don't think that works with unprivileged containers, which would then explain why the backups are inside the container instead of the /dev/sda1.

The procedure that works is to mount /dev/sda1 (using /dev/disk/by-id/...) on the Proxmox host (like /media/backups for example) in /etc/fstab.
And then bind-mount that to the container (but not with a mount-point via the GUI because then Proxmox will destroy the data when you delete or restore the container) using
lxc.mount.entry: /media/backups srv/backups none bind 0 0. You can chose what mount points to use yourself.
 
something is not working... or i'm not understanding :rolleyes:
recap:
- create unprivileged container without add a mountpoint
- mount disk in proxmox shell : "mount /dev/sda1 /media/hdd" (just for try)
- add "lxc.mount.entry: /media/hdd /media/backups none bind 0 0" in ct configuration file

results:
i don't have any /media/backups in the container...
what am i missing?
 
something is not working... or i'm not understanding :rolleyes:
recap:
- create unprivileged container without add a mountpoint
- mount disk in proxmox shell : "mount /dev/sda1 /media/hdd" (just for try)
- add "lxc.mount.entry: /media/hdd /media/backups none bind 0 0" in ct configuration file

results:
i don't have any /media/backups in the container...
what am i missing?
There is a / at the beginning of the path for inside the container and it should not be there: lxc.mount.entry: /media/hdd media/backups none bind 0 0
Also check if your old backups are in the container (which would explain why they are not on the /media/hdd.
 

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!