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
  • 37,856