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 02-06-2015, 09:11 PM   #1
cezarrangel
Member
 
Registered: Dec 2011
Posts: 71

Rep: Reputation: Disabled
(solved) user has not a directory


Hi. When I ran #useradd -m -s /bin/bash -G Šudio,lp,video, wheel,scanner -U user
#passwd user

I forgot to have the /home mounted (shame on me)

so now there is not a /home/user (directory) so user cannot start the X

how can I fix it?

thank you!

Last edited by cezarrangel; 02-07-2015 at 10:27 PM.
 
Old 02-06-2015, 10:28 PM   #2
linuxtech99
Member
 
Registered: Jan 2015
Posts: 35

Rep: Reputation: 4
If the /home is not mounted, you still have the home directory content under "/". Go to /home and see if you see the home directory.
 
Old 02-06-2015, 11:06 PM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
So move created user home directory to temporary place and mount the home directory and then move to it from temoprary place.
 
Old 02-06-2015, 11:36 PM   #4
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://askubuntu.com/questions/34597...er-and-useradd
 
Old 02-07-2015, 03:53 AM   #5
cezarrangel
Member
 
Registered: Dec 2011
Posts: 71

Original Poster
Rep: Reputation: Disabled
yes linuxtech99 it is there but user has not a home directory
 
Old 02-07-2015, 07:28 AM   #6
manoj_hanse
Member
 
Registered: Mar 2008
Posts: 48

Rep: Reputation: 1
use the usermod command with -m option
 
Old 02-07-2015, 07:44 AM   #7
cezarrangel
Member
 
Registered: Dec 2011
Posts: 71

Original Poster
Rep: Reputation: Disabled
to make things clearer:


there are 2 partitions: /dev/sde1 and /dev/sde5
all / stuff was installed on /dev/sde1

I should have mounted /dev/sde5 when I created user
so user was created without /dev/sda5 mounted on mnt

I want that /home/user is created on /dev/sde5

Last edited by cezarrangel; 02-07-2015 at 07:45 AM.
 
Old 02-07-2015, 08:48 AM   #8
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 813

Rep: Reputation: 195Reputation: 195
Lets say user name is "uder"
  • Log off all users.
  • Log in as root
  • Unmount /home The created home for uder should be visible under /home/uder
  • Create a directory called /Hhome/uder.
  • Copy all contents from /home/uder to /Hhome/uder retaining the permissions.
  • Also check that /Hhome/uder has the same permissions as /home/uder
  • Mount the file system containing all users' accounts
  • Copy /Hhome/uder to /home/uder (you will have to create the directory /home/uder

If you have a gui for root, you can do it in three simple operations.

OK
 
Old 02-07-2015, 09:56 AM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,336

Rep: Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895Reputation: 3895
Quote:
Originally Posted by cezarrangel View Post
to make things clearer:
there are 2 partitions: /dev/sde1 and /dev/sde5 all / stuff was installed on /dev/sde1

I should have mounted /dev/sde5 when I created user so user was created without /dev/sda5 mounted on mnt I want that /home/user is created on /dev/sde5
Ok...so go into the /home directory, and make a directory for the user. Read the man page for usermod, and pay particular attention to the -d flag. Run "sudo usermod -d /home/somedirectory username".

You didnt' specify the -m option when you created the user, so the home directory didn't get created. There is nothing to move.
 
Old 02-07-2015, 02:07 PM   #10
cezarrangel
Member
 
Registered: Dec 2011
Posts: 71

Original Poster
Rep: Reputation: Disabled
in fact I think /dev/sde5 is part of the / ( as I created a file root system without a /home mounted) and is being mounted on /home but under / not like a partition apart (sorry if I am misunderstanding). I would like to have a /home apart

the /etc/fstab is:

/dev/sde1 / ext4 defaults 0 1
/dev/sde5 /home ext4 defaults 0 2
/dev/sdb3 swap swap defaults 0 0

to make things worse, if try to umount /home to follow the steps suggested above, the output says /home is busy and cannot be umounted

I thank you all for all the attention

Last edited by cezarrangel; 02-07-2015 at 02:10 PM.
 
Old 02-07-2015, 10:25 PM   #11
cezarrangel
Member
 
Registered: Dec 2011
Posts: 71

Original Poster
Rep: Reputation: Disabled
SOLVED: 1)I have removed user by running #userdel user (no #userdel -r user because user had not a home directory)
2)I ran #groupdel user
3)I mounted /dev/sde5 /mnt/home (I created /mnt/home)
4)#useradd -m -s /bin/bash -G audio,lp,video,wheel,scanner -U user
5)#passwd user
entered UNIX password
retyped new UNIX password
6)umounted /mnt/home
7)rebooted
et voilŗ!
tks for the attention

Last edited by cezarrangel; 02-08-2015 at 04:37 AM.
 
  


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
Failed to mount Lock Directory and User Runtime Directory supermario3 Debian 1 07-31-2014 06:08 AM
changing home directory permission in user management after user created in suse(KDE) hamedhsn Linux - Security 4 04-06-2011 10:18 PM
user's home directory on NFS server--what happens when user logs in from 2 computers? Mountain Linux - Networking 1 03-18-2009 04:35 PM
Active Directory User Cannot Write to Samba Home Directory jonwatson Linux - Networking 2 12-19-2006 01:40 PM


All times are GMT -5. The time now is 11:00 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