Sample Header Ad - 728x90

My shell script exits if I try to mount from within the script an already mounted drive How can I make my shell script resume?

0 votes
3 answers
151 views
This is what happens. 1. I manually and successfully mount my USB drive using mount /media/usb from outside a shell script which I wrote. Therefore, the drive is working and mounted normally. 2. 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.`
3. 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?
Asked by superlinux (131 rep)
Aug 9, 2024, 06:53 AM
Last activity: Aug 10, 2024, 07:23 AM