how to install keeping old /home?

General support questions
Post Reply
jeepster
Posts: 29
Joined: 2010/08/19 02:49:06
Location: WA

how to install keeping old /home?

Post by jeepster » 2019/11/09 02:22:16

I have a PC with 2 hard drives. One was /home and the other drive held all the rest. So I try to install Centos 7 from DVD. I have done fresh install a few times before. Now I select custom partitioning for the installation destination. It shows "Scientific Linux 7.1" (what was there before). sda has /home
Since it was another RHEL clone, the uid gid would be the same, I presume one could keep the user directories.
So I delete the other partitions from sdb and add them again with mount points and sizes, and select reformat.
I do not touch other sda /home and it had format option unchecked. Then accept the changes (destroy and recreate on sdb)
However it still shows errors in the Installation Summary screen, and I cannot proceed.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: how to install keeping old /home?

Post by jlehtone » 2019/11/09 09:54:05

"shows errors": We cannot advice you about the errors that we do not see.


Installer allows you to select an existing filesystem and fill in where you want to mount it (like '/home').


User information is within /etc. If you define a regular account in the installer, then it might get same name/uid/gid as in the other system, but will also attempt to create a home directory. Not sure how it reacts to existing directory.

It is possible to recreate user-info exactly with 'groupadd' and 'useradd', or you could copy data from current system's /etc.

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: how to install keeping old /home?

Post by tunk » 2019/11/09 13:22:48

It is possible to migrate from RHEL to CentOS without reinstall.
This may be possible in this case as well. I haven't read through
it, but this may be a starting point:
https://www.openlogic.com/blog/step-ste ... -centos-74

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to install keeping old /home?

Post by TrevorH » 2019/11/09 13:28:56

Personally I always keep /home as a separate filesystem and do not let the installer touch it. Post-install I then edit fstab and add it manually.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

desertcat
Posts: 843
Joined: 2014/08/07 02:17:29
Location: Tucson, AZ

Re: how to install keeping old /home?

Post by desertcat » 2019/11/10 01:33:15

jeepster wrote:
2019/11/09 02:22:16
I have a PC with 2 hard drives. One was /home and the other drive held all the rest. So I try to install Centos 7 from DVD. I have done fresh install a few times before. Now I select custom partitioning for the installation destination. It shows "Scientific Linux 7.1" (what was there before). sda has /home
Since it was another RHEL clone, the uid gid would be the same, I presume one could keep the user directories.
So I delete the other partitions from sdb and add them again with mount points and sizes, and select reformat.
I do not touch other sda /home and it had format option unchecked. Then accept the changes (destroy and recreate on sdb)
However it still shows errors in the Installation Summary screen, and I cannot proceed.
OK I have been here and done that. I do ONLY a Custom install. In general the way you have done it is the way I have done it in the past, but in my case /home was on the same drive, not a different drive. The trick involves erasing any reference to the OS already installed even if the OS already installed is an older version of say CentOS 7 that I had just created not more than 15 minutes ago, otherwise you duplicate partitions and that confuses things. Doing it this way you only have one set of files that are located on the drive pointing to the same point on the drive. In the event I have two different OS's I try to have them on different drives and then modify GRUB2 so that the other drive and OS appears on the menu entry. You do this my modifying /etc/grub.d 40_custom, then you dual boot two or more OS's from a single menu.

OK you get to where you carve up the the drives. Before you start carving you will see a list of all the currently installed OS's For this this example we will call one RHEL 7. RHEL 7 has all your partitions --/boot, /var/, /etc, /tmp , /usr, /, and SWAP. Drive "B" contains /home. First you need to disable DRIVE B. I usually do this by simply going into the guts of the machine and physically removing the cable that connects DRIVE "B". This way you don't accidentally overwrite the contents on Drive "B". Now when you run Custom Install all you will ONLY see the contents on drive "A" that says "RHEL 7", now ERASE "RHEL 7" so that you have a CLEAN DRIVE (You could also do this through gparted and reformat the drive which might be easier), now go ahead and carve up the drive. You could try to do this without a /home directory, but if complains that you need a /home go ahead and create one as a place saver. At some point you can possibly rename the partition to something else say /home1, or /backup, or /.... Do your install as normal, create your root password and create a bogus users account (if need be) and password. Once the installation has been completed login with your bogus account and finish the install.

The next step is to reconnect drive "B" you need to discover its UUID and then modify the fstab in drive "A" so that it has a pointer so that it knows that /home is located on drive "B". Ask our gurus how to -- if possible -- you can rename /home on Drive "A" to something else or append /home on Drive "A" to /home on Drive "B".

User avatar
c00ter
Posts: 7
Joined: 2019/10/04 16:24:52

Re: how to install keeping old /home?

Post by c00ter » 2019/11/10 12:50:53

Instead of fighting with the very limited Anaconda installer to accept a '/home' on a separate drive, it is much simpler for me to create symlinks to the data directories on that second drive. Takes all of 2 seconds once the system is up and running.

Post Reply