Bug 965918 - /media no longer is used so maybe could be a link for new location
Summary: /media no longer is used so maybe could be a link for new location
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: filesystem
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-22 03:33 UTC by Sergio Basto
Modified: 2014-10-16 18:58 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-07-30 12:34:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Sergio Basto 2013-05-22 03:33:39 UTC
Description of problem:

mount point devices on F18 are mounted on /run/media
so maybe is more useful /media be a symbol link of /run/media/ 

ln -s /run/media/ /

ll /media
lrwxrwxrwx 1 root root 11 Mai 22 04:22 /media -> /run/media/


Additional info:
/run on F18 is a tmpfs like /tmp , don't know if user could choose other options than not mount on /run/media if so wee need to see if symbol link don't mess with it.

Comment 1 Ondrej Vasik 2013-05-22 18:24:32 UTC
Symlinks in filesystem package are always a bit tricky... but will check what can be done.

Comment 2 Karel Volný 2013-08-28 08:32:16 UTC
not a good idea, because Fedora still contains software that adheres to FHS and works on /media/something

anyways, I don't understand what is this change for, where's the feature page, where's FESCO approval on this? - I'd expect exactly opposite bugreport, to bring back proper /media usage instead a bug wishing to finish the destruction of /media ...

Comment 3 Ondrej Vasik 2013-08-29 09:16:26 UTC
Karel, FESCO approves major changes, not such small tunings invisible for users. Such tunings like are not Fedora features - and there is no need for FESCO bureaucracy. With symlink /media -> /run/media , nothing changes for software which works on /media/something - as it will point to /run/media location. Nobody would notice /bin -> /usr/bin without the feature page - as there were no conflicts - such change with /media is even easier, as you don't have Requires/Provides on /media/<something> ...

The only thing which may break is script with relative paths (running e.g. ../bin/bash ) - other than that, everything should be unaffected by symlink. For Fedora 20/21 it shouldn't be an issue.

Comment 4 Fedora End Of Life 2013-09-16 16:42:26 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 5 Fedora End Of Life 2013-09-17 07:47:18 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 6 nucleo 2014-07-29 11:14:38 UTC
# yum update filesystem
Resolving Dependencies
--> Running transaction check
---> Package filesystem.i686 0:3.2-27.fc22 will be updated
---> Package filesystem.i686 0:3.2-28.fc22 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                   Arch                Version                    Repository              Size
=======================================================================================================
Updating:
 filesystem                i686                3.2-28.fc22                rawhide                1.1 M

Transaction Summary
=======================================================================================================
Upgrade  1 Package

Total size: 1.1 M
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction (shutdown inhibited)
Transaction couldn't start:
file /media from install of filesystem-3.2-28.fc22.i686 conflicts with file from package filesystem-3.2-27.fc22.i686


[('file /media from install of filesystem-3.2-28.fc22.i686 conflicts with file from package filesystem-3.2-27.fc22.i686', (7, '/media', 37015L))]

Comment 7 Ondrej Vasik 2014-07-29 12:38:44 UTC
Yes, replacing dir with symlink - fortunately, this is just for rawhide updates, I'll try to fix it soon (as /media is nowadays empty, most of usecases should be fixed with os.remove("/media") in %pre scriptlet before creating symlink.

Comment 8 nucleo 2014-07-30 11:27:43 UTC
filesystem-3.2-29.fc22.i686 updated fine.

Comment 9 nucleo 2014-08-04 11:33:46 UTC
/media -> run/media link broken if no one device was mounted because run/media not exists, so maybe it should be created even without any device mounted?

Comment 10 Ondrej Vasik 2014-08-04 14:21:49 UTC
yes, will check the proper way with systemd guys - probably creating file as posttrans in /etc/tmpfiles.d would be the right way.

Comment 11 Michal Schmidt 2014-08-11 11:59:30 UTC
udisks can be configured (with udev rules) to mount devices under /media. From udisks(8):

       UDISKS_FILESYSTEM_SHARED
           If set to 1, the filesystem on the device will be mounted in a
           shared directory (e.g.  /media/VolumeName) instead of a private
           directory (e.g.  /run/media/$USER/VolumeName) when the
           Filesystem.Mount() method is handled.

Having /media as a symlink to /run/media may break this.

Also, /run/media != /run/media/$USER, so it's not like the symlink provides us with any kind of backwards compatibility...

Comment 12 Ondrej Vasik 2014-08-11 12:44:51 UTC
Michal, I'm not sure I'm getting correctly why the symlink can break this? IMHO if the tmpfiles.d file creating /run/media during startup is there and UDISKS_FILESYSTEM_SHARED is set to 1, shared directory will be still shared - and mounted to /run/media/VolumeName - and anyone/anything expecting it in /media/VolumeName should succeed.
But you are right /run/media != /run/media/$USER - so symlink doesn't help too much...

Comment 13 Michal Schmidt 2014-08-11 12:47:00 UTC
(In reply to Ondrej Vasik from comment #12)
> Michal, I'm not sure I'm getting correctly why the symlink can break this?
> IMHO if the tmpfiles.d file creating /run/media during startup is there and
> UDISKS_FILESYSTEM_SHARED is set to 1, shared directory will be still shared
> - and mounted to /run/media/VolumeName

For one, VolumeName may conflict with an existing user's name.

Comment 14 Ondrej Vasik 2014-08-11 13:17:28 UTC
But as /run/media is empty after the reboot as tmpfs, it should be empty if UDISKS_FILESYSTEM_SHARED is set to 1 - with no private disks mounted, right? But yes, it is not perfect.

Comment 15 Michal Schmidt 2014-08-11 13:23:30 UTC
UDISKS_FILESYSTEM_SHARED can be set per-device. You can have private (mounted under /run/media/$USER) and shared (mounted under /media) devices at the same time.

Comment 16 Ondrej Vasik 2014-08-11 13:29:56 UTC
So - do I get it right your recommendation is to revert the /media -> /run/media change?

Comment 17 Michal Schmidt 2014-08-11 13:49:44 UTC
Yes, IMO the symlink is not useful, having it there is fragile, and it should be undone. I see two options for /media:

1. Revert it to a directory.

2. Drop it.
     If we are sure nothing in the distribution needs it.
     For instance, I'm not sure about "udisks", which we still ship.
     udisks2's UDISKS_FILESYSTEM_SHARED option is not the default and whoever
     sets it can also create /media by themselves, so I would not count that.

Comment 18 Ondrej Vasik 2014-08-11 14:01:41 UTC
Ok, I will revert it back to directory, thanks for the comments.

Comment 19 Sergio Basto 2014-10-16 18:58:37 UTC
Hi for the record,  
I found other case :

/usr/bin/livecd-iso-to-disk boot.iso /dev/sdb1
mktemp: failed to create directory via template ‘/media/srctmp.XXXXXX’: No such file or directory

so I remove rm /media 
rm: remove symbolic link ‘/media’? y
and just after 
mkdir /media 


/usr/bin/livecd-iso-to-disk boot.iso /dev/sdb1 worked


Note You need to log in before you can comment on or make changes to this bug.