freebsd / crochet

Build FreeBSD images for RaspberryPi, BeagleBone, PandaBoard, and others.
BSD 2-Clause "Simplified" License
611 stars 188 forks source link

Image umount fils with "Device busy" #58

Closed smithwinston closed 10 years ago

smithwinston commented 10 years ago

Using crotchet-freebsd on a VirtualBox FreeBSD x64 image, at the end, the script fails with "Device Busy" when it tries to umount the two md0 partitions:

Unmounting /home/winston/Work/crochet-freebsd/work/_.mount.boot
umount: unmount of /usr/home/winston/Work/crochet-freebsd/work/_.mount.boot failed: Device busy
rmdir: /home/winston/Work/crochet-freebsd/work/_.mount.boot: Device busy
Unmounting /home/winston/Work/crochet-freebsd/work/_.mount.freebsd
umount: unmount of /usr/home/winston/Work/crochet-freebsd/work/_.mount.freebsd failed: Device busy
rmdir: /home/winston/Work/crochet-freebsd/work/_.mount.freebsd: Device busy
Releasing md0
mdconfig: ioctl(/dev/mdctl): Device busy

According to fuser, it's gvfsd-trash (I run an Xfce4 desktop) that has the mount point open:

[root@freebsd /home/winston/Work/crochet-freebsd]# fuser /usr/home/winston/Work/crochet-freebsd/work/_.mount.boot
/usr/home/winston/Work/crochet-freebsd/work/_.mount.boot:  1058
[root@freebsd /home/winston/Work/crochet-freebsd]# ps -p 1058
 PID TT  STAT    TIME COMMAND
1058  -  I    0:00.90 /usr/local/libexec/gvfsd-trash --spawner :1.8 /org/gtk/gv

Not sure if there's a way to avoid this ... perhaps use umount -f to unmount the md0 loopback filesystems?

kientzle commented 10 years ago

You should talk to these guys:

http://www.marcuscom.com/pipermail/marcuscom-devel/2013-December/003089.html

Apparently, gvfsd-trash ignores certain filesystems.

You can move Crochet's work directory: set WORKDIR=/safe/directory as the very first line of your crochet configuration file (even before board_setup).