mount/unmount USB stick from terminal

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
majpooper
Level 8
Level 8
Posts: 2084
Joined: Thu May 09, 2013 1:56 pm
Location: North Carolina, USA

mount/unmount USB stick from terminal

Post by majpooper »

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?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
FreedomTruth
Level 4
Level 4
Posts: 443
Joined: Fri Sep 23, 2016 10:19 am

Re: mount/unmount USB stick from terminal

Post by FreedomTruth »

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:
toad1

Re: mount/unmount USB stick from terminal

Post by toad1 »

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
Locked

Return to “Storage”