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 Code:
Morphy / # df -h Code:
Morphy / # l /mnt/sda4 Code:
Morphy / # l home/ Code:
Morphy / # ln -s /home /mnt/sda4/ Thanks for your attention |
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. |
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 I must ask what distribution you use, because most lines in your fstab looks wrong compared to what is normal in the linux world. |
Except he wants /home on sda4 to be his home, not / on sda4
|
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. |
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 |
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 |
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. |
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. |
Point the entries in your /etc/passwd to wherever you want the homedirs.
|
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 |
creat the dir anywhere you like
then modify the conf file b careful with permision |
Quote:
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. |
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. |
Quote:
"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 |
All times are GMT -5. The time now is 01:44 PM. |