LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-13-2015, 06:49 PM   #1
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Rep: Reputation: 0
/media vs /media/root


just upgraded my distro from wheezy to Jessie
I used to get /media
now I get /media/root
how do I change it back
I already have a autoexec.sh containing udisks that does it for me but I am annoyed that I don't understand this better.
do not talk about editing /etc/fstab. that's not not where I am coming from.
I hated grub2 till I rewrote it.
I added remastersys and a custom menu
I also have pcmanfm create and delete my samba shares, lots of fun.
 
Old 05-13-2015, 08:16 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,326
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Under what circumstances to you get "/media/root"? Specifically, is it when mounting removable devices as root?
 
Old 05-15-2015, 06:53 AM   #3
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: 0
I always have and will auto-login as root. for convenience. not interested in doing any typing for passwords or logins ever.
 
Old 05-15-2015, 07:58 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897Reputation: 5897
Welcome to LinuxQuestions.

Not enough information provided and like frankbell assume this is about automounting USB devices. By default udisks automatically mounted removable media to /media/label and udisks2 automatically mounts to /media/username/label. Supposedly you can add a udev rule to change it back to /media.

Code:
/etc/udev/rules.d/99-udisks2.rules

# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
 
Old 05-16-2015, 02:31 AM   #5
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: 0
sorry about the lack of detail, a post went missing
the partitions mounting in the wrong place are all of them.
removable or otherwise.
however you are already going in a direction I like when you mention udev rules.
I will look in /etc/udev and see If I can do it from here
 
Old 05-16-2015, 02:48 AM   #6
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: 0
nearly there

I deleted udisks2, the annoying hard disk mounts are gone
but they don't show unless

/usr/bin/udisks --mount /dev/sda2
/usr/bin/udisks --mount /dev/sda5
/usr/bin/udisks --mount /dev/sdb1
/usr/bin/udisks --mount /dev/sdb5
/usr/bin/udisks --mount /dev/sdc1
/usr/bin/udisks --mount /dev/sdc5
/usr/bin/udisks --mount /dev/sdd1
/usr/bin/udisks --mount /dev/sdd5


is in my autoexec.
Usb disks are automatically mounted to /media. I am happy and so are my spin users

I must mention this is the most direct and useful advice I have ever received.
Anyway I can avoid the autoexec entries?

Last edited by pastor3141; 05-16-2015 at 02:57 AM.
 
Old 05-16-2015, 05:41 AM   #7
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: 0
from the clues I got on this forum, many thanks moderator and frankbell

the perfect answer turned out to be

create
/etc/udev/rules.d/20-media-by-label-auto-mount.rules

which contains everything below

KERNEL!="sd[a-z][0-9]", GOTO="media_by_label_auto_mount_end"

# Import FS infos
IMPORT{program}="/sbin/blkid -o udev -p N"

# Get a label if present, otherwise specify one
ENV{ID_FS_LABEL}!="", ENV{dir_name}="%E{ID_FS_LABEL}"
ENV{ID_FS_LABEL}=="", ENV{dir_name}="usbhd-%k"

# Global mount options
ACTION=="add", ENV{mount_options}="relatime,sync"
# Filesystem-specific mount options
ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,uid=1000,gid=1000,umask=002"

# Mount the device
ACTION=="add", RUN+="/bin/mkdir -p /media/%E{dir_name}", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%E{dir_name}"

# Clean up after removal
ACTION=="remove", ENV{dir_name}!="", RUN+="/bin/umount -l /media/%E{dir_name}", RUN+="/bin/rmdir /media/%E{dir_name}"

# Exit
LABEL="media_by_label_auto_mount_end"
 
Old 05-17-2015, 08:16 PM   #8
pastor3141
LQ Newbie
 
Registered: May 2015
Posts: 6

Original Poster
Rep: Reputation: 0
found a better answer
Mount to /media (udisks2)
By default, udisks2 mounts removable drives under the ACL controlled directory /run/media/$USER/. If you wish to mount to /media instead, use this rule:


/etc/udev/rules.d/99-udisks2.rules
contains

# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Why does /media/cdrecorder pop up with "cd /media/ + tab" when I have /media/usb too? SharpyWarpy Fedora 6 11-22-2012 01:05 AM
Patch help request to Restore mount to /media vs /run/media lkraemer Slackware 1 10-13-2012 06:35 PM
Media streaming between WMP and Linux media players (preferably Amarok) EducatedWhiteTrash Linux - Software 2 08-20-2010 08:11 PM
Can I install Media Jukebox 12 with Ubuntu OS? Needs Windows Media Player Files. tlcmd Linux - Newbie 2 01-08-2010 03:29 PM
Cannot read package data from installation media. Media error? </m0r1arty> SUSE / openSUSE 2 01-26-2005 07:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration