LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 01-01-2005, 12:21 PM   #1
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Rep: Reputation: 15
Move home directory


Happy New Year.

I am running SuSE 9.2 in a 20Gb / partition. The only other partition is a 1Gb SWAP partition. Is it possible to move my /home folder to a new partition? Its getting pretty full, and I have another disk in the system with 40Gb unallocated space.

Can I move the /home folder in such a way that I dont break any associations with programs that have prefs etc inside the home/user/ folder?
 
Old 01-01-2005, 12:45 PM   #2
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
i think this works.

-#mkdir /newhome
-#mount <the new partition on /newhome >
-#cd /home
-#cp -a * /newhome
-#umount /newhome
---edit fstab to mount new partition at /home
-#mv /home /oldhome
-#mkdir /home
-#mount /home

all done without x running.
if all is ok , remove /oldhome; /newhome


edit changed cp -r to cp -a

egag

Last edited by egag; 01-01-2005 at 01:19 PM.
 
Old 01-01-2005, 01:05 PM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
2 minor additions to egag's solution:

[edit]
Additions withdrawn due to edit previous post
[/edit]

Happy newyear!

Last edited by druuna; 01-01-2005 at 02:16 PM.
 
Old 01-01-2005, 01:14 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,140

Rep: Reputation: 322Reputation: 322Reputation: 322Reputation: 322
Actually, you should probably use -a (for archive) to cp, to get a complete copy and avoid some problems with symlinks. See the man psge for cp for more info.
 
Old 01-01-2005, 01:17 PM   #5
egag
Senior Member
 
Registered: Jul 2004
Location: Netherlands
Distribution: Slackware
Posts: 2,721

Rep: Reputation: 52
yip: cp -a

i'll edit...

egag
 
Old 01-01-2005, 04:51 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,047

Rep: Reputation: 758Reputation: 758Reputation: 758Reputation: 758Reputation: 758Reputation: 758Reputation: 758
Futhermore
Quote:
-#mv /home /oldhome
-#mkdir /home
-#mount /home
No need to create another /home directory.

No need to mv except it will delete everything from the old home directory.

I would verify everything has been copied to the new home partition prior to deleting from the existing /home.

Be sure to log in as root so no files in the existing home directories will be accessed.

If you mount the new home before deleting the the existing home files they will become invisible. However it will prove that everything still works. You can always unmount the new home.
 
Old 01-01-2005, 05:37 PM   #7
iain.ross
Member
 
Registered: Aug 2004
Location: London, UK
Distribution: SuSE 9.2 Pro, KDE 3.4
Posts: 82

Original Poster
Rep: Reputation: 15
Thankyou to everyone who commented. I have now sorted it out. There was one heartstopping moment when I couldn't log in because for some reason I had forgotten to recreate the /home folder so fstab had nothing to mount to. I logged in at init 3 and put that right. All seems well.

Many thanks. Ive been messing about with Linux in one form or other for about 18months now, and its amazing that you can get by in windows without understanding partitions and mount points etc. I don't claim to understand them very well now, but I at least have a handle on the concepts...


Live and learn.
 
  


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
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 03:37 PM
Move my Home directory... it-s Linux - General 5 07-08-2005 12:34 PM
I want to move home fannymites Linux - General 1 12-04-2004 06:45 AM
move postgres home directory how to? vickr1z Linux - Newbie 2 09-16-2004 12:49 AM
write permissions for directory - not accidently move/deleted the directory linuxgamer Linux - Newbie 10 12-02-2003 04:04 AM


All times are GMT -5. The time now is 11:59 AM.

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