I've a mounted iso image in the path:
/mnt/iso
Inside this iso I've an install script install.sh I run the installation script from the iso and at the end the script ask to the user if he want to umount the iso itself. If the user press "y" the script execute the following code:
cd /
umount /mnt/iso
echo "Installation completed!"
Unfortunately when the script tries to execute the umount there's an error
umount: /mnt/iso: device is busy
I suppose it's due to the fact that the virtual device is busy from the script itself. How can make it work? Tnx
Use the -l
or --lazy
switch to umount
which will do a lazy umount, where it is only fully unmounted once it is no longer in use. The full description in the manual page (this is a linux specific option) is:
Lazy unmount. Detach the filesystem from the filesystem hierarchy now, and cleanup all references to the filesystem as soon as it is not busy anymore. (Requires kernel 2.4.11 or later.)