How to move an ext4 formatted external drive between computers - understanding (UID) problems - worth reading BEFORE YOU INSTALL Ubuntu-Mate


We have multiple Ubuntu-Mate computers in our home. One is set up for four users. When I wanted to transfer some files from my own computer to the four-user machine I hit a wall. I was using a Grsync backup (uncompressed sync of my computer folders) on an external hard drive, which was formatted as ext4. I plugged it in on the machine with multiple users and was met with a dialogue saying I did not have the required “permission” to access the drive.

I did not understand this as I have previously used a DejaDup backup to migrate from vanilla Ubuntu (old computer) to Ubuntu-Mate (new, built-for-GNU/Linux computer) without any problems.

I have spent many hours searching for an explanation that lies within the reach of non-expert users. It boils down to this.
When you install Ubuntu or its flavours the first user (the administrator) is given the “user ID” (UID) of “1000”. If a second user is added to the same installation they are given the next number i.e. “1001”, the third user is allocated “1002” and so on. These user-IDs are used to allocate permission to access drives, folders and files on GNU/Linux computers.

So when as sole user on my computer (UID = 1000) I make a Grsync backup on an external hard drive previously formatted to ext4 on the same computer, the drive will only respond when “attached” (mounted is perhaps the term I should be using) to the account of a user whose user-ID is 1000. It does not matter which computer the user account is on, only that the UID matches. The ext4 partition format understands GNU/Linux permissions and enforces them.

My account on the four-user computer does not have UID = 1000, thus the system failed to give me access. It’s that simple.

Work-around 1: On the target computer use an account that has the same UID as on the account on the source computer.

Work-around 2: When setting up systems for multiple-users (say in your family) you may want to use UID = 1000 on each computer for an administrator account and then allocate each family member a specific UID, always using the same one for the same person no matter on which computer.

You can change the UID of another account on an Ubuntu-Mate installation if you go to SYSTEM > CONTROL CENTRE > ADMINISTRATION > USERS AND GROUPS > ADVANCED SETTINGS > ADVANCED. Be advised, that you cannot change your own user-ID. You have to use another user’s session to edit the user-ID of any given user.

See also:

I hope this helps those of you who encounter similar problems. :slight_smile: