I am trying to copy a file from my Download directory to my Desktop directory; but I am getting the Permission Denied Error. Directory and file permissions doesn't restrict me from copying (Directory perm: 755 , file perm:- 664).
sockets@ankit:~$ ls -ld D
Desktop/ Documents/ Downloads/
sockets@ankit:~$ ls -ld Downloads/ Desktop/
drwxr-xr-x 9 sockets sockets 4096 Jan 4 12:52 Desktop/
drwxr-xr-x 3 sockets sockets 4096 Jan 10 16:24 Downloads/
sockets@ankit:~$ ls -l Downloads/Ankit.pdf
-rw-rw-r-- 1 sockets sockets 96170 Jan 10 16:24 Downloads/Ankit.pdf
sockets@ankit:~$ cp Downloads/Ankit.pdf Desktop/Ankit.pdf
cp: cannot create regular file `Desktop/Ankit.pdf': Permission denied
Any ideas why I would be getting the permission error. I know I can use sudo to copy the file.
----------EDIT -1
sockets@ankit:/var/log$ df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 2501856 228878 2272978 10% /
udev 755379 510 754869 1% /dev
tmpfs 757578 431 757147 1% /run
none 757578 3 757575 1% /run/lock
none 757578 8 757570 1% /run/shm
/dev/sda6 27639808 37521 27602287 1% /home/mount
----------EDIT 2
sockets@ankit:~$ df -h | grep /dev/sd
/dev/sda1 38G 8.5G 28G 24% /
/dev/sda6 416G 87G 308G 22% /home/mount
/dev/sdc1 16G 2.1G 14G 14% /media/New Volume
sockets@ankit:~$ mount | grep /dev/sd
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
/dev/sda6 on /home/mount type ext4 (rw)
/dev/sdc1 on /media/New Volume type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
Here's another scenario that would cause the problem
In this case I already created a file in the destination directory with sudo so that it was owned by root. The file can not be overwritten by a normal cp command as user and results in a 'Permiision denied' error.
OK, strange that it worked OK after creating a file with touch. I'm wondering if there's file system error of some sort in which case I'd strongly advise that you force an fsck check of the filesystem - Easily done. Save all open files and in a terminal window:
After the machine comes back up it will test the root partition and then boot into Ubuntu normally. It may prompt you for permission to repair the file system or tell you what problems if any have been fixed.