How to Automatically Mount Usb Flash Drive at Startup

I need to mount usb flash drive to automatically during OS startup also tried

mount /dev/sdb2 /media 

but after rebooting not able to see mounted drive please suggest.

lsusb
Bus 001 Device 003: ID 0411:00a2 BUFFALO INC. (formerly MelCo., Inc.)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

df -h
/dev/sda1
/dev/sdb2
1

2 Answers

Edit your fstab via

sudo nano /etc/fstab

and add the line below

UUID=0e281f8d-1117-451d-9b1b-b07405a631bc /media auto nosuid,nodev,nofail 0 0

Replace the UUID in my example above with the UUID of your partition

sudo blkid /dev/sdb2 | awk -F'"' '{print $2}'

Note, the entry in your fstab doesn't mount the drive if it's not present during startup.

2

You can use Ubuntu Disks utility. Open the Dash and search for Disks.

Select your USB key in the menu on the left, click the gears and select Edit Mount options :

From here simply check : Mount at startup :

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest