I have just made a new ext4 partition on an internal harddrive `/dev/sdd2/` and I'd like to give my user account/s (I only have one for the moment) permission to use it, and have it automount. Could someone please point me in the right direction?

Here is an example fstab entry, alongside a comment to explain it a bit:

#<file system>        <dir>    <type>  <options>           <dump> <pass>
UUID=2a89.......7c    /home    ext4    defaults,noatime    0      2

File system is what you are mounting. You can either use its name like /dev/sdd2 in your case, or use an UUID (you can learn the UUID of the drive by running lsblk -f). Using a UUID is suggested, because just using the name might cause problems when you add or remove some drives.

dir is where you are mounting the drive. Write down the path of the folder where you want this drive to be mounted at. Here, this drive contains my home folder, so it is mounted at /home.

type is the type of the drive, it is ext4 in your case too.

options allow you to pick how the drive is going to be used. You can look at the available options by running man mount, just scroll down. Here, I'm just using the defaults, plus noatime, which gives a bit of performance by skipping updating the access times. You can use the same ones as well.

dump and pass pick some details about in what order the drives are mounted. For everything except your root and /tmp drives, you should just use 0 and 2, so just write the same.

Now, at this point, you are ready to mount the drive. Write sudo mount /the/dir/you/picked, and the drive should get mounted.

Now, the second thing, giving you access to the drive. To do this, you just need to change the ownership of the drive. You can do this with chown command, try executing sudo chown username:username /the/dir/you/picked, and you will become the owner of the directory. You can check this by executing ls -ld /the/dir/you/picked, you should see your name to the left of the line.

/r/archlinux Thread