Home > Enterprise >  Avoid delay after Linux mount
Avoid delay after Linux mount

Time:08-01

I'm executing those commands:

mkfs.msdos -C path/to/file/some_file.img 1440

sudo mount -o loop path/to/file/some_file.img /path/to/folder/mounted_folder

After those commands, I copy files to mounted_folder and upload the some_file.img file to NFS server.

I do it all in Ansible and it happened so fast that some_file.img uploaded empty.

I gave it a 5-minute delay and the some_file.img was good (with content in it).

I don't want to do it with delay, there is any command I can use to ensure that the some_file.img file will upload with the content in it (and not be empty)?

CodePudding user response:

Unmount the directory when you're finished to ensure everything is flushed to disk.

sudo umount /path/to/folder/mounted_folder
  • Related