LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Moving users to another partition (https://www.linuxquestions.org/questions/linux-newbie-8/moving-users-to-another-partition-804321/)

Azazwa 04-26-2010 01:25 PM

Moving users to another partition
 
Hi!

I have 2 harddisks, and a very new SuSE 10 installation.

Suppose I have a user called test in the users group. At present its home directory is /home/test. This is on one of the harddisks, sda.
Now I have a partition on the other harddisk /other. I would like all my users to be on sdb, so that their home directories are /other/users/test for instance for the test user.

I have played around with YaST to create another user "toets" in
/other/gebruikers, but I would like to have it as /other/users/toets.

I want all the user accounts on /other.

Anyone got some advice for me, please?

Thanks!

tredegar 04-26-2010 01:46 PM

Quote:

Anyone got some advice for me, please?
This is not an unusual question, so it has been answered many times before.

Please search on new home partition and you will find many guides.

If you run in to problems, let us know, and we'll help you further.

pixellany 04-26-2010 02:07 PM

I would create a partition for the user folders, but mount it at /home. I think there are various processes that expect to find something at /home/username.

I do not typically put /home on a separate partition---I prefer to have data partitions. On these, the folders belonging to a specific user, gets mounted to --eg-- /home/username/docs. I also put thing like e-mail and browser profiles in the data partition(s)

UnderV 04-27-2010 04:12 AM

Login as root, rename /home to /home1 (or something). Create empty /home directory.
Easy way to mount sdb1 to /home
1. Open Yast
2. Open Partitioner module
3. Select sdb1 and change mount point to /home

If You haven't sdb1 then You also need to create one partition on /dev/sdb

At the end copy all data from /home1 to /home.
Thats all.

Be very careful - don't loose content of home.

Azazwa 05-03-2010 05:04 AM

Hi!

Thanks for your help so far. I have looked at some of the other posts, actually even before I posted the original one.

What I actually want to know is whether there is a way that I could specify my user accounts as /other/groupname/username.

I don't quite want the whole /home on sdb1. I want sdb1 to remain as /other. Perhaps I will leave one user say test under /home on sda5. All the other users' files that will be on the system must be under /other/groupname/user.

Is something like this possible?

Thanks!

tredegar 05-03-2010 08:38 AM

You can move your user's home directories anywhere you want. ( Just make sure they are not logged in when you do this. )
Eg /other/foo/username
Then you need to update their entries in /etc/passwd ...

Changing
Code:

username:x:1001:1002:username:/home/username:/bin/bash
to
Code:

username:x:1001:1002:username:/other/foo/username:/bin/bash
Save the changes, then they can login to their moved home directory.

UnderV 05-04-2010 09:23 AM

Member tredegar already explained distro independend solution.
I see You are using OpenSuse. In that case you can take advantage of YAST.
1.Open yast
2. Open "User and Group management" module
3. Select "user" tab
4. Double click on user you need to change home directory
5. Select "details" tab
6. change value in "home directory" field (in your case: /other/groupname/username)
7. Press OK.

If You want to change default home directory for all next created users, change "Defaults for New Users" in "User and Group management" module.

Yast is nice tool to make such operations.

Azazwa 05-15-2010 10:14 AM

[Solved]
 
Hi!

It is strange. For some reason it didn't work on Monday, (if I logged out, I couldn't log in as one of the new users that I had created) but then I tried again on Wednesday and everything was fine. Thank you!


All times are GMT -5. The time now is 03:21 AM.