ubuntu@ns3103564:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 6.3G 1.6M 6.3G 1% /run
/dev/md3 1.8T 32G 1.7T 2% /
tmpfs 32G 0 32G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
/dev/md2 988M 197M 725M 22% /boot
tmpfs 1.0M 0 1.0M 0% /var/snap/lxd/common/ns
tmpfs 32G 0 32G 0% /run/qemu
tmpfs 6.3G 16K 6.3G 1% /run/user/1000
ubuntu@ns3103564:~$
ubuntu@peertube:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/loop5 28G 28G 3.5M 100% /
none 492K 4.0K 488K 1% /dev
tmpfs 100K 0 100K 0% /dev/lxd
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
tmpfs 32G 1.1M 32G 1% /dev/shm
tmpfs 13G 17M 13G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 6.3G 16K 6.3G 1% /run/user/1000
Il n'y a plus d'espace disque disponible.
ubuntu@ns3103564:~$ lxc stop peertube
ubuntu@ns3103564:~$ lxc list
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| peertube | STOPPED | | | CONTAINER | 1 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| proxy | RUNNING | 10.123.236.230 (eth0) | fd42:e702:d7b9:a433:216:3eff:fe64:5fce (eth0) | CONTAINER | 0 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
ubuntu@ns3103564:~$ lxc config device override peertube root size=800GiB
Device root overridden for peertube
ubuntu@ns3103564:~$ lxc start peertube
ubuntu@ns3103564:~$ lxc list
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| peertube | RUNNING | 10.123.236.180 (eth0) | fd42:e702:d7b9:a433:216:3eff:fed5:37c9 (eth0) | CONTAINER | 1 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| proxy | RUNNING | 10.123.236.230 (eth0) | fd42:e702:d7b9:a433:216:3eff:fe64:5fce (eth0) | CONTAINER | 0 |
+----------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
ubuntu@ns3103564:~$ lxc storage list
+------------------+-------------+--------+-----------------------------------------------------+---------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
+------------------+-------------+--------+-----------------------------------------------------+---------+
| hacktechdev_pool | | btrfs | /var/snap/lxd/common/lxd/disks/hacktechdev_pool.img | 4 |
+------------------+-------------+--------+-----------------------------------------------------+---------+
ubuntu@ns3103564:~$ lxc config device show peertube
root:
path: /
pool: hacktechdev_pool
size: 800GiB
type: disk
ubuntu@ns3103564:~$ sudo truncate -s 800G /var/snap/lxd/common/lxd/disks/hacktechdev_pool.img
Note : 'truncate' ne formate rien, il agrandit juste le fichier qui sert de « disque ».
Note : Montage automatique du pool.
ubuntu@ns3103564:~$ sudo systemctl restart snap.lxd.daemon
Warning: The unit file, source configuration file or drop-ins of snap.lxd.daemon.service changed on disk. Run 'systemctl daemon-reload' to reload units.
ubuntu@ns3103564:~$ sudo mount -o loop /var/snap/lxd/common/lxd/disks/hacktechdev_pool.img /var/snap/lxd/common/lxd/storage-pools/hacktechdev_pool
ubuntu@ns3103564:~$ mount | grep hacktechdev_pool
/var/snap/lxd/common/lxd/disks/hacktechdev_pool.img on /var/snap/lxd/common/lxd/storage-pools/hacktechdev_pool type btrfs (rw,relatime,discard=async,space_cache,user_subvol_rm_allowed,subvolid=5,subvol=/)
ubuntu@ns3103564:~$ sudo btrfs filesystem resize max /var/snap/lxd/common/lxd/storage-pools/hacktechdev_pool
Resize device id 1 (/dev/loop5) from 27.94GiB to max
ubuntu@ns3103564:~$ lxc storage info hacktechdev_pool
info:
description: ""
driver: btrfs
name: hacktechdev_pool
space used: 27.09GiB
total space: 800.00GiB
used by:
images:
- be09e63f57589681b73b4fbdda88d41f606608aae40fa812d9399c8219630ac0
instances:
- peertube
- proxy
profiles:
- default
ubuntu@ns3103564:~$ lxc exec peertube -- df -h
Filesystem Size Used Avail Use% Mounted on
/dev/loop5 800G 28G 773G 4% /
none 492K 4.0K 488K 1% /dev
tmpfs 100K 0 100K 0% /dev/lxd
tmpfs 100K 0 100K 0% /dev/.lxd-mounts
tmpfs 32G 1.1M 32G 1% /dev/shm
tmpfs 13G 224K 13G 1% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
snapfuse 119M 119M 0 100% /snap/lxd/36579
snapfuse 51M 51M 0 100% /snap/snapd/25577
snapfuse 74M 74M 0 100% /snap/core22/2163
$ lxc launch images:ubuntu/22.04 peertube --device root,size=200GiB