Results 1 to 3 of 3

Thread: drive partition mounted as root

  1. #1
    Join Date
    Feb 2015
    Beans
    6

    drive partition mounted as root

    I have two laptop running Ubuntu 14.10. Both of these have a directory /media/Data
    Code:
    drwxr-xr-x 2 root root 4096 Feb 19 16:36 /media/Data/    #before mounting
    The following entry exits in /etc/fstab of both the laptops
    Code:
    UUID=XXXXXXXXXXXXXXXXXXXXXX /media/Data ext4 defaults 0 0
    However, after boot up, one of the laptop mounts the drive as root user and in the other it mounts as the logged-in user(with sudo powers)
    Code:
    drwxr-xr-x 3 root root 4096 Feb 18 00:32 /media/Data/       # laptop 1
    drwxr-xr-x 3 user user 4096 Feb 18 00:32 /media/Data/       # laptop 2
    1. Why the difference?
    2. How can I get the drive mounted as logged in user?
    Last edited by mohan-kiran; February 19th, 2015 at 01:58 PM.

  2. #2
    Join Date
    Dec 2009
    Beans
    6,772

    Re: drive partition mounted as root

    [1] The permissions of the mount point before a partition is mounted has no affect on the permissions of the mounted partition.

    [2] On this laptop:
    drwxr-xr-x 3 root root 4096 Feb 18 00:32 /media/Data/ # laptop 1
    Change ownership to user:user:
    Code:
    sudo chown user:user /media/Data
    But remember to only do this after the partition has been mounted.

    [3] Why are they different:

    My guess is that somewhere along the line you already did the chown command on laptop2. If you were to rip out that drive on laptop2 and send it to me it would still be owned by user:user since ownership and permissions are embedded within the partition itself.

  3. #3
    Join Date
    Feb 2015
    Beans
    6

    Re: drive partition mounted as root

    Thanks Morbius1.
    You are right.

Tags for this Thread

Bookmarks

Posting Permissions

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