I have Ubuntu 16.04 LTS. System is on ssd drive. Server has additional two hdd in software raid1 created by mdadm. Matrix is mounted in /mnt/ftp directory. In this directory I need create users with they home directories. But when I try execute command Code: sudo useradd --home /mnt/ftp/home/ctp --create-home --shell /bin/bash ctp I get error useradd: cannot create directory /mnt/ftp/home/ctp. What is the problem? My fstab: Code: # /etc/fstab: static file system information. # # Use 'blkid' to print the universally unique identifier for a # device; this may be used with UUID= as a more robust way to name devices # that works even if disks are added and removed. See fstab(5). # # <file system> <mount point> <type> <options> <dump> <pass> # / was on /dev/sda2 during installation UUID=f23883d0-dd24-4fc8-ace7-c7e6769acf66 / ext4 errors=remount-ro 0 1 # /boot/efi was on /dev/sda1 during installation UUID=1570-E5FC /boot/efi vfat umask=0077 0 1 # swap was on /dev/sda3 during installation UUID=d904a5d9-6292-48e4-b8fd-594bb7486f83 none swap sw 0 0 #Macierz RAID UUID="4c5d5252-48c2-4e2e-b947-ac19674adc70" /mnt/ftp ext4 defaults 0 0 When I added user using command Code: sudo useradd -d /mnt/ftp/home/ctp ctp , user were added but without directory. I tried add it manually but without success: mkdir: cannot create directory ‘/mnt/ftp/home/ctp’: No such file or directory I haven't SELinux and removed Apparmor.
Code: cd /mnt/ftp/home && printf "%s\n" "Success, could enter /mnt/ftp/home." || printf "%s\n" "Error, couldn't enter /mnt/ftp/home"
What that means? Matrix raid is mounted in /mnt/ftp and there isn't any home directory. So above probably execute as "Error, couldn't[...]".
Ok, so output is: Code: -bash: cd: /mnt/ftp/home: No such file or directory Error, couldn't enter /mnt/ftp/home
Does it mean that I should change somehow default place of /home directory to my mounted raid partition? I use command Code: sudo useradd --home /mnt/ftp/home/ctp --create-home --shell /bin/bash ctp When I try create home directory of particular user in /home - there is no problem - though directory does not exists. When I try create it in /mnt/ftp - then get error.