User Tools

Site Tools


informatique:logiciels:proxmox

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
informatique:logiciels:proxmox [2025/02/15 21:53] – [Redimensionner la taille du stockage local-lvm] pteuinformatique:logiciels:proxmox [2025/02/28 06:27] (current) – Partager un stockage local entre les LXC pteu
Line 149: Line 149:
  
  
 +=====Partager un stockage local entre les LXC=====
 +
 +(Inspiré de [[https://pve.proxmox.com/wiki/Unprivileged_LXC_containers|Using local directory bind mount points]])
 +Pour partager [[informatique:logiciels:proxmox#redimensionner_la_taille_du_stockage_local-lvm|la partition précédemment créée]] entre un ou plusieurs conteneurs non privilégiés (le 100 pour cet exemple) :
 +
 +Dans la conf de chaque LXC :
 +<code bash>
 +echo "mp0: /mnt/datarv,mp=/data
 +
 +# uid map: from uid 0 map 1005 uids (in the ct) to the range starting 100000 (on the host), 
 +# so 0..1004 (ct) → 100000..101004 (host)
 +lxc.idmap = u 0 100000 1005
 +lxc.idmap = g 0 100000 1005
 +# we map 1 uid starting from uid 1005 onto 1005, so 1005 → 1005
 +lxc.idmap = u 1005 1005 1
 +lxc.idmap = g 1005 1005 1
 +# we map the rest of 65535 from 1006 upto 101006, so 1006..65535 → 101006..165535
 +lxc.idmap = u 1006 101006 64530
 +lxc.idmap = g 1006 101006 64530" >>/etc/pve/lxc/100.conf
 +</code>
 +
 +Sur le système hôte:
 +<code bash>
 +echo "root:1005:1" >>/etc/subuid
 +echo "root:1005:1" >>//etc/subgid
 +chown -R 1005:1005 /mnt/datarv
 +</code>
 +
 +Puis redémarrer le conteneur:
 +<code bash>
 +lxc-stop 100 && lxc-start 100
 +</code>
informatique/logiciels/proxmox.txt · Last modified: 2025/02/28 06:27 by pteu