From: Geoffrey Clements on
AJH wrote:

> I've fouled up a kubuntu 8.04 installation such that it wouldn't boot.
>
> I've checked with a live puppy disk and the home folder is still
> intact.
>
> Next I have created a new root and swap partitions in unused space and
> reinstalled Kubuntu in the partition sda6. I'm undecided on whether to
> copy the old /home folder because I don't really understand how
> permissions will have changed. If I rsync from the old home to the new
> home will I still have to chmod?
>

Permissions should be unaffected, do you mean ownership?

> Or is it possible to simply adopt the old /home folder on sda1 and
> continue using it?
>

Yes. If you only had one user, that user will be recreated with the same UID
(probably 1000). But if not, the fix is only one chmod away.

--
Geoff Registered Linux user 196308
Replace bitbucket with geoff to mail me.
From: Martin Gregorie on
On Fri, 21 Nov 2008 15:51:02 +0000, Geoffrey Clements wrote:

> AJH wrote:
>
>> I've fouled up a kubuntu 8.04 installation such that it wouldn't boot.
>>
>> I've checked with a live puppy disk and the home folder is still
>> intact.
>>
>> Next I have created a new root and swap partitions in unused space and
>> reinstalled Kubuntu in the partition sda6. I'm undecided on whether to
>> copy the old /home folder because I don't really understand how
>> permissions will have changed. If I rsync from the old home to the new
>> home will I still have to chmod?
>>
>>
> Permissions should be unaffected, do you mean ownership?
>
>> Or is it possible to simply adopt the old /home folder on sda1 and
>> continue using it?
>>
>>
> Yes. If you only had one user, that user will be recreated with the same
> UID (probably 1000). But if not, the fix is only one chmod away.

This is very close to the way I handle an upgrade - leave the /home
partition alone and reformat/reinstall in the others.

Then I fire up the Users & Groups admin tool and recreate the users and
groups that correspond to the login users. For each I carefully specify
the login directory to match the one already in /home and make sure that
the (manually entered) uid and gid match the ones in the /home partition.

I have a console window open to show the output from "ll /home" and
recreate the users working from that.

This has worked every time so far (RH6.2 -> RH7.x -> RH8.x -> Fedora 1
thru 8).


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
From: Unruh on
Martin Gregorie <martin(a)see.sig.for.address.invalid> writes:

>On Fri, 21 Nov 2008 15:51:02 +0000, Geoffrey Clements wrote:

>> AJH wrote:
>>
>>> I've fouled up a kubuntu 8.04 installation such that it wouldn't boot.
>>>
>>> I've checked with a live puppy disk and the home folder is still
>>> intact.
>>>
>>> Next I have created a new root and swap partitions in unused space and
>>> reinstalled Kubuntu in the partition sda6. I'm undecided on whether to
>>> copy the old /home folder because I don't really understand how
>>> permissions will have changed. If I rsync from the old home to the new
>>> home will I still have to chmod?

Just make sure that the uid corresponding to that user name is listed in
/etc/passwd

Probably the easiest way to check is
ls -ld /home/usersdirectory

and see if it is owned by the right owner ( or is listed just with a
number)
If it is owned by the right owner, you are set. If not, edit ( as root)
/etc/passwd and change the uid of the owner to the uid that the files have.



>>>
>>>
>> Permissions should be unaffected, do you mean ownership?
>>
>>> Or is it possible to simply adopt the old /home folder on sda1 and
>>> continue using it?
>>>
>>>
>> Yes. If you only had one user, that user will be recreated with the same
>> UID (probably 1000). But if not, the fix is only one chmod away.

>This is very close to the way I handle an upgrade - leave the /home
>partition alone and reformat/reinstall in the others.

>Then I fire up the Users & Groups admin tool and recreate the users and
>groups that correspond to the login users. For each I carefully specify
>the login directory to match the one already in /home and make sure that
>the (manually entered) uid and gid match the ones in the /home partition.

>I have a console window open to show the output from "ll /home" and
>recreate the users working from that.

>This has worked every time so far (RH6.2 -> RH7.x -> RH8.x -> Fedora 1
>thru 8).


>--
>martin@ | Martin Gregorie
>gregorie. | Essex, UK
>org |
From: Martin Gregorie on
On Fri, 21 Nov 2008 21:31:18 +0000, Unruh wrote:

> If it is owned by the right owner, you are set. If not, edit ( as root)
> /etc/passwd and change the uid of the owner to the uid that the files
> have.
>
That doesn't work if your system uses shadow passwords: you need to use
the user and group maintenance tools. I find the GUI tool (system-config-
users for F9) easier to use for this task than the command line tools
useradd, usermod and userdel.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
From: Martin Gregorie on
On Sun, 23 Nov 2008 13:57:15 +0000, AJH wrote:

>
> So I can move the new install /home to home2: sudo mv/home /home2
>
> make a new home:
> sudo mkdir /home
>
No No NO. That isn't necessary.

First: run 'df' and print or write down its output before you start the
reinstall. You need a list showing all the partitions together with the
associated mount point for each partition. Its helpful to record the
partition sizes for use as a double check that you're associating the
right mount point with each partition.

Also write down the name and group(s) of uid 500. This is the first user
you created last time and should be the first one you create this time.

During the OS install you take the custom disk partitioning option. Set
the mount points and labels of all partitions exactly as they were by
consulting the partition list. Mark all partitions *EXCEPT* the one used
by /home for reformatting.

Set up the first user login when asked. Its the one with a uid of 500 and
(probably) is either in the 'users' group (gid 100) or in a private group
(gid 500).

Now finish the reinstall and boot the system. The preserved partition
will be mounted as /home and all login directories will be visible, but
only the first will have names in place of uid and gid.

The disk is now organised exactly as it was before you did the upgrade
except that any additional logins haven't been set up, so login as root
and set them up, specifying the login directory, uid and gid exactly as
they were before. Normally, specifying the login directory creates it,
but if it already exists then the user is merely connected to it.

Notes:
1) Why not simply copy /etc/passwd, /etc/groups and the shadow passwords
file? Mainly because the upgrade may need additional system users.
Although its more work to add your users into a recreated passwd file,
this way you know that all the system users and groups will be there.

I think the user recreation could be scripted - I just haven't tried
that yet. Maybe next time....

2) Make sure you have an up-to-date backup before doing the reinstall.
Its the only way you'll recover from finger trouble and could be
useful if you want to resize any of the partitions.

I'm currently backing up my system to a USB drive with rsync.


--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |