I got a script that is supposed to reformat and mount
/mnt/backup_disk. Like this:
/sbin/mkfs.ext4 -q -L backup_disk /dev/disk/by-label/backup_disk mount -t ext4 /dev/disk/by-label/backup_disk /mnt/backup_disk -o noatime,data=writeback
Bash output is:
mount: special device /dev/disk/by-label/backup_disk does not exist
But right after execution, if I type on terminal:
mount /dev/disk/by-label/backup_disk /mnt/backup_disk/
Mount is fine without any kind of error.
What is causing the error when using the script?
EDIT: Solved adding a few seconds sleep like suggested in comments.