Changeset 3546


Ignore:
Timestamp:
Apr 4, 2016, 3:40:24 PM (3 years ago)
Author:
bruno
Message:
  • Call sync before umounting FS to avoid graphical tools from preventing it to succeed
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi/mindi

    r3543 r3546  
    235235
    236236AbortHere() {
    237     [ "$mountpoint" ] && umount $mountpoint 2>> $LOGFILE
     237    [ "$mountpoint" ] && sync && umount $mountpoint 2>> $LOGFILE
    238238    Die "Program is terminating in response to signal received from OS/user"
    239239}
     
    284284            [ "$sss" = "" ] && sss=`grep -F "$included_item" $MINDI_TMP/keymaps.find`
    285285            for ii in $sss ; do
    286                     [ -e "$ii" ] && AddKeyboardMappingFile $ii
     286                [ -e "$ii" ] && AddKeyboardMappingFile $ii
    287287            done
    288288        else
     
    16221622    LogFile "--------------------------------"
    16231623    echo -en "Kernel size = `du -sk $kernelpath | cut -f1` K\nRamdisk free = $free_space K\n" >> $LOGFILE
     1624    sync
    16241625    umount $MINDI_TMP/target
    16251626    LogAll "ERROR: Problems while creating boot media."
     
    16411642    # Some distro do auto mount at that point (Ubuntu)
    16421643    LogAll "INFO: Unmounting $USBPART just in case"
     1644    sync
    16431645    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    16441646    if [ "$BOOT_TYPE" = "BIOS" ]; then
     
    16901692    # Some distro do auto mount at that point (Ubuntu)
    16911693    LogAll "INFO: Unmounting $USBPART just in case again"
     1694    sync
    16921695    umount $USBPART 2>> $LOGFILE 1>> $LOGFILE
    16931696    # Some distro have a dmsetup conf at that point so removing it Cf: http://trac.mondorescue.org/ticket/651
     
    17491752    du -sk $MINDI_TMP/mpt/* >> $LOGFILE
    17501753    LogFile "--------------------------------"
     1754    sync
    17511755    umount $MINDI_TMP/mpt
    17521756    LogAll "ERROR: Problems while creating boot media."
     
    17781782fi
    17791783
     1784# Avoids graphical tool to keep the FS mounted
     1785sync
    17801786umount $MINDI_TMP/mpt || Die "Unable to unmount $MINDI_TMP/mpt"
    17811787
     
    17901796        # We need the boot image now and what mindi needs at restore time as well
    17911797        cp -a $MINDI_TMP/mpt2/images/all.tar.gz $MINDI_CACHE/mindi-bootroot.img $MINDI_TMP/mpt/images
     1798        # Avoids graphical tool to keep the FS mounted
     1799        sync
    17921800        umount $MINDI_TMP/mpt2
    17931801        LogFile "----------- target dir content -----------"
     
    29202928        (cd "$mountpoint" && ln -sf usr/sbin/init linuxrc)
    29212929        # unmount loop filesystem and create image file using the standard approach
     2930        sync
    29222931        umount $mountpoint || Die "Cannot unmount $tempfile"
    29232932        dd if=$tempfile bs=1k of=${rdz_fname}.tmp > /dev/null 2> /dev/null
     
    29402949        # create cpio image file and unmount loop filesystem
    29412950        (cd "$mountpoint" ; find . -print | cpio -o -H newc 2> /dev/null | gzip -9 > $rdz_fname)
     2951        sync
    29422952        umount $mountpoint || Die "Cannot unmount $tempfile"
    29432953        # log that we are done
Note: See TracChangeset for help on using the changeset viewer.