Ubuntu – “Eject device” from command line

command lineeject

For a cheap Chinese 3G modem, which has a builtin USB mass storage device with Windows drivers, I have a generic linux install manual that tells me to

"Plug in your modem in USB port , on inserting you will notice icon on your desktop screen , right click on it and eject it.

However, my Ubuntu is a server without GUI. Which commands does the GUI call when I click "eject" on an USB mass storage device?

Best Answer

To eject the usb you can type in your terminal :

eject /dev/sr0

where sr0 is your device, it can be sr1,sr2 or /dev/sdb,/dev/sdc and so on, its depends on your computer.

to show the device , just type in terminal :

sudo fdisk -l or mount

it will show the device.