Is it possible to set the user's home directory to the /mnt/disk folder?

The server capacity in our lab is small. When we create a directory, we always use useradd -d /home/username. According to the result of df -h, the capacity of /dev/sda1 is too small. So every once in a while, the lab will notify us to delete something. Or move the file to /mnt/disk.

Is it possible to use useradd -d /mnt/disk/username username to create a user? If this works, is the file in /dev/vdb1?

$df -h
    Filesystem      Size  Used Avail Use% Mounted on
    udev             23G     0   23G   0% /dev
    tmpfs           4.6G  1.1M  4.6G   1% /run
    /dev/vda1        99G   92G  2.5G  98% /
    tmpfs            23G  672K   23G   1% /dev/shm
    tmpfs           5.0M     0  5.0M   0% /run/lock
    /dev/vdb1       492G   98G  369G  21% /mnt/disk
    tmpfs           4.6G  860K  4.6G   1% /run/user/1022
    tmpfs           4.6G   44K  4.6G   1% /run/user/1013
    tmpfs           4.6G  196K  4.6G   1% /run/user/1000
    tmpfs           4.6G  172K  4.6G   1% /run/user/1018
    tmpfs           4.6G   68K  4.6G   1% /run/user/1017
    tmpfs           4.6G  324K  4.6G   1% /run/user/1025
    tmpfs           4.6G   40K  4.6G   1% /run/user/1023
    tmpfs           4.6G  216K  4.6G   1% /run/user/1024
Asked By: Gerrie

||

Sure it is possible, but the mountpoint is badly chosen. /mnt is used for removable devices. The disk containing the users’ home directories need to be mounted at all times, or the users won’t be able to use the system.

Answered By: dr_
Categories: Answers Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.