Create user:
sudo adduser test // establish
Sudo addUser test sudo / / give the newly created user root permission (optional)
Sudo smbpasswd – a test / / create a samba user to facilitate windows access
Allocate disk space for users:
Select the disk to be partitioned and command sudo fdisk - L to view it
Disk partition:
sudo fdisk /dev/sda
Select parameter n to create a new partition
Select the appropriate partition size, which is divided into 40g, K is KB, M is MB, G is GB, t is TB and P is Pb.
Format partition:
Sudo mkfs.ext4 /dev/sda3
Mount partition to user:
sudo mount -t ext4 /dev/sda3/ / home/test
Use the DF - H command to view the mount
Finally, in order to mount the partition automatically at startup, you need to add a mount record in / etc / fstab
echo "/dev/sda3 / home/test ext4 defaults 0 2 " >> /etc/fstab