Trying to drag and drop a file from downloads folder to a sandisk flash drive. When I drag and drop the file it keeps jumping back to the downloads folder.
Maybe you don't have permissions to write on the external drive or it is a file system which cannot be read.
To find out if that's the problem, open a terminal and type
Followed by "enter". You will get something like the following output:
The size column will probably tell you which device is your flash drive (my usb stick in the picture has 15 GB for example). In the name column,
sdx always means the whole device,
sdx1 would be the first partition of the device. What you need to write down is the mountpoint of the partition (probably the first and only partition) of your flash drive, it will be something like
/media/user/foo - in my screenshot you can see my usb stick mounted at
sdc1 with mountpoint
/media/.... If no mountpoint is specified, the flash drive is not mounted. In Ubuntu automounting is activated I think by default, so removing the drive and connecting it again should do the trick. Otherwise you need to manually mount it.
Now change to your mountpoint with entering
(user being the name of your login user), now you should be seeing all your folders which already exist on your flash drive when typing
Here, the leftmost column tells you about the file permissions, it is something like
`drwxrwxrwx` or `-r-x------`
d means that this file is a directory, the first rwx are the users permissions, second rwx the group's permissions, third rwx the permissions of everybody else. r = read, w = write, x = execute. If there is a dash (-) instead of the letter itself, a certain permission is not granted. The third and fourth column tells you the user and group the files belong to. This should be your login user & its default group. If this is not the case and the permissions on the files are restricting others from writing (no w at the third triple), then you have your problem.
Now you have several possibilities to fix that:
Copy files with sudo:
sudo cp /home/user/Downloads/filename /media/user/foo/
this will give you temporarily root permissions to allow you copying the files. If you want to copy whole directories, you need to copy them recursively with
sudo cp -R /home/user/Downloads/directory /media/user/foo/
When prompted for a password, enter your user's login password.
Change the owner & group of your files: you need to go one level higher in the file system with
Then use the following commands to change user and group of the mountpoint itself:
sudo chown -R user /media/user/foo
sudo chgrp -R group /media/user/foo
-R means recursive, which will modify the user and group of each and every file and directory inside the mountpoint and the mountpoint itself. Your default group has the same name as the user in a default installation of ubuntu, verify that by entering
groupsin the terminal, the first entry is your default group. Actually, you only need the first line to make it work, the second one with the group is optional.
If nobody is allowed to write to the flashdrive (no w in any of the three sections) you need to adjust the permissions of the files with the command
sudo chmod u+w filename
u+w will give user (u) write access (+w) to the file, which you can specify with the relative path name (the path relative to the current directory) or the absolute pathname from the root directory, which will be something like /media/user/foo/filename
If this is not helping, it might be a filesystem issue. You can use gparted to check the type of file system of the flashdrive. Type
and select your device (you know the name from lsblk, it's something like "/dev/sdx"). Be careful with this tool because it can wipe whole disks! The column "filesystem" will be something like ntfs, ext4, fat, ... Please post your filesystem type here that we can help you further.
If you have any questions regarding the whole procedure, don't hesitate to ask :)
Alternate way of doing the same
First create a directory to mount usb
sudo mkdir /media/external
sudo mount -t vfat /dev/sdb1 /media/external -o uid=1000,gid=1000,utf8,dmask=027,fmask=137
For more info, refer to this and then try copy operation
cp -r $HOME/Downloads/* /media/external