Giter VIP home page Giter VIP logo

ud's Introduction

ud

USB Drive - Ubuntu Server 18.04 (Mount USB storage devices available to the system)

Description:

Why? Mounting USB disk drives in Linux is a common task. In my case, Ubuntu servers; found it is quite a tedious task...

  • Needed a quick and simple command to mount only USB storage devices.
  • Ensure critical storage (e.g. ZFS pools) and other devices on the servers were not touched.

What?

Simple bash script to mount any and all available USB drive partitions by invoking a simple command .

  • The program enumerates available USB disk partitions and mountpoints.

    • The program will look for and mount ONLY USB storage devices.
    • It can easily be expanded to mount other disk types (not tested).
  • Mountpoint:

    • The LABEL of the partition is used; if it exists.
      • Mountpoin is set to /media/$LABEL. (It can be set to any other folder if needed).
      • A folder named $LABEL (disk's label) is created if it does not exist.
    • If the partition does not have a label, the program will attempt to use USB$NAME (USB + Partition logical block name)
      • e.g. /media/USBsdb1
  • Filesystem:

    • It's chosen by looking at the filesystem of the partition itself.
      • e.g. ntfs, ext4, etc.
  • Logs: Added logging and conf file as I was initially planning on having it run as a daemon with more functionality, but realized it was unnecessary.

How do I use the script?

  1. Label your USB disk partitions as you want to be mounted by the system.
  2. Install script at /usr/local/bin (for convenience)
  3. Run command:
    • ud -a [add: mount partitions of USB disks connected to the system]
    • ud -c [check: check what USB drives are available in the system]

Only tested on Ubuntu Server 18.04

ud's People

Contributors

tibre avatar lestig avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.