Bash snippet - Shorter remount command.


SUBMITTED BY: DanielK

DATE: Aug. 13, 2016, 3:06 p.m.

FORMAT: Bash

SIZE: 430 Bytes

HITS: 862

  1. # ARGS: <mount point> <remount options>
  2. # eg.
  3. # rmnt /mnt/hdd1 rw,noatime
  4. #
  5. # You don't have to go to the root of the mountpoint, just use:
  6. #
  7. # rmnt . rw
  8. #
  9. # anywhere in the mountpoint tree
  10. function rmnt() {
  11. local mntp
  12. if [ $# -gt 1 ]; then
  13. mount $( df "${1}" --output=target | { read; read -r mntp; echo "${mntp}"; } ) -o remount,$2
  14. else
  15. echo "${FUNCNAME} <mount point> <remount options>"
  16. fi
  17. }

comments powered by Disqus