I have an unused 222G file /mnt/disc/default.img
. It was created a year ago when I was in process of expanding disc space for our container. But I got distracted and never completed the task. Now I want to attach
this file to our running container in some way, maybe as a folder or as a disc device or just migrate the container to it because it's 10 times larger than the current /var/snap/lxd/common/lxd/disks/default.img
.
I am confused reading the docs and checking existing questions/anwsers because I do not see any other storage, and this file is named default.img
and we already have a "connected" default.img
somewhere else. To add to the confusiuon I do not remember how I created it and if there is already some importand data inside so this would be nice not to delete it without mounting and looking at the contents first if deleting is the only option.
I said that this file is unused, but who knows, maybe if you type another command you will see it is actually used in the container some how?
lxc storage list
+---------+-------------+--------+--------------------------------------------+---------+
| NAME | DESCRIPTION | DRIVER | SOURCE | USED BY |
+---------+-------------+--------+--------------------------------------------+---------+
| default | | btrfs | /var/snap/lxd/common/lxd/disks/default.img | 3 |
+---------+-------------+--------+--------------------------------------------+---------+
df -h|grep sda
/dev/sda1 50G 45G 10 90% /
/dev/sda2 222G 222G 0 100% /mnt
# ls -l /mnt/disc/
total 225121240
-rw-r--r-- 1 root root 256000000000 Aug 7 2021 default.img
# lxc list
+-------+---------+-----------------------+---------------------------------------------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+-------+---------+-----------------------+---------------------------------------------+------------+-----------+
| lamp1 | RUNNING | .............. (eth0) | ...................................... (eth0) | PERSISTENT | 0 |
+-------+---------+-----------------------+---------------------------------------------+------------+-----------+