Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: mobile hard disk is read only when mounted by dolphin

  1. #1
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default mobile hard disk is read only when mounted by dolphin

    i have a mobile hard disk, its file system is ext4. when i plugged into my machine, dolphin prompted me to mount , so i clicked to mount them.
    but i found the mounted mobile hard disk is not writable.

    Code:
    > ll
    total 4
    drwxr-xr-x 3 root root 4096 Jul 23 13:54 MHD1
    if MHD1 partition is automatically changed to 777 after mounted, then the problem will get fixed. and i guess dolphin / KDE maybe have an internal or external mount policy which i can customize . but i don't find it.

    please help, thanks !
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

  2. #2
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,393
    Blog Entries
    1

    Default Re: mobile hard disk is read only when mounted by dolphin

    Well, you have it formatted as ext4 and owned by root. This filesystem uses **nix permissions which are respected. That can easily be changed if required though.

    For comparison, I have a vfat partitioned storage device that mounts via udisks2/KDE, and so it mounts like this
    Code:
     ll /var/run/media/dean/
    total 8
    drwx------ 12 dean users 8192 Jan  1  1970 SP UFD U2

  3. #3
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default Re: mobile hard disk is read only when mounted by dolphin

    it seems that i can use polkit actions / rules to change owner and / or access privilege, but i am not familiar with polkit, i haven't a clear solution yet.
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

  4. #4
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,393
    Blog Entries
    1

    Default Re: mobile hard disk is read only when mounted by dolphin

    Quote Originally Posted by BruceAuyeung View Post
    it seems that i can use polkit actions / rules to change owner and / or access privilege, but i am not familiar with polkit, i haven't a clear solution yet.
    No, polkit is used to control access, not for changing ownership.

    Here, read this old thread. It might help clarify the necessary...
    https://forums.opensuse.org/showthre...d-as-root-root

  5. #5
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default Re: mobile hard disk is read only when mounted by dolphin

    is it possible that running chmod when an action is performed ?
    but first of all, $MOUNT_POINT_ABS_PATH ( such as /run/media/bruce/MHD1 ) can be passed in by polkit .
    Code:
      <action id="org.freedesktop.udisks2.filesystem-mount-other-seat">
        <description>Mount a filesystem from a device plugged into another seat</description>
        <defaults>
          <allow_any>auth_admin</allow_any>
          <allow_inactive>auth_admin</allow_inactive>
          <allow_active>auth_admin_keep</allow_active>
          <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/chown bruce:users $MOUNT_POINT_ABS_PATH</annotate>
          <annotate key="org.freedesktop.policykit.exec.allow_gui">false</annotate>
        </defaults>
      </action>
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

  6. #6
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default Re: mobile hard disk is read only when mounted by dolphin

    seems to be an impossible job.
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

  7. #7
    Join Date
    Jun 2008
    Location
    Auckland, NZ
    Posts
    20,393
    Blog Entries
    1

    Default Re: mobile hard disk is read only when mounted by dolphin

    Quote Originally Posted by BruceAuyeung View Post
    seems to be an impossible job.
    Why don't you simply change ownership/permissions of the directories/files on the external storage device?
    Last edited by deano_ferrari; 23-Jul-2015 at 03:42.

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: mobile hard disk is read only when mounted by dolphin

    There is no difference between this mounted (Linux file system) partition and any other of the kind. This means that the ownership/permissions of the mountpoint do the same as ownership/permisions of any other directory. Same for all file/directories in the file system.

    Thus when you post
    Code:
    drwxr-xr-x 3 root root 4096 Jul 23 13:54 MHD1
    (which I assume is about the mount point, you never said or showed hat), it means that root kan search, read and write in the directory and that others can not write.

    Thus, when you say it is "readonly" that probably is not true (you can show that with the mount command), but you probably tried to write somwhere inside the directory as end-uer and that failed of course. As root it has to be possible to write there (did you try?).

    My advices would be:
    1. read something about ownership by user and group and permission bits;
    2. create an entry in /etc/fstab for the mount (e.g. through YaST), then you can decide yourself where the mountpoint should be;
    3. first decide what the usage of the file system will be, for the system, for one of the users? Then you can plan mountpoint, ownership, etc. accordingly.


    Also this ifno might help: https://en.opensuse.org/SDB%3ABasics...,_mount_points
    Henk van Velden

  9. #9
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default Re: mobile hard disk is read only when mounted by dolphin

    @hcvv thanks for your advice.
    actually i know about file / directories' ownership and access bits very much. i also know how to manually mount or automatically mount with /etc/fstab.
    what i just wanna know is that whether it is possible to auto-mount removable hard disks within dolphin / krusader / system tray notification by a simple click which a newbie linux user can do.
    after all, /etc/fstab usually fits for mounting fixed hard disks (contrast to removable hard disks).

    i researched polkit and like @deano_ferrari already pointed out, polkit can decide who can mount , can not decide how to mount.

    so finally my solution comes ( i know it not for newbie users):
    Code:
    > cat /etc/fstab 
    ......
    UUID=385acbee-ebab-42e4-ae38-499fd4841e40 /mnt/sdb1            ext4       user,acl,nofail       1 2
    UUID=e48ca8d7-5e36-46aa-9ec2-77dca3184d9a /mnt/sdb2            ext4       user,acl,nofail       1 2
    UUID=dc188773-62ac-4377-b549-1827ef3d43e8 /mnt/sdb3            ext4       user,acl,nofail       1 2


    nofail option ensures there will be no failure even if my removable hard disk doesn't exist while booting system.
    and then i have to manually change /mnt/sdb1 's ownership.

    i don't wanna format my hard disk to NTFS because ntfs-3g works in user mode and consumes too much CPU ( 40% when copying a 4G-size file ) , and ntfs is slower ( 30MB/s constrast to 60MB/s ) when copying a 4G-size file
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

  10. #10
    Join Date
    Nov 2012
    Location
    Sanya, China
    Posts
    242

    Default Re: mobile hard disk is read only when mounted by dolphin

    Code:
    > ll /mnt/
    drwxr-xr-x 3 bruce users 4096 7月  23 19:28 sdb1
    drwxr-xr-x 3 bruce users 4096 7月  23 13:54 sdb2
    drwxr-xr-x 3 bruce users 4096 7月  23 14:01 sdb3
    drwx------ 2 bruce users 4096 7月  12 17:17 veracrypt1
    > cat /etc/fstab 
    ......
    UUID=385acbee-ebab-42e4-ae38-499fd4841e40 /mnt/sdb1            ext4       user,acl,nofail       1 2
    UUID=e48ca8d7-5e36-46aa-9ec2-77dca3184d9a /mnt/sdb2            ext4       user,acl,nofail       1 2
    UUID=dc188773-62ac-4377-b549-1827ef3d43e8 /mnt/sdb3            ext4       user,acl,nofail       1 2
    there is a weird thing happens with this code snippet
    if this hard disk is already plugged in before booting system, my system will automatically mount all these three partitions.
    but when i plugin my removable hard disk after system already booted, my system will also automatically mount all these three partitions, and i bruce user can write !
    and i do not enable automatic mounting of removable media
    Using openSUSE 13.2 64bit, KDE 4.14.9
    Blog website: http://suselinks.us

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •