To own-back external ext3/4 HDDs on new computer

I had a desktop on Ubuntu 18.04.2 LTS with 2 HDDs. One whole HDD with OS and usual folders. The other one, mountable on demand, named ‘MyFiles’ as backup. Recently this computer stopped working. I removed both HDDs.

I bought a new Dell desktop, with factory installed Ubuntu 16.04.12 LTS. Also purchased a SATA- HDD to USB case with power supply. I connected the OS (root) drive HDD through it, to a USB port of desktop. It is showing all the files and folders from the dead 18.04.2 LTS desktop. It even booted the 18.04.2 LTS through USB.

When I plug the ‘MyFiles’ HDD through USB port as above, it shows as mounted. But also displays this message: “This location can not be displayed. ** You do not have the permission necessary to view the contents of ‘MyFiles’.

Please tutor me how can I permanently own and/or have full access to ‘MyFiles’ ?

  1. Outputs of sudo fdisk -l for your information.
ashoke@ashoke-Vostro-3470:~$ sudo fdisk -l
[sudo] password for ashoke: 
Disk /dev/loop0: 88.5 MiB, 92778496 bytes, 181208 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


Disk /dev/loop1: 149.9 MiB, 157208576 bytes, 307048 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


Disk /dev/loop2: 149.9 MiB, 157184000 bytes, 307000 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


Disk /dev/loop3: 21.4 MiB, 22388736 bytes, 43728 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


Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 8542AC84-72D0-4508-8CAB-8B1BCACECC0B

Device          Start        End    Sectors   Size Type
/dev/sda1        2048    1640447    1638400   800M EFI System
/dev/sda2     1640448   12126207   10485760     5G Microsoft reserved
/dev/sda3    12126208 1937465343 1925339136 918.1G Linux filesystem
/dev/sda4  1937465344 1953523711   16058368   7.7G Linux swap


Disk /dev/sdb: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: gpt
Disk identifier: E0C0BEEA-846E-4574-B277-A85BBE84C5EE

Device     Start        End    Sectors   Size Type
/dev/sdb1   2048 1953523711 1953521664 931.5G Linux filesystem
ashoke@ashoke-Vostro-3470:~$
  1. The following command provides the full access till the terminal is on. Do not know how to save that ownership change.
    gksudo nautilus

Please help. :slight_smile:

  1. Assuming your backup drive is /dev/sdb as from the output of fdisk, but I don’t know why one of your drives might be missing in the output, as I only see 1 root drive for either the new or the old Ubuntu and 1 non-root drive.

  2. Gathering information.

sudo blkid /dev/sdb1
df -Th | grep "^/dev/sdb1"

Note the UUID value given by the first command as well as the file system type in the second column of the second command’s output.

  1. Backing up fstab.
sudo cp /etc/fstab /etc/fstab.backup20190728
  1. Creating mount point.
sudo mkdir -p /media/ashoke/MyBackupFiles
  1. Opening fstab for editing.
sudo nano /etc/fstab
  1. Add entry in fstab, using the correct partition identifier, i.e. /dev/sdb and UUID gathered from blkid, as well as the file system from df.
UUID=1234564567890 /media/ashoke/MyBackupFiles    ext4    noauto,user,rw    0 1

This mounts the drive at the given path as an ext4 formatted partition on demand with user permissions in read-write mode. I also enabled fsck to be run automatically on the disk, as it is your backup drive.

  1. Now try mounting the file system like this:
mount -U 1234567890

Verify if it has mounted correctly on the specified mount point and if everything works correctly, including permissions.
If it does not, then execute

sudo cp /etc/fstab.backup20190728 /etc/fstab

And start over at point 0. once again.

IMPORTANT: Make sure everything works, before rebooting, at all.

Firstly welcome to our community.
Reading the reply that @Akito has given is what you should do and there is no point in me adding anything further as they’ve covered it fully.