0

For an external hard drive, I'm getting a message that I don't have permissions.

Recursive chmod or chown would involve too many files. Also, while not an issue, let's say, at least for arguments sake, that I want to keep the files unaltered.

The GUI shows:

cannot mount

I would want to mount so that I have full access, root or sudo, to the drive through the GUI.

The disk:

thufir@dur:~$ 
thufir@dur:~$ sudo fdisk -l /dev/sdb1
Disk /dev/sdb1: 465.8 GiB, 500105740288 bytes, 976769024 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
thufir@dur:~$ 

----------------------------update-------------------------

my id is:

thufir@dur:~$ 
thufir@dur:~$ id thufir
uid=1000(thufir) gid=1000(thufir) groups=1000(thufir),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),118(lpadmin),129(sambashare),1001(rvm)
thufir@dur:~$ 

disk:

thufir@dur:~$ 
thufir@dur:~$ ll /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 100 Dec 26 03:17 ./
drwxr-xr-x 6 root root 120 Dec 26 02:05 ../
lrwxrwxrwx 1 root root  10 Dec 26 02:05 16c6c72f-9f1f-40cb-9486-9ac586d12aa3 -> ../../dm-0
lrwxrwxrwx 1 root root  10 Dec 26 02:05 50d61402-72c1-4d74-b6c1-39cccc8ec6ef -> ../../dm-1
lrwxrwxrwx 1 root root  10 Dec 26 03:17 8785d7ff-2f9c-4b0c-a581-59a5611758a8 -> ../../sdb1
thufir@dur:~$ 

what I have:

mount -t ext4 -o umask=0022,gid=1000,uid=1000 /dev/sdb1 /yourMountPoint
Thufir
  • 4,551

1 Answers1

1

Mount it like this:

mount -t ext4 -o umask=0022,gid=yourGroupID,uid=yourUserID /yourDevice /yourMountPoint

Where yourGroupID and yourUserID are the IDs for your own user (you can find the IDs in the /etc/passwd and /etc/group files respectively).

Eric Mintz
  • 2,516
  • 12
  • 24
  • /dev/sdb1 for device and ___ for mountpoint? the long "hashcode" type string? – Thufir Dec 26 '18 at 12:03
  • 1
    Yea just use /dev/sdb1 instead of the long hashcode, and whatever you want for the mountpoint - the mountpoint is just an existing directory (preferably an empty one). The long hash is actually the UUID of the same drive (you can see those in /dev/disk/by-uuid) – Eric Mintz Dec 26 '18 at 12:06