Can I create a new user in Manjaro Live USB?

I am restoring a backup of my home partition and I needed to boot in to a Live environment running from a USB to rsync it back.
Maybe I’m doing this wrong but I created the backup as a particular user with the -a (archive) option to preserve permissions and ownership etc…

Now to restore that backup with rsync from a Live Manjaro USB environment do I need to create that same user and run the rsync command as that user? Or if I run sudo rsync… will the permissions and everything be restored?

If I need to run the rsync command as the same user I was when I made the rsync backup then can somone help me create a new user in the Manjaro Live Environment?

When I do these commands:
$ sudo useradd -m test
$ sudo passwd

I get prompted to enter the current password for the “test” user but I haven’t given it a password yet? I tried just pressing ENTER and hitting SPACE then ENTER and typing in * then ENTER but nothing. Apparently there is already a password for the “test” user even though I never set one.

Maybe it’s just not possible to create a new user in the Manjaro Live USB environment?

Cheers,

Flex

You have to look at the UID of the user you created the backup with. The user name is only a convention. The UID is what matters.

You probably just need to type the password you want to set. It asks you twice because it wants to make sure you didn’t make a typo.

1 Like

You’re being prompted for the root user.

sudo passwd test

If you only have 1 user then the default user in the live USB should already have the same UID (1000).

id
2 Likes

Depending the UID of the user in question.

The user name is irrelevant as it is the UID which controls permissions.

If the user which created the backup is the first user - then the UID is the same as on the manjaro user on the live ISO.

You can verify the UID on the ISO by running

echo $UID

Thank you both,I got the contents of my home partition restored in the end…

Yes I think the confusion with setting a password for a new user in the live environment was that I was doing sudo passwd instead of sudo passwd test. But I don’t think I needed to create that ‘test’ user in the live environment in order to run the rsync command after all.

In the end I still needed to run rsync as sudo anyway due to permission issues I guess because the UID of the user running the rsync command to restore the backup was not the same as the UID of the files/folders in the backup. Maybe I could have avoided using sudo by simply switching to or creating a user with the same UID as the files in the backup… at this stage I’m just glad it seemed to work out!

In the end I think it doesn’t matter what user runs the rsync command because I was using rsync -a to preserve ownership and permissions when making and restoring the backup.

Cheers,

Flex

That only works if you are doing it with root privileges.

2 Likes

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.