LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-04-2010, 09:27 PM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
cannot create user home directories


Why when I command "useradd -m barth" do I get the error message: "cannot create directory /home/barth"? It only does this when a partition is mounted to /home.
 
Old 06-04-2010, 09:32 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614
no write permission to /home
 
Old 06-04-2010, 09:46 PM   #3
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Do I have to have permission logged on as root?
 
Old 06-04-2010, 09:56 PM   #4
hkothari
Member
 
Registered: Jul 2009
Location: Lowell, Massachusetts
Distribution: Slackware
Posts: 70

Rep: Reputation: 17
Yes, so use sudo, or super user or login as roo.
 
Old 06-04-2010, 10:00 PM   #5
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614Reputation: 614
maybe not if it's an NFS mount. but we're not mind readers and you've given little information.
 
Old 06-04-2010, 10:20 PM   #6
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Sorry again.

The partition I mounted to /home was setup in cfdisk as a Linux partition. I also edited fstab, changing "ntfs-3g" to "Linux".
 
Old 06-05-2010, 05:04 PM   #7
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
I'm still confused why the only way new home directories can be created using "useradd" is when a partition is not mounted to my home directory. Initially I assumed the problem was due to the partition being NTFS, but when I tried mounting a Linux partition I had the same trouble. When nothing is mounted it works fine.

If you need more information, I apologize. I'm at a loss for what else to include.
 
Old 06-05-2010, 05:30 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
A couple notes:

1. NTFS partitions behave differently than Linux partitions (different types of permissions, etc.). I would not recommend using an NTFS partition for Linux user home directories.
2. What kind of Linux partition did you try (ext3, ext4, other)? Did youy check and make sure that it was mounted as writeable? What do you get when you do "sudo mkdir /home/foo" directly ... does it work or do you still get a permission denied error? If it doesn't work please post the output of "df -h", "cat /etc/fstab", and "cat /etc/mtab".
 
Old 06-05-2010, 07:00 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
So that we can see what is going on here please post the output of the following commands when /home is mounted.

Code:
mount | grep home
ls -al /home
It may also be useful to post the output of
Code:
grep home /etc/fstab
Evo2.

Ps. you can create the directories when /home is not mounted, because in that situation /home is just a mount point ie a directory in your / partition which is presumably a sane file system with sensible permissions.
 
Old 06-05-2010, 09:26 PM   #10
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Sorry for the delay.

The suspect device in the following output is /dev/hda7.

Per btmiller's query:

bash-3.1# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 8.3G 4.7G 3.3G 60% /
/dev/hda2 12G 6.1G 5.1G 55% /windowspartition
/dev/hda8 9.4G 51M 9.3G 1% /sharedpartition
tmpfs 502M 0 502M 0% /dev/shm
bash-3.1# cat /etc/fstab
/dev/hda5 / ext4 defaults 1 1
/dev/hda2 /windowspartition ntfs-3g umask=077 1 0
/dev/hda7 /home Linux umask=077 1 0
/dev/hda8 /sharedpartition ntfs-3g umask=077 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
bash-3.1# cat /etc/mtab
/dev/root / ext4 rw,barrier=1,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/hda2 /windowspartition fuseblk rw,allow_other,default_permissions,blksize=4096 0 0
/dev/hda8 /sharedpartition fuseblk rw,allow_other,default_permissions,blksize=4096 0 0
tmpfs /dev/shm tmpfs rw 0 0

Per evo2:

bash-3.1# mount | grep home
bash-3.1# mount |grep home
bash-3.1# ls -al /home
total 16
drwxr-xr-x 2 root root 4096 2010-06-04 20:23 .
drwxr-xr-x 22 root root 4096 2010-06-03 21:45 ..
-rw-r--r-- 1 root root 3729 2010-06-03 21:44 .screenrc
-rw-r--r-- 1 root root 779 2010-06-03 21:44 .xsession
bash-3.1# grep home /etc/fstab
/dev/hda7 /home Linux umask=077 1 0
bash-3.1#

Thanks for your time.
 
Old 06-05-2010, 10:16 PM   #11
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,229

Rep: Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522
bluegospel i would do some reading and learn about partitions and setting up a linux install
-- edit --
i take it this is slackware ? this should have been covered in the install/build documentation .
-------------
1) you CAN NOT( and you never could ) use MS Windows NTFS as a /home partition
2) "/dev/hda7 /home Linux umask=077 1 0"
there is no file system called "linux" ( the most common are ext3 and ext4 )
3) also "/dev/hda2 /windowspartition ntfs-3g umask=077 1 0 "
-- and --
/dev/hda8 /sharedpartition ntfs-3g umask=077 1 0
most of the time mounting DIRECTLY to / is a VERY,VERY bad idea
that is why there is a /mnt folder
/mnt/windows1
/mnt/share

Last edited by John VV; 06-06-2010 at 01:19 AM.
 
Old 06-05-2010, 11:38 PM   #12
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
In addition to what John VV said, you shouldn't need the umask option for a native Linux (ext3, ext4, etc.) mounted filesystem as these filesystems support *nix-style permissions correctly. The umask setting is usually used as a hack to apply sane permissions to filesystems that don't natively support *nix-style permissions.
 
Old 06-06-2010, 12:23 PM   #13
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Pardon my infancy in Linux, but what are "sane permissions?"

Off topic, how do I view other instances of manpages (e.g., "man sane" outputs "sane (7)" which I believe is not my answer. What about 1-7, et al?)
 
Old 06-06-2010, 01:27 PM   #14
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,229

Rep: Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522Reputation: 2522
i take it you are reading
http://www.slackbook.org/html/index.html

slack is not an easy first / beginners distro .
an example :
class courses
freshman math might be MATH 101
slackware is MATH 431



sane
S.A.N.E ( Scanner Access Now Easy )
sane permissions on a file system -- are everything BUT MICROSOFT NTFS and fat32

you might think about getting your feet wet with linux with something desinged for a new user
like Ubuntu or even Mint


or DO a lot of reading and learning and in about 6 months you will have a slack build working .
 
Old 06-06-2010, 03:52 PM   #15
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by bluegospel View Post
Pardon my infancy in Linux, but what are "sane permissions?"

Off topic, how do I view other instances of manpages (e.g., "man sane" outputs "sane (7)" which I believe is not my answer. What about 1-7, et al?)
"Sane permissions" are just slang I was using. What I meant was that since non-*nix filesystems don't saupport Unix style permissions natively, there has to be some way to make them use them. Therefore, the partition is usually mounted with all files having a specified user, group, and umask. All permissions are allowed on the file except those denied ny the umask. For a umask of 077, the owner will be allowed to do anything to the file, but no one else will be allowed to do anything. If you don't understand why this is, then you need to do some reading on Unix-style permissions. It's generally unnecessary to apply a umask when you've mounted a native Linux filesystem as these filesystems support Unix-style permissions natively and you can properly set permissions on individual files.
 
  


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
vsFTPd local user can't create directories nuzzy Linux - Software 11 12-04-2011 11:45 PM
[CentOS + LDAP] Create home directories on the first login WojtekO Linux - Server 1 05-27-2010 03:24 AM
Create home directories for existing users.. thejonmoore Linux - Server 6 05-05-2008 07:10 AM
home directories accessible only to user bullfrog1870 Linux - Security 4 12-06-2006 01:46 PM
root unable to create directories in /home? cpv204 Solaris / OpenSolaris 6 11-25-2003 11:33 AM

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

All times are GMT -5. The time now is 02:40 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration