Score:0

how to use existing default.img

kr flag

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         |
+-------+---------+-----------------------+---------------------------------------------+------------+-----------+
David avatar
cn flag
What does unused file mean?
kr flag
@David it's explained in the question
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.