Announcement

Collapse
No announcement yet.

Can't write to 2nd HDD - mount problem?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • InsideJob
    replied
    chmod 777 the root dir. Every time I change an external drive from FAT32 to EXT4 this happens. It's stoopid but the Linux gurus have declared it normal so tuff shiat to all the users who hate it.

    Leave a comment:


  • kubicle
    replied
    Originally posted by oshunluvr View Post
    adding UID/GID settings to fstab
    That doesn't work on posix filesystems like ext2-4, only on non-posix filesystem like fat or ntfs.

    Posix filesystems store ownership/permissions on the filesystem itself and you can't change that from fstab.

    Basically, when you create a posix filesystem it set's the default root_owner, and it will stay that way until you change that with chown (mount options are irrelevant). If you create the filesystem from the cli, you can set the root_owner option to what you like (see 'man mke2fs').

    Of course you can always change the ownerships/permissions of the filesystem post creation with chmod/chown.

    Leave a comment:


  • oshunluvr
    replied
    Other solutions are:

    * leaving ownership correct (root:root) and setting the root folder to 755
    * adding UID/GID settings to fstab

    there's more....
    All depends on what you want to do. This is Linux after all so there's lot's of choices

    Leave a comment:


  • oshunluvr
    replied
    That's obviously what it was, but why? Is that normally/always the case for everything you mount in fstab?
    Yes.

    Because then the whole root file system, including home would be owned by root...
    Yes, but not to the exclusion of everyone else getting in, so in a way - No.

    As long as your user has r_x access (read and execute, or when a directory - list and access) you can navigate a access anything under the root directory regardless of ownership. The default umask is 0022, thus giving all folders and mounts drwxr_xr_x. What happens below that is up in the air.

    Example: @here;

    Code:
    ls -l / |grep home
    returns

    drwxr-xr-x 1 root root 48 Jan 25 16:21 home
    whereas

    Code:
    ls -l /home
    returns

    drwxr-xr-x 1 lily lily 498 May 29 2014 lily
    drwxr-xr-x 1 lisa lisa 480 Jun 20 2014 lisa
    drwxr-xr-x 1 stuart stuart 1866 Feb 3 17:24 stuart
    Thus, although I (stuart) do not own /home, I can navigate and "'read" (list) what's in it. Therefore, I can also read and navigate all those folders. Although, because it is drwxr_xr_x, I can list/navigate lisa and lily, I cannot modify or delete anything in there. A more secure system might have 0002 as a default umask, thus allowing only the owner to navigate a folder.

    None of this explains what happened in your case - I am just offering a small rebuttal to your last comment.
    Last edited by oshunluvr; Feb 03, 2015, 10:56 PM.

    Leave a comment:


  • vinnywright
    replied
    Originally posted by bennypr0fane View Post
    That's obviously what it was, but why? Is that normally/always the case for everything you mount in fstab? Because then the whole root file system, including home would be owned by root...
    it is ,,,,,,,,,,,,you only own /home/you and everything inside/below "you" /home is owned by root.

    VINNY

    Leave a comment:


  • bennypr0fane
    replied
    Originally posted by vinnywright View Post
    post

    Code:
    ls -l /media
    you prob. do not have permission to write to it

    VINNY
    That's obviously what it was, but why? Is that normally/always the case for everything you mount in fstab? Because then the whole root file system, including home would be owned by root...

    Leave a comment:


  • vinnywright
    replied
    post

    Code:
    ls -l /media
    you prob. do not have permission to write to it

    VINNY

    Leave a comment:


  • bennypr0fane
    replied
    Ok, I may have answered my own question by using that permissions tag.
    Turns out /media/LinuxData was owned by ben:ben (my user), whereas /media/BackupRed was owned by root:root
    I did:
    sudo chown -R ben:ben /media/BackupRed
    and now it's good.
    What's missing is an explanation - why wasn' it the same for LinuxData?
    Sure, the mount point was created with sudo, but so must anything else under the root file tree.

    Leave a comment:


  • bennypr0fane
    started a topic Can't write to 2nd HDD - mount problem?

    Can't write to 2nd HDD - mount problem?

    Hi, I have two HDDs mounted in fstab only for user data - one works fine, the other is read-only for reasons I don't understand.
    Here's my /etc/fstab file:
    Code:
    # <file system> <mount point>   <type>  <options>       <dump>  <pass>
    # / was on /dev/sdb7 during installation
    UUID=584284b9-8257-42b6-b156-17f6f2011eca /               ext4    errors=remount-ro 0       1
    # swap was on /dev/sda6 during installation
    UUID=8f557d20-e7e6-44ac-9138-3f4fefe65dad none            swap    sw              0       0
    # LinuxData /dev/sda2
    LABEL=LinuxData                     /media/LinuxData            ext4      defaults       0        2
    # BackupRed /dev/sdb1
    LABEL=BackupRed   /media/BackupRed ext4  defaults  0  2
    LinuxData is fine, BackupRed can't be written to, although it's mounted the same as LinuxData.
    their respective lines of output for mount -l look the same too:
    Code:
    /dev/sdb1 on /media/BackupRed type ext4 (rw) [BackupRed]
    /dev/sdc2 on /media/LinuxData type ext4 (rw) [LinuxData]
    What I want is for both to be mounted an writable at boot.
    Last edited by bennypr0fane; Feb 03, 2015, 04:38 PM.

Users Viewing This Topic

Collapse

There are 0 users viewing this topic.

Working...
X