Skip to main content
Improved formatting. Minor fixes.
Source Link
Pablo A
  • 3.2k
  • 1
  • 26
  • 46

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.

    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:

    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.

mount: /media/usb: /dev/sdc1 already mounted on /media/usb.
       dmesg(1) may have more information after failed mount system call.`
  1. 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?

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.`
  1. 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?

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?

edited title, improved the wrinting in English
Source Link

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

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.`
  1. If the drive is NOT mounted manually fromfrom 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?

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

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.`
  1. 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?

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?

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.`
  1. 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?

Source Link

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

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.`
  1. 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?