7

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

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
tversteeg
  • 177

4 Answers4

2

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.

mp04
  • 321
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
  • 3,119
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.

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
  • 607