Find the answer to your Linux question:
Results 1 to 2 of 2
Looking for a way to check a mount point is mounted and is writable and if not remount the mount point. For some reason this mount point will become unavailable ...
  1. #1
    Just Joined!
    Join Date
    Mar 2008
    Posts
    4

    Looking for a way to check mount point is mounted and is writeable

    Looking for a way to check a mount point is mounted and is writable and if not remount the mount point. For some reason this mount point will become unavailable to write too and when the script runs, to copy files to the mount point it fails.
    In the fstab it is listed as
    /dev/sdc1 /mnt/iscsi ext3 _netdev 0 0
    this has worked fine for a couple of years but now it will get lost for some reason?
    And if I umount and mount the device again it will work for a while?

    I need to write a shell script to monitor a Linux mount point on Linux. Basically, this is what I want the script to do:

    * check if the mount point is there; if yes, do nothing

    * if no, try to mount it again
    I can put this into a cron job to run ever so often



    Thanks for any help.

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,695
    1) It's an iSCSI device - there are likely network issues causing your problems.

    Code:
    /dev/sdc1 /mnt/iscsi ext3 _netdev 0 0
    2) Bash Scripting - 'touch' file on mount point - if return code != 0, umount and remount.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...