LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 11-29-2008, 04:43 AM   #1
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Rep: Reputation: 15
How could I change my /home dir path?


Hi guys,

I decided to create a partition for /home, sda4. But now I realize that my /home is in sda3, which was created to house my / tree. There's a home dir in sda4 but this is not the one that my dist recognizes as system /home. Here's my fstab:
Code:
aufs / aufs defaults 0 0 # AutoUpdate
devpts /dev/pts devpts gid=5,mode=620 0 0 # AutoUpdate
proc /proc proc defaults 0 0 # AutoUpdate
sysfs /sys sysfs defaults 0 0 # AutoUpdate
/dev/hda /mnt/hda iso9660 auto,users,exec 0 0 # AutoUpdate
/dev/fd0 /mnt/floppy vfat noauto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda1 /mnt/sda1 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
/dev/sda2 none swap sw 0 0 # Autoupdate
/dev/sda3 /mnt/sda3 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sda4 /mnt/sda4 ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate

/dev/sdb5 /mnt/sdb5 swap auto,defaults 0 0 # AutoUpdate
/dev/sdd6 /mnt/sdd6 ext3 auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sdd2 /mnt/sdd2 udf auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sdd3 /mnt/sdd3 udf auto,noatime,users,suid,dev,exec 0 0 # AutoUpdate
/dev/sdd1 /mnt/sdd1 vfat auto,noatime,users,suid,dev,exec,quiet,umask=0,check=s,shortname=mixed 0 0 # AutoUpdate
and here my df -h:
Code:
Morphy / # df -h
Filesystem            Size  Used Avail Use% Mounted on
aufs                   51G   23G   26G  46% /
/dev/sda1             190M  9.5M  171M   6% /mnt/sda1
/dev/sda3              51G   23G   26G  46% /mnt/sda3
/dev/sda4              96G  6.1G   85G   7% /mnt/sda4
/dev/sdc1             233G   20G  214G   9% /mnt/sdc1
/dev/sdd1             439G   19G  420G   5% /mnt/sdd1
This is what sda4 contains:
Code:
Morphy / # l /mnt/sda4
total 28
drwxr-xr-x  4 root root  4096 Nov  8 16:26 ./
drwxr-xr-x 22 root root  4096 Nov 29 00:47 ../
drwxr-xr-x  7 root root  4096 Nov 28 22:50 home/
drwx------  2 root root 16384 Nov  8 16:06 lost+found/
and this what contains /home in sda3:
Code:
Morphy / # l home/
total 44
drwxr-xr-x  7 root root  4096 Nov 28 22:50 ./
drwxr-xr-x  4 root root  4096 Nov  8 16:26 ../
drwxr-xr-x  2 root root 12288 Nov 28 22:47 Bib/
drwxr-xr-x  3 root root  4096 Nov 28 21:31 Down/
drwxr-xr-x  3 root root  4096 Nov 28 21:39 Films/
drwxr-xr-x 16 root root  4096 Nov 28 18:58 Src/
-rw-r--r--  1 root root  6995 Nov 22 18:24 lsmodoutput.txt
drwxr-xr-x 18 root root  4096 Nov 24 03:11 tahl/
As you can see, tahl is a non-root user dir. I thought of linking the sda3 /home to the sda4 /home but I was unable to:
Code:
Morphy / # ln -s /home /mnt/sda4/
ln: creating symbolic link `/mnt/sda4/home': File exists
what is quite reasonable, so how could I define my sda4 /home as my system /home??

Thanks for your attention
 
Old 11-29-2008, 04:54 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
More typically people would mount a partition as /home, but since you want a directory on a partition, I guess you could delete your current /home, and create a symbolic link to /mnt/sda4/home using

ln-s /mnt/sda4/home /home.

I'd probably rename /home rather than deleting it, just in case you need it.

Last edited by billymayday; 11-29-2008 at 05:41 AM. Reason: changed sdb to sda
 
Old 11-29-2008, 05:33 AM   #3
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
I must say that your fstab looks very special. All of your partitions are mounted under the /mnt directory, both the sda3 and sda4.
Normally your home directory should be under / (root), that is /home.
To accomplish that you would mount either your sda3 or your sda4 with a line in fstab similar to this:
Code:
/dev/sda4 /home ext3 auto,noatime,users,suid,dev,exec 0 0 # Autoupdate
Notice the /home in second coulmn. This makes your /dev/sda4 replace or actullay overlay any existing home directory on your root partition.

I must ask what distribution you use, because most lines in your fstab looks wrong compared to what is normal in the linux world.
 
Old 11-29-2008, 05:40 AM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Except he wants /home on sda4 to be his home, not / on sda4
 
Old 11-29-2008, 06:11 AM   #5
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
The code a gave would give him sda4 as /home

In contrast to windows which has several root directories, one for everey disk c:\ d:\ etc, there are only one file tree in linux, all placed under / (root)


A leading / in a path always makes it an absoulte path, so the first post is a bit misleading.
In the sda3 where / resides there are a home directory, as always, either it contains the users home directories or function as a mount point for a mounted "home"-partition.

Before the addition of sda4 the user files would be saved to /home (being on sda3). Mounting sda4 as I suggested above would make the partition sda4 "replace" or overlay the /home directory with the contents of sda4. Using soft links would be the wrong way to try to "fix" it.

When partitions are mounted in the correct place, there are no use for soft linking.

Last edited by ugge; 11-29-2008 at 06:21 AM.
 
Old 11-29-2008, 06:21 AM   #6
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
easy fix in kde go to user manager and tell it where to put user default is /home/user. . the option is there.
when you create a user it will ask if you want to create a user file and then you put it where you want it. or you can modify the user manager to for that user. I did this many times as I migrated to different hard drives. default is on the same partition as root if you loaded the whole system on sda3 and not mounting the sda4 as /home. the l -s symbolic link has caused me some troubles in the past do to /tmp/sockets etc etc. but when you loaded the new system you had a choice to make a partition and mount it as /home but you did'nt so now you need to tell the user manager where you want to put you user file. if you have a bunch of stuff there you can move it then tell the manager where to put it. as long as the user manager knows where to look for your folder. you must do this from root ok or you will be left with locked tmp sockets and you will have troubles. like the symlink stuff. it will all work just if you want to play with it. create your user and tell the user manager where to put it. your user file does not need to be in home. but if you config the fstab to /dev/sda4 /home then the default setting for adding a user goes to home.. but you will have to move them to sda4 before you do this.
/dev/sda4 /home ext3 defaults 1 2 do not copy the home file just the user file to sda4. because sda4 is now /home.
and your root sys will still look like this
bin,,,, boot ,,,, dev ,,,, etc ,,,,,,, home ,,,,,lib
make sure if you move it as root you set permisions back tou you user name and users or you will not have access to it. or just copy to sda4 then logout then login as root and change the fstab.
if you do not logout you will leave locked /tmp sockets running

Last edited by Drakeo; 11-29-2008 at 06:28 AM. Reason: not finished
 
Old 11-29-2008, 06:22 AM   #7
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Original Poster
Rep: Reputation: 15
I use Slackware 12.0. I'm a bit confused with your posts. What I'm supposed to do to replace my sda3 home in / with my sda4 home?

Thanks again
 
Old 11-29-2008, 06:36 AM   #8
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
I'm sorry if I confuse things for you, I my self are confused by the fstab setup. I haven't used Slackware my self so I don't know how they do things.

If this is the default fstab, then running the command I suggested may as well mess things up.
 
Old 11-29-2008, 07:41 AM   #9
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
The OP must be using Knoppix, Xandros, SLAX or one of the distributions that uses the AUFS filesystem. He does not say what his distribuiton is.

I am not familiar with those current distributions and am not at all comfortable with the very different mounting of devices in the /etc/fstab from more mainstream Linux distributions.

I would be very reluctant to give any advice or suggestions given the apparent foreign nature of the file structure. While the principles may be the same I just don't know how his distribution expects things to be set up.
 
Old 11-29-2008, 07:44 AM   #10
Woodypecker
Member
 
Registered: Mar 2006
Location: Austria
Distribution: Mandriva/Debian
Posts: 104

Rep: Reputation: 17
Point the entries in your /etc/passwd to wherever you want the homedirs.
 
Old 11-30-2008, 08:53 AM   #11
swright007
LQ Newbie
 
Registered: Nov 2008
Location: Hot Springs, AR
Distribution: Linux Mint 13
Posts: 23

Rep: Reputation: 0
I would like to change my /home directory as well.. What I have in mind is to be able to have a drive for my Ubuntu operating system on one drive and my /home directory and all files on another drive. In the event I wanted to try an upgrade, the desired effect would be that all I would have to do would be install it to the operating system drive and then mount home on the other drive that has /home and the files. Could I do that merely by making a /home directory on the "home" drive and setting it up AS home in the "Users and Groups" admin utility or would it be more complex? what would be involved in both setting it up and mounting it the way I have envisioned? Any help would be greatly appreciated. I am running a dual core AMD 5000 processor and 2 gigs ram with Ubuntu 8.04 currently.

Thanks in advance,
Scott
 
Old 11-30-2008, 10:50 AM   #12
ozminh
Member
 
Registered: Aug 2007
Posts: 73

Rep: Reputation: 19
creat the dir anywhere you like
then modify the conf file
b careful with permision
 
Old 11-30-2008, 11:06 AM   #13
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Quote:
Originally Posted by swright007 View Post
I would like to change my /home directory as well.. What I have in mind is to be able to have a drive for my Ubuntu operating system on one drive and my /home directory and all files on another drive. In the event I wanted to try an upgrade, the desired effect would be that all I would have to do would be install it to the operating system drive and then mount home on the other drive that has /home and the files. Could I do that merely by making a /home directory on the "home" drive and setting it up AS home in the "Users and Groups" admin utility or would it be more complex? what would be involved in both setting it up and mounting it the way I have envisioned? Any help would be greatly appreciated. I am running a dual core AMD 5000 processor and 2 gigs ram with Ubuntu 8.04 currently.

Thanks in advance,
Scott
Here you go. http://ubuntu.wordpress.com/2006/01/...own-partition/

You don't even need to put the /home directory on it's own drive but on it's own partition for your idea to work. You can put /home on the same drive as your Linux files but place /home in a different partition of it's own. I always set up my Linux installations this way for just the reasons you stated. Keep in mind that if you use databases such as Postgresql or MySQL they will be placed in the /var directory on the main disk as well and may be lost if you re-install Linux. All files should be ok for regular updates and upgrades as long as you use the Ubuntu upgrade procedure and do not do a new install.
 
Old 11-30-2008, 03:18 PM   #14
morphynoman
Member
 
Registered: Nov 2008
Posts: 32

Original Poster
Rep: Reputation: 15
Solved

First of all, thanks everybody for your opinions but especially to ugge, you were right and, not least, very kind.

I like the discussions that lead to some point and I ensure you that controversy was/is NOT my aim. Sorry if I get it.I'll try to pass on tiptoe on the discussion, however I would jot down issue:
Code:
I would be very reluctant to give any advice or suggestions given the apparent foreign nature of the file structure. While the principles may be the same I just don't know how his distribution expects things to be set up.
It would be very wise of you to explain why can't I expect my distribution to work right.

Last edited by morphynoman; 11-30-2008 at 03:19 PM.
 
Old 12-04-2008, 02:00 PM   #15
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by morphynoman View Post
Code:
I would be very reluctant to give any advice or suggestions given the apparent foreign nature of the file structure. While the principles may be the same I just don't know how his distribution expects things to be set up.
It would be very wise of you to explain why can't I expect my distribution to work right.
I don't think it's about "not working right". It's about
"is it right for all possible scenarios" - which will always
have to be a clear: "NO!", for what I think are quite obvious
reasons. You can't cater to all use-cases with one set-up,
a server will require a different set-up from a gaming desktop.
And I think that (even though one could build some heuristics
into the installer, and quizzing the person installing about
their intended use) you'll never be able to anticipate all
possible uses ...


Cheers,
Tink
 
  


Reply



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
Add to path of all users home Dir. abovenbeyond Linux - Server 1 12-18-2007 05:27 PM
Changing Home Dir Path paul.hendrikus Linux - Software 7 02-05-2007 02:47 AM
Changing home dir path? NonSumPisces Linux - Newbie 4 08-22-2004 04:16 PM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
Proftp on Slax Change Anonymous Home DIR rusty.bz Linux - Networking 0 05-02-2004 09:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:41 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
Open Source Consulting | Domain Registration