mount/unmount USB stick from terminal

Forum rules
Before you post please read this
User avatar
majpooper
Level 4
Level 4
Posts: 389
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

mount/unmount USB stick from terminal

Postby majpooper » Thu Oct 13, 2016 1:39 pm

I am would like to be able to mount and unmount a USB stick using terminal commands so I can create some keyboard short cuts to mount and unmount a USB stick that is permanently plugged in. Unmounting or ejecing is simple however I have not been able to mount an umounted USP stick that is plugged. I have tried several things including making an entry in etc/fstab and creating a mount point in /mnt.

Is what I am trying to do even possible?

FreedomTruth
Level 4
Level 4
Posts: 326
Joined: Fri Sep 23, 2016 10:19 am

Re: mount/unmount USB stick from terminal

Postby FreedomTruth » Fri Nov 11, 2016 6:35 pm

You shouldn't need an fstab entry to do this.
Once you've created a mount point (for example, /mnt/usb), you also need to know the source device path. In the terminal, use the command lsblk to find the correct drive and partition (for example, sdc1). Now the example command will be sudo mount /dev/sdc1 /mnt/usb. It can be that simple, but not always. Please post back if there are any problems.

[Edit] whoops just noticed this is a month-old topic :oops:
If you abide in My word, you are My disciples indeed. And you shall know the truth, and the truth shall make you free... Most assuredly, I say to you, whoever commits sin is a slave of sin... Therefore if the Son makes you free, you shall be free indeed.

toad1
Level 1
Level 1
Posts: 22
Joined: Sun Oct 22, 2017 4:51 am

Re: mount/unmount USB stick from terminal

Postby toad1 » Wed Nov 15, 2017 3:56 pm

I think I get this now. If you plug in a USB and it shows up, it is mounted, and lsblk shows the full path, as does mount. You do not need to mount it.

But you need to unmount <path> before removal.

Alan


Return to “Mounting Partitions”