1

I am trying to get backup so that I can upgrade my system to latest version of Ubuntu. Now while copying files some files I found are owned by user #1000 so i could not take backup of those files.

This suggests that such user does not exist in my system.

So is there a way to take backup of those files?

Note: I am using a live cd to take backups.

Spectra
  • 211
  • Where were the files you trying to copy? – ChanganAuto May 30 '21 at 15:59
  • 1
    change ownership of the files using chown https://askubuntu.com/a/6735/1112104. But remember not to change ownership of any root file – Parag Katoch May 30 '21 at 16:00
  • @ChanganAuto In a separate partition in my computer ? I am sorry if I could not understand your question correctly. I am new to this. – Spectra May 30 '21 at 16:02
  • Typically users backup personal files that typically reside in the users's folder /home/user. Are you trying to also copy root owned files? What for? – ChanganAuto May 30 '21 at 16:13
  • 1
    don't mess with the permissions, 1000 is the ID of the 1st user of the system. from a live session you use a root (#) as a prompt and do not need permissions to execute tasks. the link is NOT VALID for your case. LIVE SESSION and an actual system are 2 diff. things. 1000 is the id of your admin account and it is not getting translated to a name – Rinzwind May 30 '21 at 16:16
  • @ChanganAuto Oh..I am currently using a live cd to get back up. so now it shows 'media/ubuntu/888gb volume/...' and no I am not trying to copy root owned files. They are just personal files which earlier home folder. – Spectra May 30 '21 at 16:18
  • 3
    repeating: there is nothing to fix. this is INTENDED and NORMAL. – Rinzwind May 30 '21 at 16:19
  • @Rinzwind so nothing can be done with those files ? – Spectra May 30 '21 at 16:20
  • All files can be backed up (and restored later on if necessary) with a suitable backup tool. What else do you want to do with them? – sudodus May 30 '21 at 16:29
  • 2
    nothing needs to be done with those files. you are on a # when mounting the partition so you can use tar to make a file and cp to copy the backup to another disk or your gdrive – Rinzwind May 30 '21 at 16:31
  • @sudodus KEep them for future use..Read and write etc – Spectra May 30 '21 at 16:31
  • This will work, if you use a suitable backup tool. In order to back up files, that belong to other users (than the one that you have logged into), you should run the backup tool as root or with sudo which is the recommended way to get root permissions in Ubuntu. – sudodus May 30 '21 at 16:35
  • @Spectra, please tell us which backup tool you are trying to use. – sudodus May 30 '21 at 16:38
  • @sudodus nothing just copy paste into another hdd – Spectra May 30 '21 at 16:40
  • 1
    I would recommend some kind of backup tool. See for example this link for typical backup tools and that link for a tool that can backup a whole drive (Clonezilla). - Please check that the backup is restorable (to a new drive) before you need it. Otherwise it might be too late ... – sudodus May 30 '21 at 16:44
  • 1
    If you want to do it from scratch and understand the details, you can use a shellscript with rsync (and run it with sudo to backup also system files and files belonging to other users). – sudodus May 30 '21 at 16:50
  • 1
    I think I will try the 'tar' one as Rinzwind said and see what happens. :/ – Spectra May 30 '21 at 17:00

1 Answers1

2

In unix, the owner of a file corresponds to a numeric user id. Just because the numeric user ID shows up instead of a username does not mean that the user does not exist, and really doesn't matter even if that is the case. (There are multiple possible causes of this, including the user not existing on the system.)

Backing up files owned by a non-existing user should not be any different than any other file. Possibly you are running the backup software as a different user that doesn't have read access to those files? Typically backup software would be run as root rather than a regular user exactly to bypass this issue.

If you are running the backup as root, is it possible this is only a warning, and the files actually did get backed up? Backup software might try to store the username of the file owner in the backup, so that if files are restored on a different system or after users are recreated with different user id's, the ownership is mapped to the correct username. Failure to look up the user might generate a warning.

User 1000 is typically the first user on the system. Did you possibly delete that user after creating another user?

If you are using a live cd, did you use sudo to escalate to root before running the backups?

user10489
  • 4,051
  • 2
    He is using a live session (you (user10489) can stop reading here; for anyone else:) so the user is either root or ubuntu and a # prompt. The live session does not know about the user of the system itself so it will show the ID (and that is 1000 for the 1st (admin) user, 1001 for a 2nd, 1003 for a 3rd user ;) – Rinzwind May 30 '21 at 16:34
  • Yes the current user is ubuntu. I did not delete any user. simply using a live session where I cant get access to my earlier userid – Spectra May 30 '21 at 16:37
  • Somehow missed the live cd part. Still doesn't answer what user or what backup tool is being used to run the backups. – user10489 May 30 '21 at 16:37
  • @user10489 no tools or software. Just copy paste. – Spectra May 30 '21 at 16:38
  • 1
    copy paste is not terribly effective for backups obviously. You will need to escalate to root and copy the files from there. – user10489 May 30 '21 at 16:40
  • 2
    Better to use rsync: http://askubuntu.com/questions/545655/backup-your-home-directory-with-rsync-and-skip-useless-folders & http://askubuntu.com/questions/40992/what-files-and-directories-can-be-excluded-from-a-backup-of-the-home-directory/40997#40997 & http://ubuntuforums.org/showthread.php?t=868244&p=7015603#post7015603 & https://help.ubuntu.com/community/rsync – oldfred May 30 '21 at 18:18
  • rsync is a very good option, but certainly not the only one. – user10489 May 30 '21 at 19:18