Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-11-2008, 07:35 AM   #1
LQ Newbie
Registered: Aug 2003
Posts: 3

Rep: Reputation: 0
How do I transfer users after upgrade?

I have what I hope is a simple question about recreating users through an upgrade on a PC I use at home. I upgraded from Linux Mint 4 to 5 last night on a PC at home, which has 3 users (me and my 2 kids).

Because I have a habit of trying new distributions, I created a separate partition for /home the last time I did an install (Mint 4). When I installed Mint 5 last night I "manually" partitioned the disk and told the installer to mount that partition as /home. Happily it behaved as I had hoped. I got the new distro installed cleanly but preserved all of the home directories. The user account created on install for me must have been assigned the same uid, as it is properly associated with my old home directory.

The only stumbling block I have now is that as I try to recreate users for my kids with the same names, the user admin tool (via the Gnome gui) complains that that home directory already exists and won't let me create the userid. I'd prefer to create the userid and point it to the pre-existing home directory. Any suggestions on how to do this? Is this just a limitation of the gui interface that I can get around by using the cli? Or perhaps I need to edit /etc/passwd directly.

I can see in hindsight that I should have preserved /etc/passwd, and maybe /etc/shadow and some other files. Any suggestions on a better way to do this in the future would also be appreciated.
Old 07-11-2008, 08:58 AM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Just use useradd (or adduser), and see it's command line parameters before going on. The graphical tools might by default want to create a home directory, but with useradd the default option is not to create a home directory; to do that, you'll simply add another switch, and without it it won't create the dir (uses existing).

man useradd
useradd --help
which should provide the necessary help. Basically you just run (as root or with sudo)
useradd -d /home/username -s /bin/bash username
to create user "username" with home directory "/home/username" (that exists already; if not, use -m switch to create it). You should specify the shell with -s even though you're not forced to, because if you don't, some apps might work in an unexpected manner (if they rely on the shell being set). And add extra options when necessary.

Hope it helps!

EDIT: if it happens that the newly created users have a UID set that differs from their home directory owner IDs, meaning basically that the new users don't own their home directories even though the usernames do match, you might want to run chown over the home directories (recursively) to make sure the users own their own homedirectories. Like this (as root or with sudo):
chown -R username /home/username
That makes "username" the owner of "/home/username", and if you specify -R as above, does it recursively (so that all files and subdirectories under /home/username are also affected).

Last edited by b0uncer; 07-11-2008 at 09:01 AM.
Old 07-12-2008, 05:58 AM   #3
LQ Newbie
Registered: Aug 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Smile Thanks!

Thanks much for the guidance. That worked perfectly. I did indeed need to chown the directories (didn't know about the -R option before) and that did the trick.

Thanks again!


home directory, install, upgrade

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Music transfer software for MP3 players using Media Transfer Protocol commandante Linux - Software 2 06-26-2007 11:09 PM
How to transfer users fw12 Linux - General 2 05-19-2006 06:14 PM
Slack 2.6.7 upgrade w/ lilo for diskette users H2O-linux Linux - Newbie 0 12-14-2004 05:34 PM
Switching users, and the need to transfer Evolution configurations teval Linux - Software 2 01-08-2004 08:38 PM
How do you make a Netscape upgrade that works for all users? wjn Linux - Software 5 10-03-2003 01:29 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration