Make a permanent mountpoint.
http://www.pathname.com/fhs/pub/fhs-2.3.html#INTRODUCTION states
The FHS document has a limited scope:
Local placement of local files is a local issue, so FHS does not attempt to usurp system administrators.
FHS addresses issues where file placements need to be coordinated between multiple parties such as local sites, distributions, applications, documentation, etc.
So for the sake of this HowTo there is no standard as we are talking about
Local placement of local files is a local issue.
Locate the device and partition(s).
$ lsblk
sda 8:0 0 223,6G 0 disk
├─sda1 8:1 0 512M 0 part
├─sda2 8:2 0 60G 0 part
├─sda3 8:3 0 130G 0 part
└─sda4 8:4 0 33,1G 0 part [SWAP]
sdb 8:16 0 477G 0 disk
└─sdb1 8:17 0 419,1G
Depending on your computers hardware you might get other device names and partition numbers. Modify the following according to your output.
The /media
folder
Manjaro used a media folder located under /run
to mount removable medias on the fly.
The root folder /media
is a folder used for mounting removable media on a defined structure. It is normally not in use in Manjaro so you need to create it. Ubuntu and other distros used it and certain automount utilities use the folder.
$ sudo mkdir /media
Permissions
You must define the access control list for the folder. ACL is a topic on its own so to keep it simple we will change the owner to your username. A lot can be said about this approach but lets keep it simple.
$ sudo chown $USER /media
Make a permanent mountpoint.
Create a folder for the purpose (change all references to mydisk as you would want a more descriptive name).
If you have several partitions you should name the folders with decriptive names - what ever you feel appropriate
$ mkdir /media/mydisk
Mount the partition.
Replace the Xy with the device and the partition number you found.
$ sudo mount /dev/sdXy /media/mydisk
Mount partition on boot.
To mount it permanently on boot modify your /etc/fstab
to include the partition on boot.
$ su -
# echo "UUID=$(lsblk -no UUID /dev/sdXy) /media/mydisk $(lsblk -no FSTYPE /dev/sdXy) defaults,noatime 0 2" >> /etc/fstab
# mount -a
If your drive has more than one partition repeat above steps as needed adjusting for each partition.
The echo command looks cryptic right?
It is not - try this
$ lsblk -no UUID /dev/sdb1
08264f2e-4e9e-403d-bbd0-72e62301e07c
This outputs the unique identifier of your partition. This is used in fstab to ensure the same partition is always mounted the right places. Now try this
$ echo $(lsblk -no UUID /dev/sdb1)
08264f2e-4e9e-403d-bbd0-72e62301e07c
You see? We got the exact same result but with this approach we include it in a command which writes a lot more info. Note that we can use a similar construction to get the filesystem type for the partition.
$ echo $(lsblk -no FSTYPE /dev/sdb1)
ext4
To write this to a file we use a pipe - an arrow pointing to a file name.
$ echo "UUID=$(lsblk -no UUID /dev/sdb1) /media/mydisk $(lsblk -no FSTYPE /dev/sdXy) defaults,noatime 0 2" > test.txt
To avoid deleting the contents of a file we append to it with double arrow
$ echo "UUID=$(lsblk -no UUID /dev/sda2) /media/myhome $(lsblk -no FSTYPE /dev/sdXy) defaults,noatime 0 2" >> test.txt
Have a look at the file
$ cat test.txt
UUID=08264f2e-4e9e-403d-bbd0-72e62301e07c /media/mydisk ext4 defaults,noatime 0 2
UUID=8b830a57-314f-40a9-b82f-a8fcfabbccb4 /media/myhome ext4 defaults,noatime 0 2