I only have access to the command line.
I need to backup my data (on the user folder) to a pen (USB DOK).
- How can I mount a flash drive manually?
- What should be the copy command?
|
I only have access to the command line.
|
||||
|
|
1. Find what the drive is calledYou'll need to know what the drive is called to mount it. To do that fire off one of the following (ranked in order of my preference):
You're looking for a partition that should look something like: 2. Create a mount point (optional)This needs to be mounted into the filesystem somewhere. You can usually use /mnt/ if you're being lazy and nothing else is mounted there but otherwise you'll want to create a new directory:
3. Mount!
When you're done, just fire off:
This answer is almost 6 years old and while the core of it still works, things like So I've added some polish from the other answers. While you're reading this footnote and you're doing this on a desktop system, there definitely are arguments for using Udisks also relies on D-Bus, so might not be available everywhere. |
||||
|
For Ubuntu 14.04 you can use 1.Find out the block device
2.Going by the size
|
|||||
|
|
You can also automatically mount USB devices on Ubuntu Server with the help of USBmount. Make sure you run apt-get update/upgrade before starting the installation:
Now install USBmount from the repositories:
USBmount mounts all USB drives in Now plug a USB drive and wait for it to be detected and mounted. As long as the host OS supports the File System it should be mounted. To verify whether the USB drive was mounted correctly you can use To un-mount a drive you can use umount.
|
|||
|
|
|
I've found that the mount command (listed as first response/answer above) is great to have the system make the USB drive available for use. If I want to copy bunches of files and/or folders from the USB drive to my internal drive, I love to use the MC (Midnight Commander) interface! MC lets you work in two side-by-side panes, tab between each pane, use the different menus or "buttons" to copy/move/delete, etc bunches of files/folders, use filtering to only select certain files (with wild cards, etc.) Really great tool that take the sting out of console work. Should be available in your favorite repository! |
|||
|
|
|
Install
No sudo needed. Replace "sdb1" with your specific device path. For more information see the manpage:
|
|||||||||||||
|
|
That's simple. When I want to use a usb drive in terminal I do this: Create a folder in
This folder will be used for the mount point. Use this command:
If you want to list the files in drive you can use the To unmount the drive you can use
Note that in my system the usb drive is |
|||||||||
|
|
In addition to using the standard To do this it is useful (but not required) to know a few things about the drive first:
Knowing these you can use a simple command to mount a drive from the command line.
this call should echo the path it is mounted at if the mount succeeds. To unmount drives mounted in this way you can run:
N.B. the If you do not know which device it is or what filesystem it uses do not fear. You can easily print out all that information with this little command:
This will print out something like this:
Those that have This means that, for example, if i wanted to mount the device 'USB DRIVE' i would run the command
These commands all work using the Using similar commands one can control almost every aspect of ones experience in Ubuntu and simulate most system programs and functions (i.e. shutdown, volume change, etc.). |
|||||||||
|
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?