LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-05-2020, 10:10 AM   #1
MeneerJansen
LQ Newbie
 
Registered: Aug 2020
Location: Holland
Posts: 10

Rep: Reputation: 3
Insert USB stick from command line


I distinctly remember that there was a simple command to "re-insert" a USB stick after you've removed/ejected it in Nautilus or Nemo by clicking the little eject icon or unmounting it. The command:
Code:
sudo eject -t /dev/sdc
does not work. It was a simple command or sets of commands. Not some sort of script. Does anybody know how to re-insert an USB stich wirthout physically removing and re-inserting it?
 
Old 08-06-2020, 01:29 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,897
Blog Entries: 1

Rep: Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080
Try partprobe.
 
1 members found this post helpful.
Old 08-06-2020, 04:29 AM   #3
MeneerJansen
LQ Newbie
 
Registered: Aug 2020
Location: Holland
Posts: 10

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by mrmazda View Post
Try partprobe.
Thanks for the tip! I'm afraid that's not it, or it doesn't work anymore in Linux Mint 17.1 (yes I know: I really should upgrade! )
 
Old 08-06-2020, 04:51 AM   #4
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,172

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
hmm..not possible to logout or reboot to see if it will help?

or check out this link you might get some idea: https://unix.stackexchange.com/quest...ted-usb-device
 
Old 08-06-2020, 05:00 AM   #5
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,897
Blog Entries: 1

Rep: Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080Reputation: 2080
Maybe use umount instead of eject, then try partprobe. That's the method I use in KDE.
 
Old 08-06-2020, 07:01 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,688

Rep: Reputation: Disabled
Try
Code:
sudo udisksctl unmount -b /dev/sdc -f
or
Code:
sudo udisksctl power-off -b /dev/sdc

Last edited by shruggy; 08-06-2020 at 07:03 AM.
 
Old 08-06-2020, 11:07 AM   #7
MeneerJansen
LQ Newbie
 
Registered: Aug 2020
Location: Holland
Posts: 10

Original Poster
Rep: Reputation: 3
Quote:
Originally Posted by shruggy View Post
Code:
sudo udisksctl power-off -b /dev/sdc
Thanks all for the tips again. The command above does the same thing as clicking on the little eject icon in my file manager Nemo (or running sudo eject /dev/sdc). The light on my USB stick goes off and it disappears from the list of devices in Nemo. After that command it also doesn't show up anymore in the command lsblk. When I use any command with umount in it the light stays on and it's easy peasy to remount it.

Maybe I'm wrong: after ejecting and/or power-off it's not possible to get power on without re-inserting the USB stick.

When I format an USB stick I always remove and re-insert the stick to force Linux to re-read the new partition table etc. I thought I remembered that I issued a command that would do the same thing without touching the USB stick. Guess I'm wrong...
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Insert line using sed or awk at line using line number as variable sunilsagar Programming 11 02-03-2012 10:48 AM
[SOLVED] Ctrl-Insert and Shift-Insert don't work val3xiv Linux - General 2 06-30-2011 05:17 PM
insert lines into a file after calculating where to insert xonar Programming 13 12-24-2009 04:37 AM
DL585 freezes on insert of USB stick poblano Red Hat 2 11-04-2008 01:53 PM
How can i make Nautilus not popup when i insert usb stick? kornerr Ubuntu 3 09-08-2007 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration