Discussion:
can't access old files after new Ubuntu install
Add Reply
Adam
2021-03-27 17:36:45 UTC
Reply
Permalink
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.

New Ubuntu install went according to plan except with regards to /home partition.

Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).

GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.

How to fix ?
Naird Owell
2021-03-27 20:04:22 UTC
Reply
Permalink
Post by Adam
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.
New Ubuntu install went according to plan except with regards to /home partition.
Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).
GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.
How to fix ?
Maybe...

<https://devconnected.com/how-to-chown-recursive-on-linux/>

<https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories>
Adam
2021-03-29 02:27:53 UTC
Reply
Permalink
Post by Naird Owell
Post by Adam
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.
New Ubuntu install went according to plan except with regards to /home partition.
Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).
GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.
How to fix ?
Maybe...
<https://devconnected.com/how-to-chown-recursive-on-linux/>
<https://serverfault.com/questions/156437/how-to-chown-a-directory-recursively-including-hidden-files-or-directories>
Thanks, turns out Ubuntu does smart-install. :-)
Cuz, install took care of "chown" already.
What I really needed was to locate the old_user home, which I did...

***@ThinkPad-T430:~$ cd /home
***@ThinkPad-T430:/home$ ls -l
total 32
drwxr-xr-x 84 xerus xerus 12288 Mar 14 19:10 old_user
drwx------ 2 root root 16384 Feb 23 2011 lost+found
drwxr-xr-x 23 xerus xerus 4096 Mar 28 17:26 xerus
***@ThinkPad-T430:/home$
Dirk T. Verbeek
2021-03-27 21:30:57 UTC
Reply
Permalink
Post by Adam
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.
New Ubuntu install went according to plan except with regards to /home partition.
Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).
GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.
How to fix ?
In Kubuntu (Dolphin file manager) I would simply right-click on the
drive, select properties and next change the owner.
Mike Easter
2021-03-27 22:13:48 UTC
Reply
Permalink
Post by Dirk T. Verbeek
Post by Adam
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.
New Ubuntu install went according to plan except with regards to /home partition.
Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).
GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.
How to fix ?
In Kubuntu (Dolphin file manager) I would simply right-click on the
drive, select properties and next change the owner.
In Ub Mate live Caja FM, examining the permissions of the default
*directories* (not partition), the *home* dir is root's, whereas the
'ubuntu-mate' (user) dir inside the home belongs to the user. That
might also be the case w/ a home part w/ a user dir inside.
--
Mike Easter
Jonathan N. Little
2021-03-29 15:56:57 UTC
Reply
Permalink
Post by Adam
Installed new Ubuntu (/) wiping out old Ubuntu (/) partition.
Kept old Ubuntu /home partition.
New Ubuntu install went according to plan except with regards to /home partition.
Now I believe I have an ownership issue because
I can't access files from old Ubuntu /home partition (owned by different username).
GParted shows /home is decently full as expected.
Just can't access files in old Ubuntu /home partition.
How to fix ?
IF you don't install users in the same order as the original the numeric
UID and GID can be different. Ubuntu starts login users at 1000 and also
note that sometimes a users GID is not always the same as its UID if
someone adds a special secondary group. What I do is list all the users
on a system with UIDs and GIDs. Use can user this one-liner:


egrep '100[0-9]' /etc/passwd | tr ':' ' ' | awk '{print $1 "\tUID=" $3
"\tGID=" $4}'
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Michael F. Stemper
2021-03-30 15:34:39 UTC
Reply
Permalink
Post by Jonathan N. Little
IF you don't install users in the same order as the original the numeric
UID and GID can be different. Ubuntu starts login users at 1000 and also
note that sometimes a users GID is not always the same as its UID if
someone adds a special secondary group. What I do is list all the users
egrep '100[0-9]' /etc/passwd | tr ':' ' ' | awk '{print $1 "\tUID=" $3
"\tGID=" $4}'
That reminds me of something that I was wondering. If I create users on
a new box, can I give them the same password as on the old one by simply
copying the corresponding second field of /etc/shadow from one to the
other?
--
Michael F. Stemper
The name of the story is "A Sound of Thunder".
It was written by Ray Bradbury. You're welcome.
Jonathan N. Little
2021-03-30 20:14:15 UTC
Reply
Permalink
Post by Michael F. Stemper
Post by Jonathan N. Little
IF you don't install users in the same order as the original the numeric
UID and GID can be different. Ubuntu starts login users at 1000 and also
note that sometimes a users GID is not always the same as its UID if
someone adds a special secondary group. What I do is list all the users
egrep '100[0-9]' /etc/passwd | tr ':' ' ' | awk '{print $1 "\tUID=" $3
"\tGID=" $4}'
That reminds me of something that I was wondering. If I create users on
a new box, can I give them the same password as on the old one by simply
copying the corresponding second field of /etc/shadow from one to the
other?
Yep. I just "upgraded" a system at the library since we use Unity and
the upgrade path keep reverting to Gnome3 and you have to do the old
dump Gnome add Unity...so I used a fresh install of Ubuntu Unity Remix
20.04 <https://ubuntuunity.org/> on one system. So rather than go to the
process for each system running 16.04 I just copied the / partition to
target system, /home is on a separate partition. Check the hosts,
hostname, mailname, and fstab for proper UUID of this systems /home and
swap, edit passwd and group to that used and copy the shadow full line
to replace the user for that UI number. I use a livesession, I reinstall
grub just in case and then reboot. Done.
--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Loading...