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

Thread: How do I set correct permissions permanently for my 2nd internal HDD?

  1. #1

    Question How do I set correct permissions permanently for my 2nd internal HDD?

    Firstly, please can my last thread be deleted.

    Apologies for the double post, and being in the wrong section.

    Ill try to be clear in what Im asking this time, as I seemed to confuse some people last time, and it didn't help anyone.


    I have aslo tried to pm hcvv as my other thread got locked, So I could not reply to anyone after regarding the advice I was given, but I cannot see my message in my sent items, so think it failed to send.


    Here is an image of my HDD partitions

    http://img28.imageshack.us/img28/6484/partitionsv.png

    The HDD mounted at media/Media is the drive I have problems with.

    I changed it from ntfs to ext4 today, to explain further on this I simply backed up any data that wasn't already on my lidevrive account to another HDD, formatted to ext4, and remounted at media/Media, This is not relevant to my question, it was successful, but I'm just explaining why I am at this point when I wasn't yesterday.

    here is the fstab,

    Code:
    rob@linux-mzrw:~> cat /etc/fstab
    /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part1 swap                 swap       defaults              0 0
    /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part5 /                    ext4       acl,user_xattr        1 1
    /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part6 /home                ext4       acl,user_xattr        1 2
    /dev/sdb5                                      /media/Media         ext4       user,acl,user_xattr   1 2
    /dev/sdc1                                      /media/Stuff         ext4       user,acl,user_xattr   1 2
    proc                 /proc                proc       defaults              0 0
    sysfs                /sys                 sysfs      noauto                0 0
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0
    usbfs                /proc/bus/usb        usbfs      noauto                0 0
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
    My only issue is permissions, all drives are mounting at boot up, all drive permissions seem correct, apart from the one highlighted in red.

    This drive will not allow me to copy, write files, even play music unless i browse in Dolphin with super user, or log in as root.

    From my last thread I have learned the following, please could somebody confirm them for me.


    It is best to mount drives by-id, I will use this command to see how they should be listed
    Code:
    ls -l /dev/disk/by-id




    I should NEVER create mount points in /media, but instead use /mnt. So I will edit that in fstab, and remount the drives at those location (/Media and /Stuff) using the partition tool (Im sure there is a command to do it, I'm used to windows and GUI)

    I would like to
    chown and chmod the parent directories, /mnt/Media and /mnt/Stuff, That way I have permissions to write to both of those drives, I dont have multiple users, or any groups set up, just my log in.

    IS this easiest done with commands, if so I would probably need some help, although I'm sure the info is out there, and Im happy to look for it, if I know its the right way to do it.

    Or should I be using what looks to be a great script by
    jdmcdaniel3 S.A.F.P. - SUSE Automated File Permissions - Version 1.0.4: https://forums.opensuse.org/blogs/jd...ion-1-0-4-113/.


    Again, apologies for the confusion last time, I hope this thread is better for everyone.

    Thanks

    Rob




  2. #2
    Join Date
    Jun 2008
    Location
    East of Podunk
    Posts
    33,250
    Blog Entries
    15

    Default Re: How do I set correct permissions permanently for my 2nd internal HDD?

    Hi
    You can mount it anyhow you like I always use /data

    Check the ownership I let /data remain with root and then just create sub directories (as root) and change ownership to my user and users group.
    Code:
    drwxr-xr-x  22 root root    4096 Nov 14 10:12 data
    
    /dev/sdb5            /data                ext4       acl,user_xattr 1 2
    I don't add user group to the attributes.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3

    Default Re: How do I set correct permissions permanently for my 2nd internal HDD?

    Hi, Thanks for the quick reply.


    So far I have simply changeds the mount point, and listed it by device ID.


    Code:
    rob@linux-mzrw:~> cat /etc/fstab/dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part1 swap                 swap       defaults              0 0                                                                                                                                                                       
    /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part5 /                    ext4       acl,user_xattr        1 1                                                                                                                                                                       
    /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part6 /home                ext4       acl,user_xattr        1 2                                                                                                                                                                       
    /dev/disk/by-id/ata-SAMSUNG_HD154UI_S1XWJ9BZA00981-part5 /mmt/Media           ext4       user,acl,user_xattr   1 2                                                                                                                                                             
    /dev/disk/by-id/ata-ST96812AS_5PJ7EB02-part1   /mmt/Stuff           ext4       user,acl,user_xattr   1 2                                                                                                                                                                       
    proc                 /proc                proc       defaults              0 0                                                                                                                                                                                                 
    sysfs                /sys                 sysfs      noauto                0 0                                                                                                                                                                                                 
    debugfs              /sys/kernel/debug    debugfs    noauto                0 0                                                                                                                                                                                                 
    usbfs                /proc/bus/usb        usbfs      noauto                0 0                                                                                                                                                                                                 
    devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
    Im not sure why, but /mmt/Stuff seems to have the correct permissions, I can delete, copy, eidt files on that drive as I would like to, but not on /mmt/Media, and I'm not sure how to set that?

  4. #4

    Default Re: How do I set correct permissions permanently for my 2nd internal HDD?

    I cant edit my post, have had to reply.

    I have installed the automated permissions script.

    managed to cd to /mmt

    I'm displayed with this, a clear difference between the two drives

    Code:
    drwxr-xr-x 8 root root 4096 Dec  9 17:32 Media
    drwx------ 6 rob  1000 4096 Dec  9 16:19 Stuff
    I assume I want Media to match that or Stuff

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do I set correct permissions permanently for my 2nd internalHDD?

    On 2012-12-10 00:16, rob 1980 wrote:

    > I have aslo tried to pm hcvv as my other thread got locked, So I could
    > not reply to anyone after regarding the advice I was given, but I cannot
    > see my message in my sent items, so think it failed to send.


    I believe it is open now, on a new link. I'm hesitant to reply here, as
    a matter of of fact.

    > here is the fstab,
    >
    >
    > Code:
    > --------------------
    > rob@linux-mzrw:~> cat /etc/fstab
    > /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part1 swap swap defaults 0 0
    > /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part5 / ext4 acl,user_xattr 1 1
    > /dev/disk/by-id/ata-ST3400620AS_5QG03ZZD-part6 /home ext4 acl,user_xattr 1 2
    > /dev/sdb5 /media/Media ext4 user,acl,user_xattr 1 2
    > /dev/sdc1 /media/Stuff ext4 user,acl,user_xattr 1 2

    ....
    > --------------------



    > From my last thread I have learned the following, please could somebody
    > confirm them for me.
    >
    >
    > It is best to mount drives by-id, I will use this command to see how
    > they should be listed


    I personally prefer mount by label.


    > I should NEVER create mount points in /media, but instead use /mnt. So
    > I will edit that in fstab, and remount the drives at those location
    > (/Media and /Stuff) using the partition tool (Im sure there is a command
    > to do it, I'm used to windows and GUI)


    Yes, the partition tool should do it fine.


    > I would like to chown and chmod the parent directories, /mnt/Media and
    > /mnt/Stuff, That way I have permissions to write to both of those
    > drives, I dont have multiple users, or any groups set up, just my log
    > in.


    Ok.

    > IS this easiest done with commands, if so I would probably need some
    > help, although I'm sure the info is out there, and Im happy to look for
    > it, if I know its the right way to do it.


    It can be done with commands. I can not say how to do it with a GUI
    because I don't know how :-)

    However, there is something intermediate that I use: midnight commander
    (mc). It is a file browser that runs in text mode, or inside a terminal.
    You have to install it first.

    >
    > Or should I be using what looks to be a great script by *'jdmcdaniel3'
    > (https://forums.opensuse.org/members/jdmcdaniel3.html) *S.A.F.P. - SUSE
    > Automated File Permissions - Version 1.0.4:
    > 'https://forums.opensuse.org/blogs/jd...ion-1-0-4-113/'
    > (http://tinyurl.com/cw4lrm7).


    Dunno, not familiar with that one.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  6. #6
    Join Date
    Jun 2008
    Location
    East of Podunk
    Posts
    33,250
    Blog Entries
    15

    Default Re: How do I set correct permissions permanently for my 2nd internal HDD?

    Quote Originally Posted by rob_1980 View Post
    I cant edit my post, have had to reply.

    I have installed the automated permissions script.

    managed to cd to /mmt

    I'm displayed with this, a clear difference between the two drives

    Code:
    drwxr-xr-x 8 root root 4096 Dec  9 17:32 Media
    drwx------ 6 rob  1000 4096 Dec  9 16:19 Stuff
    I assume I want Media to match that or Stuff
    Hi
    1000 = your user rather that the users group, plus make it 0755

    So as root;
    Code:
    cd /mnt
    chown rob:users Stuff
    chmod 0755 Stuff
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do I set correct permissions permanently for my 2nd internalHDD?

    On 2012-12-10 00:56, rob 1980 wrote:
    >
    > I cant edit my post, have had to reply.
    >
    > I have installed the automated permissions script.
    >
    > managed to cd to /mmt
    >
    > I'm displayed with this, a clear difference between the two drives
    >
    >
    > Code:
    > --------------------
    > drwxr-xr-x 8 root root 4096 Dec 9 17:32 Media
    > drwx------ 6 rob 1000 4096 Dec 9 16:19 Stuff
    >
    > --------------------
    >
    >
    > I assume I want Media to match that or Stuff


    Good.

    Do this, in a terminal:

    Code:
    
    > su -
    > find /mnt/Media/ -type f -exec chown username:users '{}' \;
    > find /mnt/Media/ -type f -exec chmod u+r+w,o-r-w,g-r-w '{}' \;
    > find /mnt/Media/ -type d -exec chmod u+r+w+x,g-w-r-x,o-w-r-x '{}' \;
    The first line finds all files in /mnt/Media and executes a command on
    each that changes them to belong to user "username" and group "users".
    Just change "username" to your own user name.

    The second line does the same find sequence, but this time it changes
    the permissions of all files.

    And the third line does the same, but instead of files finds directories
    and changes their permissions (you need different permissions for files
    than for directories).

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  8. #8

    Default Re: How do I set correct permissions permanently for my 2nd internal HDD?

    Yep, I wouldn't mount an internal drive in /media either, if only for organization sake .
    I normally put dmask=0002 in mount options. That works fine.
    It is abhorrent the spiritual greed of those that knowing something, do not seek the transfer of such knowledge.

    Miguel de Unamuno - Writer (1864-1936)

  9. #9
    dd NNTP User

    Default Re: How do I set correct permissions permanently for my 2nd internalHDD?

    On 12/10/2012 12:58 AM, Carlos E. R. wrote:
    > It can be done with commands. I can not say how to do it with a GUI
    > because I don't know how


    though i have never done it the GUI way, i would think it possible to:

    -using the menu system launch Applications > System > File Manager >
    File Manager - Superuser Mode (give root password when asked) then

    -navigate to the drive in question (whether that is /media/Media or
    /mnt/Media or /data/Media makes no difference to _this_ method)

    -right click on the icon of that drive, and select "Properties" then the
    "Permissions" tab

    -adjust "Access Permissions" to allow owner/group/others to any of the
    three choices available (view = NO writes; modify = writes allowed;
    forbidden = can't write or view)

    -adjust "Ownership" to 'rob' and 'users'

    -click "Ok"

    -CLOSE the superuser powered file manager (that is, don't forget it is a
    superuser appliance and KILL your system by accident)

    now, lets look at what you wrote in one of your post: "This drive will
    not allow me to copy, write files, even play music unless i browse in
    Dolphin with super user, or log in as root."

    by that last part (log in as root) i _assume_ you say at the login
    screen for KDE, GNOME, LDXE or other desktop environment (DE) and typed
    in "root", gave the root password and logged into the DE as root..

    unfortunately, that is a very common mistake done by folks new to
    *nix-like operating systems, because in their previous OS it was normal
    to log in as the Administrator..

    but, not so here:

    you should never log into KDE/GNOME/LXDE/Xfce or any other *nix-like
    system's graphical user interface desktop environment as root..

    doing so 1) opens you up to several different security problems if you
    (for example) browse the net, 2) too many, far too easy ways to damage
    your system no matter how careful your actions (for
    example: cases of unintended change of ownership of some files from user
    to root sometimes occurs which can preclude logging in as the user), 3)
    anyway logging into KDE/etc as root is *never* required to do any or all
    administrative duties, 4) and, not even logging in as root just to see
    if it works as root is useful, because the "yes" or "no" learned is
    almost always totally useless in finding the
    problem giving the symptoms...while, logging into the GUI as root to
    learn the yes/no could _cause_ the next adverse symptom encountered.

    so, always log in as yourself, and "become root" by using a root powered
    application (like YaST, File Manager Superuser Mode) or using "su -",
    sudo, kdesu, or gnomesu in a terminal to launch whatever tool is needed
    (like KWrite or gedit to edit a config file)...read more on all that here:

    http://tinyurl.com/593e4c
    http://tinyurl.com/ydbwssh
    http://tinyurl.com/4nsaqst
    http://tinyurl.com/665h5ek
    http://www.linfo.org/root.html
    http://tinyurl.com/6ry6yd

    additionally: after logging into KDE/Gnome/etc as root, if you
    experience problems (for example, with uncommanded file ownership and
    permissions changes) and if you can provide us with details of what you
    were doing while you were logged in as root, that would help us identify
    if there's a bug that needs to be fixed...thanks for your help..

    --
    dd http://tinyurl.com/DD-Caveat

  10. #10
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How do I set correct permissions permanently for my 2nd internalHDD?

    On 2012-12-10 08:56, JopSway wrote:
    > I normally put dmask=0002 in mount options. That works fine.


    That works for fat, for ext4 that option is ignored or gives error.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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