LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cannot create user home directories (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-create-user-home-directories-812235/)

bluegospel 06-04-2010 08:27 PM

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.

AlucardZero 06-04-2010 08:32 PM

no write permission to /home

bluegospel 06-04-2010 08:46 PM

Do I have to have permission logged on as root?

hkothari 06-04-2010 08:56 PM

Yes, so use sudo, or super user or login as roo.

AlucardZero 06-04-2010 09:00 PM

maybe not if it's an NFS mount. but we're not mind readers and you've given little information.

bluegospel 06-04-2010 09:20 PM

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".

bluegospel 06-05-2010 04:04 PM

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.

btmiller 06-05-2010 04:30 PM

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".

evo2 06-05-2010 06:00 PM

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.

bluegospel 06-05-2010 08:26 PM

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.

John VV 06-05-2010 09:16 PM

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

btmiller 06-05-2010 10:38 PM

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.

bluegospel 06-06-2010 11:23 AM

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?)

John VV 06-06-2010 12:27 PM

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 .

btmiller 06-06-2010 02:52 PM

Quote:

Originally Posted by bluegospel (Post 3994357)
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.


All times are GMT -5. The time now is 10:33 AM.