0

Current: 20.04 with /home on its own partition.

Target: Install 22.04 on '/', and then switch the (then-new) 'home' subdir, to utilize the separately-partitioned /home.

My concern includes user names & ID #'s, group names & ID #'s... meaning, a new 'home' subdir with the installation user name will likely be ID # 1000. But on the partitioned /home, there is already an important user name with ID # 1000.

It is critical I keep the partitioned /home intact. How can I incorporate that into a fresh install of 22.04? Thanks.

1 Answers1

4

For the install:

Preserve cron, batch and at jobs. Look in /var/spool/.

Preserve copies of locally modified files in the /etc directory tree.

Preserve locally installed applications. Save the configuration files, be ready to reinstall current versions of applications.

apt changelog packagename is your friend.

Everything outside /home will be destroyed by the install.

For /home:

You can tell the installer (the "Something Else" choice?) to put /home where you have it, and UNCheck the box in the "Format" column. Verify. DO NOT FORMAT /home.

For the UIDs - keep copies of /etc/{passwd,shadow,group,gshadow}. Understand these files! Read man -a passwd;man shadow group getent

Let the installer create a temporary userid, UID 1000, homedir /home/temporary.

After the install, login as temporary.

First, in one window, sudo bash. This is your Emergency Investigation and Recovery Window.

In another window, sudo bash.

Make another, separate backup copy of /etc/{passwd,shadow,group,gshadow}

Use your original copies to restore your groups and userids. Do NOT blindly copy the old files, think carefully about each entry.

Note that (passwd and shadow) and (group and gshadow) entries should be updated in pairs, both or neither.

Use getent to check your work. E.g. getent passwd special

Only after testing:

  • login by the special user?
  • can the special user still special?
  • login by your admin user?
  • can admin still sudo?
  • ...

Can you log out. Then, log in as your admin account, and delete the temporary user. Read man deluser.

waltinator
  • 36,399
  • Your comments were substantially helpful. After a failed "do-release-upgrade" for 20.04 -> 22.04, I did a new install of the latter (Cinnamon). At one point I jazzed up the passwords, but did hold-shift during boot to get into GRUB, and chose a different (emergency) kernel to allow password fix. I still have not solved a displayed GROUP shown as a numeric '1004' rather that what I wanted 'bigfish'. That was remedied by using the add group command. So far pgms tested have found their config and even migrated data (incl Thunderbird !!!). MUCH appreciated. – gandsnut Aug 04 '23 at 16:14
  • 1
    Please click the checkmark to "accept" my answer, if it solved your problem, and might help others. – waltinator Aug 12 '23 at 19:49