Page 1 of 1

How does Mageia automatically mount devices?

PostPosted: Oct 15th, '16, 21:58
by SgtCasper
Hi, everybody!

How does Mageia automatically mount devices?

I used to use Linux a long, long time ago... And I used to mount everything manually.

I used to edit /etc/fstab and manually typed "Mount (...)"

But now, Linux automatically mounts everything. But there is no /etc/fstab, no /etc/mtab and /mnt is empty! :O

When I insert a DVD, it automatically appears on "Device" section, but if I navigate on the Linux filesystems, I see nothing.

The doubt is, I'm using Mageia 4.1 I have one tablet that doesn't appear on device section. If I connect the tablet and type "lsusb", my tablet appears. I've installed mtp and manually mount the tablet. But I think I'm doing it the "dirty" way because I need to create a directory on /mnt/Tablet" and manually mount my tablet there. Besides, my tablet doesn't appear on Nautilus, just on the terminal.

I've searched at Google to try to solve this issue, but I only get 8532 "tutorials" with some commands, but no explanation at all. Instead of Googling and typing some commands that I don't know, I would to understand what's happening behind the scenes.

I guess many people have these same difficulties, if someone thinks appropriate, I can create a Wiki article to help newcomers :)

Thanks anyway

Re: How does Mageia automatically mount devices?

PostPosted: Oct 18th, '16, 03:23
by doktor5000
SgtCasper wrote:How does Mageia automatically mount devices?

Well, like nearly every other distribution does it? The kernel emits events when new devices are plugged/detected, either a kernel module is directly loaded or those events are processed by udev and udisks for storage devices, and eventually if there are partitions and filesystems which are mountable they will be passed to your desktop environment which usually will automount them.

SgtCasper wrote:But there is no /etc/fstab, no /etc/mtab and /mnt is empty! :O

/etc/fstab is still there, check again. /etc/mtab is now usually symlinked to /proc/self/mounts
Furthermore /media should be used for temporary mounts, which is more correct according to FHS, and which is what nearly everybody uses and we still do for windows partitions which are detected by our installer.
Although since some time the automatic mounts are done under /run/user/${uid}/media which is what e.g. mount or lsblk or so would have told you.

SgtCasper wrote:When I insert a DVD, it automatically appears on "Device" section, but if I navigate on the Linux filesystems, I see nothing.

Hmmm? You do an ls -al on the mountpoint, and what exactly happens - care to provide a complete example?
And please check the section above before you do.

SgtCasper wrote:The doubt is, I'm using Mageia 4.1 I have one tablet that doesn't appear on device section. If I connect the tablet and type "lsusb", my tablet appears. I've installed mtp and manually mount the tablet. But I think I'm doing it the "dirty" way because I need to create a directory on /mnt/Tablet" and manually mount my tablet there. Besides, my tablet doesn't appear on Nautilus, just on the terminal.

MTP devices are a different story and they are ugly IMHO, depends on the filemanager or desktop environment having MTP support and also the MTP libraries need to be current ...
For issues with a specific MTP device please start a separate thread and provide some more details about it, at least the lsusb output.

Re: How does Mageia automatically mount devices?

PostPosted: Oct 18th, '16, 18:11
by jiml8
Also, for finding where various devices are mounted, the df command is your friend, as is the mount command. :)

Re: How does Mageia automatically mount devices?

PostPosted: Oct 18th, '16, 22:46
by doktor5000
Mentioned already - althoug I prefer lsblk (and also findmnt) even when those are not as universal nor posix ...

Re: How does Mageia automatically mount devices?

PostPosted: Oct 19th, '16, 20:07
by roti
doktor5000 wrote:Although since some time the automatic mounts are done under /run/user/${uid}/media which is what e.g. mount or lsblk or so would have told you.


Yes, I always wondered why Mageia uses /run? All other distros I know use /media. Not that it hurts or something, just curious.

Re: How does Mageia automatically mount devices?

PostPosted: Oct 20th, '16, 15:17
by doktor5000
Nope, all distros using systemd nowadays use /run. Check http://www.freedesktop.org/software/systemd/man/pam_systemd.html
The purpose that /run/user fulfills is basically also described in the crossdistro freedesktop specifications, see XDG_RUNTIME_DIR in https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
FWIW, since the UsrMove this is the same as/replaces /var/run which some may know from older setups.