[Techtalk] checking mounts

Joana Botto joana.botto at gmail.com
Sat Sep 26 16:12:22 UTC 2009


Hi Miriam,

What I usually do to see the mounted partitions is to type mount at
the command prompt or cat /etc/mtab.

So, to check if sdb is mounted:
$ grep sdb1 /etc/mtab

If there is no output it's not mounted.

Regards,
Joana Botto

On Sat, Sep 26, 2009 at 8:33 AM, Miriam English <mim at miriam-english.org> wrote:
> Hi folks,
>
> I want to make a shell script check whether a device is mounted or not.
>
> Anyone know how to do this? There has to be a way...
>
> It is not terribly important, just a script for myself to make my own
> life easier, but it is starting to really bug me and if I don't ask
> someone I just know I'll end up wasting hours and hours looking for the
> stupid thing. :)
>
> Thanks,
>
>        - Miriam
>
> --
> If you don't have any failures then you're not trying hard enough.
>  - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory
> -----
> Website: http://miriam-english.org
> Blog: http://miriam_e.livejournal.com
> _______________________________________________
> Techtalk mailing list
> Techtalk at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/techtalk
>


More information about the Techtalk mailing list