LinuxQuestions.org
Help answer threads with 0 replies.
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 05-09-2010, 08:54 AM   #1
marelnx
LQ Newbie
 
Registered: May 2010
Posts: 7

Rep: Reputation: 0
/home directory


How do I change user's home directory, because right now everything saves into File System and it's almost full(I got windows and Ubuntu installed in the same partition), while the other 120Gb filesystem is unused..
 
Old 05-09-2010, 09:04 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
usermod
 
Old 05-09-2010, 09:15 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Alternatively rename /home as /home.old, mkdir a new /home and mount the unused file system there.

Either way you will need to move the user's files from the old home directory to the new one. Actually copy-check-delete is safer than move. Best that the user is not logged on at the copy time.

For the copy, these are suitable commands rsync -avz olddirectory newdirectory or (cd olddirectory && tar cSpf - . ) | (cd newdirectory && tar xSpfv -).
 
Old 05-09-2010, 09:27 AM   #4
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
The path I took recently is much like Catkin's suggestion. I created a new partition, formatted it to ext3, did
Code:
mkdir /mnt/tmphome
mount /dev/sda5 /mnt/tmphome ###substitute /dev/sda5 with your actual partition
cp -R /home/* /mnt/tmphome
edited /etc/fstab to mount /dev/sda5 as /home and rebooted. All was well and everything was picked up appropriately. I think you will have to chown -R the new home directories after the reboot.
 
Old 05-09-2010, 09:47 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by damgar View Post
I think you will have to chown -R the new home directories after the reboot.
That's why rsync or tar are better choices than cp for this task. Good pages on replicating directory trees: http://linuxdevcenter.com/pub/a/linux/lpt/18_16.html http://linuxmafia.com/faq/VALinux-kb...ory-trees.html http://blog.bfccomputing.com/article...nix-filesystem.
 
Old 05-09-2010, 10:14 AM   #6
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
Thanks for that. I think cp -rp would preserve the ownership as well.
 
Old 05-09-2010, 03:03 PM   #7
marelnx
LQ Newbie
 
Registered: May 2010
Posts: 7

Original Poster
Rep: Reputation: 0
I've been following this http://www.ibm.com/developerworks/li...rtplan.html#h6 tutorial and there's no step 6b, what am I supposed to do now ? Help please.
 
Old 05-09-2010, 03:08 PM   #8
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
So you have a new partition that has all the contents of what was /home in it and there was no seperate /home partition prior to you creating one?
 
Old 05-09-2010, 03:12 PM   #9
marelnx
LQ Newbie
 
Registered: May 2010
Posts: 7

Original Poster
Rep: Reputation: 0
Yes, you got that right.
 
Old 05-09-2010, 03:20 PM   #10
damgar
Senior Member
 
Registered: Sep 2009
Location: dallas, tx
Distribution: Slackware - current multilib/gsb Arch
Posts: 1,949
Blog Entries: 8

Rep: Reputation: 201Reputation: 201Reputation: 201
Edit /etc/fstab to mount the new partition as /home. Rename /home to /home.OLD. Then
Code:
mount -a
or reboot.
 
  


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
[SOLVED] 'Could not chdir to home directory /home/[user]: Permission denied' arashi256 Linux - Newbie 25 11-11-2011 10:29 AM
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 11:26 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 03:37 PM


All times are GMT -5. The time now is 09:49 PM.

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