Cannot copy files from external USB HDD to computer

6

1

Hello I have a HDD disk connected with a USB converter to my computer. It consists of two partitions, the first one is mounted automatically and I can grab all the files from it, but the second one I have to mount manually as a root in the command line, if I try to open it with nautilus it gives an error.

The drive where the problem is is drive sdb1, sdb2 has the same settings but works fine. I am using Debian Wheezy.

This is the fstab:

/dev/sdb1       /media/usb0     auto defaults,uid=1000,umask=0777 0 0
/dev/sdb2       /media/usb1     auto defaults,gid=disk,umask=0777 0 0

And when I try to copy the files with this command (as root) cp -vr /media/usb0/* /home/user/Videos/ I get these types of errors:

cp: reading `/media/usb0/.lang/file.ext': Permission denied
cp: failed to extend `/home/user/Videos/.lang/file.ext': Permission denied

How can I at least copy the files to my main HDD? I don't need to adjust them I only need to copy them!

Update:


I got it mounted using my sudo, and the I can use the root folder, but I can't access one particular folder. Even when I use chmod -Rv 777 /home/user/external/.folder

tversteeg

Posted 2012-11-01T18:50:49.317

Reputation: 167

Have you tried 'sudo nautilus'? – Snesticle – 2012-11-01T18:58:19.157

Answers

1

You can take ownership of the whole /media/usb0/ directory: sudo chown -R $USER:$USER /media/mnt

If you are using a desktop environment, it's automount daemon should take care of mounting the volume with correct permissions. Just make sure to remove /media/usbX lines from /etc/fstab

If the volume is NTFS, make sure you have ntfs-3g installed.

nodiscc

Posted 2012-11-01T18:50:49.317

Reputation: 274

0

If I'm not concerned about security the following works nicely and quickly..

  # chmod -R 777 /mnt/yourdrive/*

You can also approach this in a more granular fashion and give a standard user ownership over select files..

  # chown standarduser /mnt/yourdrive/the/path/is/a/long/one

Scandalist

Posted 2012-11-01T18:50:49.317

Reputation: 2 767

0

It looks like the filesystem is mounted read only, because otherwise you would be able to do whatever you want as root.

You did not mention which filesystem you have on sdb1. If it is ntfs, then the standard driver will not allow you to write. The good news is you can use ntfs-3g to mount your drive. There is most certainly a FUSE package for your distro that you will need to install. As for the fstab, something like this will suffice (from my own fstab):

/dev/sda3   /mnt/media   ntfs-3g    uid=1512,umask=0022   0 0

The uid parameter must match the id of your default user, which can be found with the id command. That is, if you wish all files to be owned by that user.

Ярослав Рахматуллин

Posted 2012-11-01T18:50:49.317

Reputation: 9 076

This did not work, I still get the failed permissions when I try opening the files. I also tried it in combination with the other two answers but to no avail. – tversteeg – 2012-11-03T15:46:26.627

You know that the umask in your question disables read access, right? – Ярослав Рахматуллин – 2012-11-04T23:38:53.443

Well I removed the umask and it still doesn't works. – tversteeg – 2012-11-06T23:12:21.540

Can you verify that the file-system is mounted in read-write mode? run mount as root, find your usb-mount point-device combo and look for (rw,...). If it has (ro,...) then the system is correct in not letting you write to that usb. Also, refrain from saying "It doesn't work" because at least in this case, I know for a fact that "It does work". Try to clarify what doesn't work, or which step you can't seem to figure out. Hearing "It doesn't work" is really discouraging and makes the asker seem clueless (please don't take that personally) and uninterested in the solution . – Ярослав Рахматуллин – 2012-11-06T23:45:14.917

you should have alike looking like this: /dev/sda1 on /mnt/win type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_permissions) – Ярослав Рахматуллин – 2012-11-06T23:48:05.787

0

Have you tried mounting the disk on your /home? if not do it like this:

$sudo mkdir /home/user/external
$sudo mount /dev/sdb1 /home/user/external

Then you (i.e. user) should be able to read and write to the disk (i.e. /home/user/external)

wbad

Posted 2012-11-01T18:50:49.317

Reputation: 427