[lxc-users] Disk space not released after deleting rootfs image

Cal Leeming [Simplicity Media Ltd] cal.leeming at simplicitymedialtd.co.uk
Fri Dec 13 17:19:57 UTC 2013


On Fri, Dec 13, 2013 at 9:46 AM, Jinn Ko <lxc-users at mx.ixido.net> wrote:

>  When you run 'lsof | grep /tmp/lol/disk2.img' does that say '(deleted)'
> next to it?  If so, it should also identify the process id holding the file
> handle open, which is preventing the release of the space.
>

No, there is no entry in lsof for that file.

It also doesn't seem to show any entry even when lxc-start is running. I'm
thinking perhaps it doesn't show up in here because it's a kernel module
maybe, but my knowledge on that isn't great.


>
> From the log output it looks like the failure to mount /proc inside your
> container causes a failure, so I haven't understood how it is that
> lxc-execute works.  Therefore I'm wondering if the failure handling is
> missing the logic to release the mounted image.  I'm curious to know if the
> space is released when /proc is properly mounted and the container comes up
> cleanly.
>

Sadly I'm still able to reproduce this problem when the container comes up
cleanly.

Scenario here;
http://pastebin.com/VB2iRQ6z

Log here;
http://pastebin.com/49m8Kgrn

Also, here are the versions;

$ uname -a
Linux b3.int 3.8.0-34-generic #49~precise1-Ubuntu SMP Wed Nov 13 18:05:00
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.3 LTS
Release: 12.04
Codename: precise


> Jinn
>
>
>
> On 2013-12-13 05:29, Cal Leeming [Simplicity Media Ltd] wrote:
>
> Also here is the debug log;
> http://pastebin.com/Fh45gDLg
>
>  There's an entry that says rootfs is mounted but nothing to say it's
> been unmounted, and a look through the source code but I'm a bit out of my
> depth.
>
>  I've attempted to reproduce the bug directly using losetup/mount, but it
> works without problem;
> http://pastebin.com/Vk4M360P
>
>  Cal
>
>
>
>
> On Fri, Dec 13, 2013 at 4:54 AM, Cal Leeming [Simplicity Media Ltd] <
> cal.leeming at simplicitymedialtd.co.uk> wrote:
>
>> Sorry, I had sent the wrong link previously.
>>
>>  The correct link is;
>> http://pastebin.com/chBWt5u1
>>
>>  Cal
>>
>>
>> On Fri, Dec 13, 2013 at 4:36 AM, Cal Leeming [Simplicity Media Ltd] <
>> cal.leeming at simplicitymedialtd.co.uk> wrote:
>>
>>> Not sure if this helps but here is a simple test scenario that will
>>> reproduce the problem;
>>> http://pastebin.com/V0GJsNcx
>>>
>>>  Cal
>>>
>>>
>>> On Fri, Dec 13, 2013 at 3:59 AM, Cal Leeming [Simplicity Media Ltd] <
>>> cal.leeming at simplicitymedialtd.co.uk> wrote:
>>>
>>>> Hello,
>>>>
>>>>  I'm able to create containers which use a single file for their
>>>> rootfs;
>>>>
>>>>  $ dd if=/dev/zero of=/rootfs.img bs=1 count=1024
>>>> $ mkfs.ext4 /rootfs.img
>>>> -- other debootstrap commands here --
>>>>
>>>>  The image runs successfully in both lxc-start, lxc-start-ephemeral
>>>> and lxc-execute.
>>>>
>>>>  However if I then attempt to delete the rootfs image after running
>>>> lxc-start or lxc-execute, the disk space is not given back and I have to
>>>> reboot in order to reclaim the disk space.
>>>>
>>>>  Does anyone know why this might be happening? Perhaps LXC is keeping
>>>> a scale descriptor open somewhere?
>>>>
>>>>  Any help would be really appreciated, can provide more info/debugging
>>>> if needed.
>>>>
>>>>  Thanks
>>>>
>>>> Cal
>>>>
>>>
>>>
>>
>
>
> _______________________________________________
> lxc-users mailing listlxc-users at lists.linuxcontainers.orghttp://lists.linuxcontainers.org/listinfo/lxc-users
>
>
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20131213/9a893fe7/attachment.html>


More information about the lxc-users mailing list