LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-01-2003, 02:57 PM   #1
xodeus
Member
 
Registered: Jul 2003
Location: Jutlandia, Denmark
Distribution: Testing several
Posts: 39

Rep: Reputation: 15
Moving /home


Hi. I've just got me a new HDD. and I would like to move my /home to it? How do I do that proper without having to destroy my slack installation?
 
Old 10-01-2003, 03:05 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Once you have created a partition and filesystem. Mount the new partition and copy all your data. Unmount the old partition or move the /home folder if it is on the root partition. Then mount the new partition as /home. Then all you need to do is update fstab to mount the new home on boot.
 
Old 10-02-2003, 04:02 PM   #3
xodeus
Member
 
Registered: Jul 2003
Location: Jutlandia, Denmark
Distribution: Testing several
Posts: 39

Original Poster
Rep: Reputation: 15
Okay then!
I have to format the new HDD and move copy alle the files from /home to the new partition. The mount it like /dev/hdb1 /home ext3 blah blah blah. ??
 
Old 10-02-2003, 04:05 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Yes but don't mount it as home to start with. Create a seperate point like "/home-new" then make it /home once it has all the data on it.
 
Old 10-02-2003, 04:22 PM   #5
xodeus
Member
 
Registered: Jul 2003
Location: Jutlandia, Denmark
Distribution: Testing several
Posts: 39

Original Poster
Rep: Reputation: 15
Yeah. Or like /home-temp or something else, but not at home! I do really understand! :-) Thanks!
 
Old 10-06-2003, 05:09 AM   #6
xodeus
Member
 
Registered: Jul 2003
Location: Jutlandia, Denmark
Distribution: Testing several
Posts: 39

Original Poster
Rep: Reputation: 15
whatabout copying all the files! I'm now ready to copy, but how?
I can maybe stay in the CL and write:
cp /home/ /home-temp
or what?
Please help!
 
Old 10-06-2003, 06:28 AM   #7
LSD
Member
 
Registered: Jan 2003
Location: Northam, W.A., Australia
Distribution: Gentoo ~x86
Posts: 321

Rep: Reputation: 30
Copying the files like that will change their owner and group to whatever user copied them (probably root). What you want to do is move them but I don't know if the standard move command will move directory trees. You could use midnight commander but failing that, I suggest you tar the entire directory, delete the old files, mount the new partition as /home, and untar the entire directory using the -p switch to preserve the permissions:

Code:
cd /home
tar jcvf /tmp/home.tar.bz2 .
rm -rf *
cd ..
mount /dev/hdb1 /home
cd home
tar jxvpf /tmp/home.tar.bz2
 
Old 10-06-2003, 03:33 PM   #8
Pollyanna
Member
 
Registered: Oct 2003
Location: Germany
Distribution: Slackware 10.2, SuSE 10.0, Solaris(SPARC) 9+Solaris(x86) 9, NetBSD(sparc) 2.0.2
Posts: 43

Rep: Reputation: 15
Hi,

I would like suggest two other approaches.

Fist there is
cp -rp /home-old /home-new

-r duplicates directories recursively
-p preserves mode,ownership and timestamp
(see also: man cp) ;-)

The second consideration uses the tar command as LSD suggested, but in a slightly different way:

(cd /home-old ; tar cf - .)|(cd /home-new ; tar pxvf -)

The advantages are:
preserves *all* protection information (see also: man tar)
Symbolic links are transfered as symbolic links and not as files.
There is no real file created, so no additional diskspace is used while transfering the data.

Disadvatage: both directories must exist before the transfer.


Hope it helped

Pollyanna
 
  


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
Moving /home Directory? NovaBurst DamnSmallLinux 1 04-18-2005 10:59 PM
moving /home to a new drive? tardigrade Linux - Newbie 5 10-18-2004 05:56 PM
need help moving home shaggystyle Linux - Hardware 15 09-01-2004 12:31 AM
Moving my /home directory to another hd bumpert Linux - Newbie 6 07-26-2004 03:27 AM
moving /home to / abu_abdullaah Linux - Newbie 3 07-18-2004 01:15 PM


All times are GMT -5. The time now is 10:47 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration