Issue with fstab data drive mounting

Not sure if this is the right place this seems like a general question but didn’t see anywhere that would fit.

I have a extra drive I wanted to use as general storage but when trying to add it to /etc/fstab it won’t boot and I get the error below when testing using sudo mount -a. The drive will mount fine without my edits to fstab if I just mount it by clicking it through file manager.

Here it is after I’ve mounted it from file manager just to make sure I had the mount point right.

[andy@manjaro ~]$ lsblk -f
NAME        FSTYPE FSVER LABEL       UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
sda                                                                                      
└─sda1      ext4   1.0   linux-data  08994d45-a4de-4aa0-b4c7-43e8482eca1e    1.6T     8% /run/media/andy/linux-data       

I right click and unmount from file manager and see the mount point removed in lsblk.

The edit /etc/fstab with the line below for it

# /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>
UUID=BC7F-24E1                            /boot/efi      vfat    umask=0077 0 2
UUID=3cfd0024-a497-4d9f-84c9-2c95c7d40f1a /              ext4    defaults,noatime 0 1
UUID=433fa599-d4cd-4689-8cd0-5262333f634f swap           swap    defaults,noatime 0 0
UUID=08994d45-a4de-4aa0-b4c7-43e8482eca1e /run/media/andy/linux-data ext4 defaults,noatime 0 0

Then when i try mounting it as a test I get the below error. I’m stuck and not sure what I’m missing.

[andy@manjaro ~]$ sudo mount -a
[sudo] password for andy: 
mount: /run/media/andy/linux-data: mount point does not exist.

There’s your problem. The /run hierarchy only exists in virtual memory, and the mountpoint is only created when the drive is mounted from within a file manager. You need to set up a permanent mountpoint ─ see this tutorial… :arrow_down:

2 Likes

Hello @jajao555 :wink:

No wonder. /run/media is there for applications which do temporary auto mounts like file managers. They create create folder automatically.

The preferred place is /media/linux-data. Keep sure you create that one:

sudo mkdir -pv /media/linux-data

and change it it in fstab.

@megavolt @Aragorn thank you both! That helps and that fixed it. Thank for the link as well!

Actually, it’s not. That’s just something certain people do, but it may lead to permissions issues.

On a single-user system, the preferred mountpoint is somewhere inside one’s home directory. That’s one of the reasons why I wrote that tutorial in the first place. :wink:

Erm… I am sorry @Aragorn, but I don’t get it. Why would the path lead to a permission problem? The permissions are set on the filesystem anyway.

I myself mount a big and fat ext4 partition on /media/data and then bind the home folder.

LABEL=DATA		/media/data             ext4    defaults,noatime       0 2
/media/data/home/	/home			none	bind		0 0	

Managing partitions is simply slave labor for me, if we have an intern, then he gets to do that. So I create folders on Data an just bind them. That is more flexible and no partitioning is needed.

The permissions on the mountpoint. /media is a root-level directory and is by default owned root:root. Besides, that’s not the right place anyway, because /media is intended for removable devices.

Why not mount that partition to /home instead? Why mount it as /media/data and then bind-mount it again? :face_with_raised_eyebrow:

Partially I agree on the historical intention of the /media path, but removeable can also be understandable as “Everything what can be detached and is not needed to boot a system.” But that is my interpretation and well, while historically it has an intention or goal, the users use it their own way and expand the use, because it fits the origin goal.

The fact is that file managers only show partitions in the sidebar, if they are located in /media or /run/media and common users would find their partition easier then.

This partition is not only there for the home folder, but also common data. That way there is a removable big data partition, where I can outsource any kind of data, which is not necessary to boot (at least boot as root) and if something goes wrong, then the important files are safe.

If the partition is mounted to /home, then it is only there for /home. Period. When you avoid partitioning, then you have to deal with bind or symlinks (or BTRFS with subvolumes also).

My experience is that resizing take a long time. So lets say i have one home partition and one data partition on the same drive. In case of ext4, I can grow it easily online, but shrinking takes way more time. Now the data partition needs to be shrunk and moved to the right, so that I can grow the home partition. The whole data of 4TB must be moved to the right… Now guess what, how long this takes… :sleeping: Yeah, there is LVM, but that is again an extra layer of complexity. Even BTRFS takes so much time to shrink and move some TB. So for a Desktop PC, binding and symlinks of folders made my life less painful.

On servers I would rather use LVM with ext4/xfs or BTRFS only.

Freudian slip? :face_with_hand_over_mouth:

Not true. On my system, it shows every mounted partition, and even the unmounted ones.

Besides, using a mountpoint inside your home directory doesn’t even require you to look at the partitions. After all, UNIX is not drive-oriented but directory-oriented.

If you bind-mount that mountpoint to /home, then that is exactly the same. The only difference is that you’ve introduced a needless detour. :man_shrugging:

Whuups… could be xD

That is strange. Right now I am using Manjaro I3 Edition. I have mounted a partition to /mnt and to /recovery/iso. They are not displayed in pcmanfm, but /media/data is displayed. But yeah, I guess you run your file manager as root :sweat_smile:

I understand that, really. You can create folders without root permissions, but editing fstab and mounting it, needs root. Unless you can mount partition and having a personal fstab, I would rather say it is useless to have it in /home/user. Just create a symlink for /media/data/common → ~/common and you are done.

Maybe we don’t understand each other. It is not a detour, it is a flexible feature. /home → /media/data/home are mirrored. Now I can create another folder (instead of creating a new partition) and bind that to /opt → /media/data/opt. This way I can avoid creating new partitions and outsource anything.

Nope. I do all of the root stuff by way of the command line. :wink:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.