External USB drive not mounting - Terminal help needed

Discussion in 'macOS Sierra (10.12)' started by nealandrews, Jul 26, 2017.

  1. nealandrews macrumors newbie

    nealandrews

    Joined:
    Jul 26, 2017
    #1
    Hi guys

    I used the following terminal commands to stop MacOS automatically mounting an external USB drive...

    sudo pico /etc/fstab
    UUID=NUMBER none hfs rw,noauto

    Source:
    https://www.cnet.com/uk/how-to/how-to-prevent-a-volume-from-mounting-at-boot-in-os-x/#

    (The USB drive is attached to a Cinema Display, so I was trying to stop it mounting when I plug my MacBook Pro into the display, simply because it's an archive that I don't use often, and it's really noisy when it spins.)

    However, now when I plug in the drive, it doesn't mount! Obviously. My bad, I know.

    How do I reverse this Terminal command?

    Many thanks

    Neal
     
  2. gsahli macrumors 6502a

    gsahli

    Joined:
    Jun 1, 2007
    Location:
    Chicago
    #2
    sudo means superuser do - it gives you permission to write/edit protected files.
    pico is a terminal/text editor
    /etc/fstab is a file system table, where permanent mount info is kept.
    The UUID line is supposed to identify a specific drive and give mount info.

    Be very careful about changing this file.
    You can probably fix this by removing the UUID line you added.
    It might be safer if you copy and paste that file text (/etc/fstab) here and let us give specific instructions.
     
  3. nealandrews thread starter macrumors newbie

    nealandrews

    Joined:
    Jul 26, 2017
    #3
  4. gsahli macrumors 6502a

    gsahli

    Joined:
    Jun 1, 2007
    Location:
    Chicago
    #4
    Then run this command to delete the fstab:
    sudo rm /etc/fstab
     
  5. nealandrews thread starter macrumors newbie

    nealandrews

    Joined:
    Jul 26, 2017
    #5
    Within the text editor, or just the normal terminal environment?
     
  6. gsahli macrumors 6502a

    gsahli

    Joined:
    Jun 1, 2007
    Location:
    Chicago
  7. treekram macrumors 6502a

    Joined:
    Nov 9, 2015
    Location:
    Honolulu HI
    #7
    If you have changed how use the drive and want it automatically mount every time it's connected, then deleting file is want you want, presuming there are no other entries that you have made to fstab.

    If you still don't want the drive to mount automatically but will access the drive once in a while, you can keep the fstab file intact but you should be able to use Disk Utility to mount the drive manually.
     
  8. nealandrews thread starter macrumors newbie

    nealandrews

    Joined:
    Jul 26, 2017
    #8
    Thanks guys!
    --- Post Merged, Jul 26, 2017 ---
    This worked perfectly, thank you.
     

Share This Page