during ramdisk-image-create most of /dev is removed

Bug #1202612 reported by Derek Higgins
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
diskimage-builder
Fix Released
Critical
Derek Higgins

Bug Description

Following the command
$ ramdisk-image-create -a i386 ubuntu deploy -o deploy-ramdisk

which failed with

dib-run-parts Thu Jul 18 09:46:39 UTC 2013 Running /tmp/in_target.d/install.d/99-up-to-date
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
umount: /tmp/image.kzoiXlem: target is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
rm: cannot remove '/tmp/image.kzoiXlem/mnt/tmp/ccache': Device or resource busy
rm: cannot remove '/tmp/image.kzoiXlem/mnt/tmp/in_target.d': Device or resource busy
rm: cannot remove '/tmp/image.kzoiXlem/mnt/sys/fs/ext4/dm-1/inode_readahead_blks': Operation not permitted
<snip/>
rm: cannot remove '/tmp/image.kzoiXlem/mnt/proc/80297/cgroup': Permission denied
rm: cannot remove '/tmp/image.kzoiXlem/mnt/proc/80297/oom_score': Permission denied
<snip/>

I'm left with a /dev filesystem on my host system with pretty much nothing in it
[root@rhev-i16c-02 toci]# ls -l /dev/
total 0
drwxr-xr-x. 3 root root 0 Jul 16 15:44 hugepages
drwxrwxrwt. 2 root root 40 Jul 16 15:44 mqueue
-rw-r--r--. 1 root root 0 Jul 18 11:11 null
drwxr-xr-x. 2 root root 0 Jul 16 15:44 pts
drwxrwxrwt. 2 root root 40 Jul 16 15:44 shm
[root@rhev-i16c-02 toci]#

Revision history for this message
Derek Higgins (derekh) wrote :

I should have mentioned the last 4 lines of the output above correspond to what was left behind in /dev of the host server

rm: cannot remove '/tmp/image.kzoiXlem/mnt/dev/hugepages': Device or resource busy
rm: cannot remove '/tmp/image.kzoiXlem/mnt/dev/mqueue': Device or resource busy
rm: cannot remove '/tmp/image.kzoiXlem/mnt/dev/pts': Device or resource busy
rm: cannot remove '/tmp/image.kzoiXlem/mnt/dev/shm': Device or resource busy

Revision history for this message
Robert Collins (lifeless) wrote :

I managed to trigger this debugging the repository-sources hook when I exited right after extra-data or thereabouts.

Super painful thing to deal with!

Changed in diskimage-builder:
status: New → Triaged
importance: Undecided → Critical
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Hypothesis: /dev is still bind mounted when we clean things up from a crash or forced ctrl-c.

Suggested solution: rm --one-file-system

Revision history for this message
WangDong (woshisuidonghui) wrote :

when I use disk image builder, I can not find the images. I made an image,it says that the image will aside in /tmp but I can not find it. Any answers will be appreciated! Thank you!

Revision history for this message
Derek Higgins (derekh) wrote :

@WangDong what command are you using? If you ask on #tripleo on freenode irc we can try and help out.

Derek Higgins (derekh)
Changed in diskimage-builder:
assignee: nobody → Derek Higgins (derekh)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to diskimage-builder (master)

Reviewed: https://review.openstack.org/38781
Committed: http://github.com/stackforge/diskimage-builder/commit/e79968f6825093a2f9aa8fb7040004cb8fe42739
Submitter: Jenkins
Branch: master

commit e79968f6825093a2f9aa8fb7040004cb8fe42739
Author: Derek Higgins <email address hidden>
Date: Fri Jul 26 10:42:47 2013 +0100

    Only remove $TMP_BUILD_DIR on cleanup

    During ramdisk cleanup if for some reason the filesystems mounted
    in $TMP_BUILD_DIR were not removed this recursive delete ended up
    deleting parts of the host filesystem that were mounted (in particular
    most of the contents of /dev got removed.

    This commit doesn't deal with the reason the filesystem didn't unmounted
    but ensures the consequences are not as severe.

    Fixes Bug 1202612

    Change-Id: Id8eba0753c2fe76c79ae1d952ce690d26e33e3ed

Changed in diskimage-builder:
status: Triaged → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/38782
Committed: http://github.com/stackforge/diskimage-builder/commit/d8ba46f8e3f2e54cd8996f9a3d7142440d541152
Submitter: Jenkins
Branch: master

commit d8ba46f8e3f2e54cd8996f9a3d7142440d541152
Author: Derek Higgins <email address hidden>
Date: Fri Jul 26 10:54:45 2013 +0100

    Install which on Fedora

    Create an install hook where core utilities can be installed
    on Fedora. In this case we are installing which.
    Which is being used by
      ramdisk/post-install.d/01-ensure-binaries
      vm/finalise.d/51-grub
    The absence to which caused the ramdisk build to fail on F19.

    On Ubuntu which is installed with the package debianutils, this pretty
    much has to exist on Ubuntu images, so a corresponding package install for
    ubuntu isn't needed.

    Fixes Bug 1202612

    Change-Id: I847c1619cdab021c9348caed3fa32db64e663e8e

Changed in diskimage-builder:
status: Fix Committed → Triaged
Derek Higgins (derekh)
Changed in diskimage-builder:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.