Results 1 to 4 of 4

Thread: New Jaunty install, can't reuse /home

  1. #1
    Join Date
    Jan 2005
    Beans
    31

    New Jaunty install, can't reuse /home

    For once I decide to do a wipe and install, OS only. I had already put /home into another partition and have been using that. So then comes Jaunty and decided to just reinstall the OS only and reuse the /home partition

    Everything works, except how to reuse the previous user profiles and the files within. Currently I have a brand new user in /home and it works fine.

    But how do I recover the old users and make use of them once again. All the files are there, switching to root accesses them, but I want to reinstate the old users ...
    Last edited by tarpon_bill; April 27th, 2009 at 02:49 PM.

  2. #2
    Join Date
    Apr 2009
    Beans
    1,173

    Re: New Jaunty install, can't reuse /home

    I have never tried it, but the "right" way must be something along the lines:

    sudu adduser --home /home/username --no-create-home username

    Probably a safer bet is to mv /home/username /home/oldusername, then create the new user username, then mv /home/oldusername /home/username. (I.e. temporarily rename the users home to old, recreate the user, then overwrite their newly created home with the old one). Note that this will overwrite all the hidden "." files with user settings and you might want to keep any Ubuntu 9.04 specifics.

    After creating the resurrected username you will have to chown -R username /home/username to reset the (numerical) ownership of the files.

  3. #3
    Join Date
    Jan 2005
    Beans
    31

    Re: New Jaunty install, can't reuse /home

    Thanks for the clues, is it just me or is there an easy way to do this? I had to do another Jaunty install and could not find anything during the install which points to connecting up old users to their existing partitions.

    I tried gingerly to mv things around and the permissions seem to work correctly. I got side tracked and haven't had enough time to get back to it for a more thorough look see. I will report back when I fully figure it out.

    You would think this is something everyone would want to do ...

  4. #4
    Join Date
    Jan 2005
    Beans
    31

    Re: New Jaunty install, can't reuse /home

    sudo adduser --home /home/test --no-create-home test --uid 1002

    It works, but you need to be real careful, else you trip over the permissions. The correct way to do this, my example assumes user name 'test' with a uid of 1002.

    The tricky part is getting the uid right. You need to sudo ls -la in the intended users home directory, and search for the old uid and then use that. Ubuntu numbers from 1000 up and is the first number in the listing. For example, on my system the user 'test' has a uid of 1002.

    If you blow it, you can delete the user with the "System->Administration->Users and Groups" dialog and leave the files alone. So it is somewhat reversible.

    Patience and care are best when it comes to systems spelunking ... else disaster looms just a key click away. I would recommend reading the entire "adduser" man page before starting.
    Last edited by tarpon_bill; April 29th, 2009 at 03:29 PM. Reason: Add update to proceedure.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •