Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've upgraded my laptop with a new ssd and installed Ubuntu 64bit version on it. On the old hard drive, several operating systems are installed among others my old Ubuntu 32bit Installation. Now I want to move files and folders between this two home-directories, while I'm logged into the new Ubuntu Installation. How can I do this?

Thanks in advance.

Danny

EDIT:

I forgot to mention that the home directories are encrypted.

share|improve this question
    
And the old hard drive is also inside your laptop? (since most laptops only support 1 disc I doubt it...). –  Rinzwind Feb 13 '13 at 11:32
    
@Rinzwind The second harddrive is attached via optional bay caddy –  danny Feb 13 '13 at 11:54
    
After mounting the disc Attila O's answer is a way to do it ;) –  Rinzwind Feb 13 '13 at 12:08
add comment

1 Answer

up vote 1 down vote accepted

I'm not sure what have you tried so far, so I'll try to explain a bit.

If you just want to move the files from one home directory to another, you could run

mv /path/to/old/hdd/home/$USER/stuff ~

which will copy your files. If you prefer not doing it via the command line, you could try nautilus (the file browser that opens when you open "Home" in Gnome).

If you don't know how to find your old partition, you should first of all mount it (which you can do easily from Nautilus), then navigate to home/username in the old hdd, where username is your username.

Now it might happen that when you copy the files, their ownership remains, which might bother you. Normally when you copy files to your home directory, they will change ownership and become "yours". If this is not the case, you could just create a target folder and chmod it to force all its content to inherit ownership:

mkdir target
chmod 2775 target

…and then copy files to the "target" directory.

Or, you could just chown $USER copied-files -R to gain ownership of the copied files.

UPDATE: If your home directory was encrypted, try the procedure described in this thread:

  • Swapped hard disks between the two laptops
  • Installed new system
  • Created a user with the same username and password
  • On completion I booted to recovery mode, set the old /home partition in fstab and moved the /var/lib/ecryptfs/ directory from the old system to the new (so to have the same old keys) (backup is advised of course)
  • Booted the new system and everything worked like before

If you did not have /home on a separate partition, you could just

  • log out with your user on the new system
  • move your old home directory out of the way (using root)
  • copy the old home directory from the old HDD to the new one
  • log in with the user that has the same username and password (useradd it if it does not exist, or passwd your password temporarily back to what it was on the old system)
  • copy the files to some other folder that does not get encrypted (i.e. out of your home dir)
  • logout again
  • swap back to your new home directory (again with root)
  • move the files from the temporary place to your new home directory

Hope that helps.

share|improve this answer
    
Thanks for the fast reply, but I forgot to mention that the home directories are encrypted. –  danny Feb 13 '13 at 13:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.