-2

I have /home mounted on a separate disk.

I want to re-install (or maybe try Kubuntu) on the other disc with the root partition. I assume it's safest to simply unplug the /home disc, re-install, then remount with the new fstab?

If I re-install and create the exact same user - 'roger' - should the permissions still be intact?

Or is there a better way? Currently on 22.04 LTS.

Roger06
  • 133
  • 2
  • Given you mention Kubuntu, I assume you're asking about a Desktop re-install. I've written an answer in the ^ prior comment that I suggest you look at, it talks about re-installs, which allow you to re-install the same release, or a different release, even a different flavor and thus keep your data (in /home) regardless of where it's located (ie. single partition install or multi-partition install as you appear to want)... I re-install a system roughly weekly for QA purposes & part of my QA is ensuring no data loss, my settings & even manually installed apps get auto-reinstalled... – guiverc Feb 09 '24 at 08:15
  • 1
    It depends whether your user id is the same before and after. If you only ever create one account in both installs, it should be fine being uid 1000. – Daniel T Feb 09 '24 at 08:53

1 Answers1

0

Your question is about identity and home actually.
lingo : fs means File System, the partition/disk and format you use to write data on it.(ext3, btrfs, xfs, etc...)
All given commands have a man page, read it.

  1. Identity

You are identified as "roger" user to the system by an number : the UID. and user roger is member of a main group (propably roger or users) identified by a number GUID.
You can find UID and GUID from the command : id roger
These number are tied to the files you write, you see with : ls -n (instead of names you get actual numbers)

From one system to another there number can change but if you mount a fs from another system the uid/guid remains but are translated to local system identity.
ie :

system A, user A1 uid=500/guid=500 A2 uid=501/guid=501
system B, user B1 uid=501/guid=500 B2 uid=500/guid=501

Mouting a fs from system A on system B
all A1 files will be B2 and A2 will be B1
but the groups will mess-up.
To match things you need to create the users with same uid/guid : useradd allow you this. Or change the files ownership with chown and/or chgrp.

Good new from one install to another in ubuntu the same user count created more or less and the 'main' user often get same uid/guid from one install to another (need to check however). Therefore you don't get messed up mounting system A fs to system A+,B,etc..

  1. Home

Here things get more tricky.
Your home consists of lot's of config files hidden.
If you change your desktop or windows manager on a system usually the install script update the home with the appropriated files. Here you may end up with no/empty config and odd result. Get prepared to compare the user skeleton with your home.

I do have home data from a while, Here is how I do :
I create the user with my uid/guid, if possible, if not I use chown over the files on my historical data disk(raid).
I use the home from the local system, but I simlink all user data directory to the mount point where are actually my historical data.
my home looks like :

Document -> /mnt/historicaldata/user/Document
Image -> /mnt/historicaldata/user/Image
etc...

Tip : I simlink firefox config dir, but you can synch with mozilla cloud too.
This way all 'technical' config files are local system and user historical data are still accessible.
This requires discipline to not put files in root of home.

  • Thanks all. Way more tricky than I thought. Been having a few dry runs with a VM and each time, although the /home partition seems to mount, it then doesn't let me log back in. I'm wondering if it's just easier to copy everything to the cloud then re-download it. – Roger06 Feb 09 '24 at 20:04
  • "although the /home partition seems to mount, it then doesn't let me log back in." check UIG/GUID between /home/userdir and actual userdir most likely you don't have the same and then screwed by rights. – frederic abel Feb 28 '24 at 17:08