LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-20-2010, 07:17 AM   #1
rajesh_bu2001
LQ Newbie
 
Registered: May 2010
Posts: 6

Rep: Reputation: 0
Creating a new user in a mount point other than /


Hi Friends,
In my machine, there are 2 mount points - / and /userdata. From the root user, I want to create an oracle user at the /userdata mount point, i.e the home of the oracle user should be mounted on /userdata. Is it possible, if yes then pls guide me for the same.

Thanks in Advance,
Rajesh
 
Old 10-20-2010, 07:19 AM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by rajesh_bu2001 View Post
Hi Friends,
In my machine, there are 2 mount points - / and /userdata. From the root user, I want to create an oracle user at the /userdata mount point, i.e the home of the oracle user should be mounted on /userdata. Is it possible, if yes then pls guide me for the same.

Thanks in Advance,
Rajesh
Yes its possible, you can use -d option to achieve that.

Quote:
#useradd -d /userdata/oracle oracle
 
1 members found this post helpful.
Old 10-20-2010, 07:36 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by sayan_acharjee View Post
Yes its possible, you can use -d option to achieve that.
Uhh...no. Read the man page for useradd. The "-d" option SPECIFIES the directory to use for the new user. The "-m" option creates it.
 
Old 10-20-2010, 07:40 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by TB0ne View Post
Uhh...no. Read the man page for useradd. The "-d" option SPECIFIES the directory to use for the new user. The "-m" option creates it.
Well, if it is linux then -m option is not really required, the directory will be created automatically. Just using the -d option will specify where to create the home directory. And ya I agree, -d option doesn't create directory, it only specifies its location, thanks for pointing that out.
And again if I've posted something wrong here, please let me know.

Last edited by Sayan Acharjee; 10-20-2010 at 07:43 AM.
 
Old 10-20-2010, 08:31 AM   #5
rajesh_bu2001
LQ Newbie
 
Registered: May 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks a lot Sayan!!!
 
Old 10-20-2010, 08:40 AM   #6
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by rajesh_bu2001 View Post
Thanks a lot Sayan!!!
Most welcome
Don't forget to mark the thread as solved.
 
Old 10-20-2010, 08:50 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by sayan_acharjee View Post
Well, if it is linux then -m option is not really required, the directory will be created automatically. Just using the -d option will specify where to create the home directory. And ya I agree, -d option doesn't create directory, it only specifies its location, thanks for pointing that out.
And again if I've posted something wrong here, please let me know.
No, sorry.

The -d option says what directory TO use. -m option says to create it. From the man page:
Quote:
-d, --home homedir
This option specifies the users home directory. If not specified, the default from /etc/default/useradd is used.
-m, --create-home
Create home directory for new user account.
Just specifying the -d option does NOT automatically create a home directory. On some versions of Linux, depending on how it's set up, it may create a directory. The -m option specifically tells it to. Again, -d will create it wherever the DEFAULT home directory space is, so if it's /home, it'll get created there, unless you specify differently, which is what the OP asked for.
 
1 members found this post helpful.
Old 10-20-2010, 08:54 AM   #8
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 624

Rep: Reputation: 64
Quote:
Originally Posted by TB0ne View Post
No, sorry.

The -d option says what directory TO use. -m option says to create it. From the man page:

Just specifying the -d option does NOT automatically create a home directory. On some versions of Linux, depending on how it's set up, it may create a directory. The -m option specifically tells it to. Again, -d will create it wherever the DEFAULT home directory space is, so if it's /home, it'll get created there, unless you specify differently, which is what the OP asked for.
Fair enough, thanks
 
  


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
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
Creating a open Fuse mount point sethusubbiah Linux - Newbie 2 07-27-2010 01:19 PM
How to mount a Windows shared directory and have mount point be owned by nonroot user Arodef Linux - Software 3 09-14-2009 12:23 AM
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-10-2009 11:23 AM

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

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