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.
|
no write permission to /home
|
Do I have to have permission logged on as root?
|
Yes, so use sudo, or super user or login as roo.
|
maybe not if it's an NFS mount. but we're not mind readers and you've given little information.
|
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". |
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. |
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". |
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 Code:
grep home /etc/fstab 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. |
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. |
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 |
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.
|
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?) |
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 . |
Quote:
|
All times are GMT -5. The time now is 10:33 AM. |