This is what happens.
- I manually and successfully mount my USB drive using
mount /media/usbfrom outside a shell script which I wrote. Therefore, the drive is working and mounted normally.I manually and successfully mount my USB drive using
mount /media/usbfrom outside a shell script which I wrote. Therefore, the drive is working and mounted normally. - The very same mount command exists in this shell script. If I run this shell script while the USB drive is mounted from outside the script, the script exits without executing the rest of the script by saying:
The very same mount command exists in this shell script. If I run this shell script while the USB drive is mounted from outside the script, the script exits without executing the rest of the script by saying:
mount: /media/usb: /dev/sdc1 already mounted on /media/usb. dmesg(1) may have more information after failed mount system call.` If the drive is NOT mounted manually from outside the script like in bullet #1, the script does the mount and executes the rest of the commands inside the script without exiting the script.
mount: /media/usb: /dev/sdc1 already mounted on /media/usb.
dmesg(1) may have more information after failed mount system call.`
- If the drive is NOT mounted manually from outside the script like in bullet #1 , the script does the mount and executes the rest of the commands inside the script without exiting the script.
So, the question is how to resume the script even though the drive was already mounted?