LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-15-2006, 08:34 AM   #1
Ray2047
Member
 
Registered: Dec 2005
Posts: 52

Rep: Reputation: 15
Copying Home To Different Install


Not new to Linux but beginning to think I will always be a command line newbie.

Basically My main OS is Debian Sarge on HDb. I have Etch on HDa. I want to copy my Home directory in Sarge (HDb) to Etch (HDa) and replace the current Home directory in Etch.

Sounds easy and when I first started my RTFM and Googel trip a month ago that is what I thought but all my efforts have failed. I give up. I'm just not going to figure it out so can someone tell me how? My biggest road block seems to be permissions. I keep getting permission denied even though I am root.

I could tell you what I have tried but it's not working so I figure rather then try to fix what isn't working for me to just ask for a how to of all the steps.

Last edited by Ray2047; 07-15-2006 at 08:37 AM.
 
Old 07-15-2006, 09:36 AM   #2
bigjohn
Senior Member
 
Registered: Jun 2002
Location: UK .
Distribution: *buntu (usually Kubuntu)
Posts: 2,682
Blog Entries: 9

Rep: Reputation: 45
Have you tried the obvious ? and tried to copy one to the other?? it might be that you'd need to use an arguement/switch with the cp command to get one to the other or something like that.

Theres a link in my sig that explains how to decypher man pages, but I'd have thought that man cp should tell you what you need to know.

regards

John
 
Old 07-15-2006, 09:55 AM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
First, be sure you really want to get rid of your Etch home directory, or, better yet, back it up first.

For the following, I am assuming you are currently booted into Sarge and that your /home directory on Etch is not a separate partition, and that / is on /dev/hda1. The following is best done as root.
  1. If you don't already have a temporary mount point, create one. I will assume this is at /mnt/temp. If not, adjust the following accordingly.
  2. mount /dev/hda1 /mnt/temp
  3. rm -rf /mnt/temp/home
  4. cp -a /home /mnt/temp

I think that should do it. If I have made a mistake, let me know what went wrong. Or if /home is on a separate partition, let me know, as I don't think the above will work for that.
 
Old 07-15-2006, 01:43 PM   #4
Ray2047
Member
 
Registered: Dec 2005
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by blackhole54
First, be sure you really want to get rid of your Etch home directory, or, better yet, back it up first.
, Fresh install, worse case situation will reinstall.

Quote:
For the following, I am assuming you are currently booted into Sarge and that your /home directory on Etch is not a separate partition, and that / is on /dev/hda1.
Yes. Thank you. Will post back when I have had a chance to try it.
 
Old 07-15-2006, 07:05 PM   #5
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 83
IBM put together an excellent tutorial on how to move /home. Highly recommended
 
Old 07-16-2006, 01:10 AM   #6
Ray2047
Member
 
Registered: Dec 2005
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by J.W.
IBM put together an excellent tutorial on how to move /home. Highly recommended
Yes, I found a couple of those tutorials in my search but they are for moving to another partition and my attempts to adapt them to replace one Home directory with another never succeeded. Thanks though for trying.
 
Old 07-16-2006, 02:35 AM   #7
zetabill
Member
 
Registered: Oct 2005
Location: Rhode Island, USA
Distribution: Slackware, Xubuntu
Posts: 348

Rep: Reputation: 31
Prepend
Code:
telinit 1
to whatever commandline steps you are taking... as root of course. As far as I know, init 1 gives you the dumbest computer you can possibly have, so nothing should be using anything in the home directory which would give you an error if you try to move or delete it. Other than that, I don't know what to tell ya... it should work.

If that doesn't work, then we'll need to know exactly what you're doing and what the errors are.

Let us know.
 
Old 07-16-2006, 03:47 PM   #8
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 83
Quote:
Originally Posted by Ray2047
Yes, I found a couple of those tutorials in my search but they are for moving to another partition and my attempts to adapt them to replace one Home directory with another never succeeded. Thanks though for trying.
I'm confused, you originally said
Quote:
I want to copy my Home directory in Sarge (HDb) to Etch (HDa) and replace the current Home directory in Etch.
/dev/hda = primary master
/dev/hdb = primary slave

If you just meant that you wanted to switch "/home_etch" and "/home_sarge", then just copy the contents to a temp directory, copy the contents of one "home" directory to it, clear it, then copy the data from the other directory to it. Something like the following ought to do it.

mkdir /home_temp
cp -R /home_etch /home_temp
rm -rf /home_etch
cp -R /home_sarge /home_etch
rm -rf /home_sarge
cp -R /home_temp /home_sarge
 
Old 07-18-2006, 07:21 PM   #9
Ray2047
Member
 
Registered: Dec 2005
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by J.W.
I'm confused, you originally said

/dev/hda = primary master
/dev/hdb = primary slave
Ok let me explain another way. Right now the OS I use everyday is Sarge on HDb (primary slave.) That is a bit awkward when I'm experimenting with different Linux OSes so I want to switch my everyday OS to HDa. I thought I would use this also as an opportunity to upgrade Debian to Etch. I installed Etch on HDa (Master HD on Primary). When I get my Home directory moved and everything working I will Fdisk Sarge and use HDb for experimenting.

Hope I made it clearer. I was just trying to keep my original post as short as possible. Perhaps I left out to many details. Sorry.
 
Old 07-18-2006, 08:28 PM   #10
Ray2047
Member
 
Registered: Dec 2005
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by blackhole54
I think that should do it. If I have made a mistake, let me know what went wrong.
For the most part that worked. Had to do one odd thing to get it to work but it worked with only a couple of glitches. One I understand. Mozilla doesn't work because it was opened when copied and parent lock was also copied.

The other is the KDE menu bar at the bottom isn't normal. That may just be a settings problem. It does work. Will spend a week or so on that then if I can't get it I may post back.

Thanks to all who posted.
 
  


Reply


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
Copying /home - use dd or cp ? Eternal_Newbie Slackware 12 05-01-2006 01:10 PM
copying files from my home directory to my USB Flash Disk neo_phyte Red Hat 9 04-24-2006 01:32 AM
Freeze while copying files - FC3 Install arosiqueh Fedora - Installation 3 01-21-2005 06:26 PM
/home seperate partition from previous install, make it new /home in new install mipia Slackware 5 06-21-2004 11:57 PM
Mountind drives / Copying file from home drive to floppy ozwalker Linux - Newbie 1 09-04-2003 10:06 PM


All times are GMT -5. The time now is 10:51 AM.

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