Need /mnt/home to mount so that 'user' can access it

Discussion in 'Linux' started by ktheintz, Jun 17, 2009.

  1. ktheintz

    ktheintz

    Joined:
    Sep 5, 2008
    Messages:
    3
    Likes Received:
    0
    I understand that /mnt/home is a virtual directory created by the file /etc/aufs.act, and merges the /home/user directory from the ssd with the /media/disk-1 directory, which is how the sd card in the storage expansion slot (left) is mounted. Mine is a 4GB SDHC, with the HP brand. It is formatted ext2.

    But both /media/disk-1 and /mnt/home have root as the user and group, and 755 as the permissions, so if I try to save anything to /mnt/home (and thus use the nifty storage expansion feature), I don't have permission. What I would like to do is to change those settings so that (1) 'user' is the user and the group or (2) 777 is the permission, or both. My understanding is that the mounting options are set by /etc/mtab, but that file is generated by the operating system, and so any changes are lost every time I reboot.

    Here's the contents of my /etc/mtab (with the sdhc card inserted; it changes when the card is removed, so guessing udev does something to it):

    Code:
    /dev/sda1 / ext2 rw 0 0
    none /dev/pts devpts rw,gid=5,mode=620 0 0
    none /dev/shm tmpfs rw 0 0
    none /sys sysfs rw 0 0
    none /mnt/home aufs rw,si=d56a0880,xino=/home/user/.aufs.xino,dirs=/tmp/posixdir=rw:/home/user=rw 0 0
    /dev/mmcblk0 /media/disk-1 ext2 rw,nosuid,nodev,uhelper=hal 0 0
    posix-overlay(/media/disk-1) /tmp/posixdir fuse.posixovl rw,nosuid,default_permissions,allow_other 0 0
    
    That last line about posix-overlay is possibly a clue, as why does an ext2 filesystem need a posix overlay?

    Finally, simply typing
    Code:
    sudo chmod -R 777 /mnt/home
    does everything I need it to do. But I shouldn't have to type that every time I reboot, and hence die a little every time I have to resort to it.
     
    ktheintz, Jun 17, 2009
    #1
  2. ktheintz

    solpuerto

    Joined:
    Oct 27, 2008
    Messages:
    268
    Likes Received:
    0
    Location:
    UK
    Hi ktheintz

    I do not have your problem with permissions to the folders you identify.

    Have you tried opening File Manager, RH mouse click on Home (/mnt/home) and select Properties then Permissions.
    When I do, this is what I see,
    [attachment=0:1672kqmu]homepermissions.png[/attachment:1672kqmu]
    If I do the same with SD/MMC Drive (/media/disk) I get the same permissions.

    Are you saying that under Owner User the Access is shown as Root?
    Not clear what you mean by 755 as permissions?

    I formatted my SD card as Fat32 on my XP PC and you will notice that lines 5 and 6 in the code in my etc/mtab are quite different from yours.

    Code:
    /dev/sda1 / ext2 rw 0 0
    none /dev/pts devpts rw,gid=5,mode=620 0 0
    none /dev/shm tmpfs rw 0 0
    none /sys sysfs rw 0 0
    none /mnt/home aufs rw,si=c1da4c80,xino=/home/user/.aufs.xino,dirs=/tmp/posixdir=rw:/home/user=rw 0 0
    /dev/mmcblk0p1 /media/disk vfat rw,nosuid,nodev,uhelper=hal,utf8,shortname=winnt,uid=500 0 0
    posix-overlay(/media/disk) /tmp/posixdir fuse.posixovl rw,nosuid,default_permissions,allow_other 0 0
    Not sure what the code means but hope it provides you with some help.

    With my SD card removed lines 6 and 7 are missing but the rest are the same as above.

    Best wishes
     
    solpuerto, Jun 18, 2009
    #2
  3. ktheintz

    elektricat

    Joined:
    Apr 16, 2009
    Messages:
    9
    Likes Received:
    0
    Location:
    Ireland
    You need to run "sudo thunar" to be able to edit permissions on files or directories, then just do as per the post above!
     
    elektricat, Jul 2, 2009
    #3
  4. ktheintz

    fweigel

    Joined:
    Oct 24, 2008
    Messages:
    118
    Likes Received:
    0
    Sorry for the late reply.

    The problem is that you formatted the sd card filesystem to "ext2". If you do that, then normal unix (linux) permissions apply.

    Specifically, the root of the filesystem is only writable by the root user. If a directory is created, its ownership can be changed to "user", allowing the normal file manager to write into that directory.

    To write into the root of the sd card, use "sudo thunar" as the command (alt-f2). Create the directories, and then right click on them, select "Properties" and set read/write permission for group and other. That should do it. You *could* use the "chown user:user directoryname" command in a terminal to change the owner of directory to user:user .

    Generally, you should probably use sd cards formatted as fat32 (as they come from the factory).
     
    fweigel, Aug 1, 2009
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.