How to properly copy files from hard drive to USB flash drive in tty4 terminal?(mount, copy, unmount, exit, etc)
P.S.Can no exit from tty4 terminal via
Ctrl+Alt+F7 command, only with
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Plug in the device
lsblk to find the device name of your usb device. Naming is
/dev/sdXY. Where X is any english letter and Y is integer, typically 1.
If the device was mounted, you will see the mountpoint, for example:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:0 1 15.2G 0 disk └─sdb1 8:1 1 15.2G 0 part /media/me/4C45-110F
If not, mount it. Follow to the step #3
udisksctl mount -b /dev/sdXY , device name same as in previous step. (
/dev/sdb1 in my example) The mount folder will be reported back to you to use in the next step. For example, suppose
lsblk tells me this:
sdc 8:32 1 7.5G 0 disk └─sdc1 8:33 1 7.5G 0 part
Then I will do the following:
$ udisksctl mount -b /dev/sdc1 Mounted /dev/sdc1 at /media/xieerqi/A669-34EF.
You can see it automatically created
/media/xieerqi/A669-34EF folder and mounted my pen drive there. Also , big advantage is that you do not need
mv to get your files to the folder reported in step 3. Consult manual pages on usage of these commands.
mv are simplest.
mv FILE DESTINATION - in my example
(where FILE is the thing you want to move to the drive)
mv FILE /media/me/4C45-110F
rsync is the best for backup however.
For example, to backup
TESTDIR to my usb drive, I can do this:
$ rsync -av /home/xieerqi/TESTDIR/ /media/xieerqi/A669-34EF/~ sending incremental file list created directory /media/xieerqi/A669-34EF/~ ./ file1 file2 file3 sent 228 bytes received 125 bytes 706.00 bytes/sec total size is 0 speedup is 0.00
udisksctl unmount -b /dev/sdXY. Remove the device
$ udisksctl unmount -b /dev/sdc1 Unmounted /dev/sdc1.
NOTE: some drives mount to directories that have names with spaces. If you run
mv with not quoted names like that, your data will not be copied to correct destination. Always quote pathnames that have spaces in them.
In my case the above answer was no working so i tried this.
My system config is Ubuntu 14.04, while updating to 16.06 LTS, suddenly it stopped to work so to copy my important files , I used my pen-drive to copy.
1. List the Mount device:
2. Create a mount point :
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:
sudo mkdir /media/usb
sudo mount /dev/sdb1 /media/usb
rsync -av /home/android/Testproject/ /media/usb/
When you're done, just fire off:
sudo umount /media/usb