Filesystem mounted as root but owned by user. Why?
Clash Royale CLAN TAG#URR8PPP
up vote
8
down vote
favorite
I'm mounting a filesystem as root
and I don't understand why it is not owned by root
but by an unprivileged user.
Here's fstab:
cat /etc/fstab
[...]
/dev/sdb /mnt/projects ext4 defaults 0 2
And here's what happens when mounting:
ls -al /mnt/projects/
total 8
drwxr-xr-x 2 root root 4096 mai 25 17:55 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
mount /dev/sdb
ls -al /mnt/projects/
total 24
drwx------ 3 jerome jerome 4096 mai 25 17:52 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
drwx------ 2 root root 16384 mai 25 17:52 lost+found
I'm not using sudo
. I switch to root
user with the su
command.
The user that gains ownership is my normal user, the first declared when installing the system (uid: 1000).
The mount point is owned by root. I don't think that matters anyway.
My normal user doesn't have the permissions to mount the filesystem here himself.
mount ownership
add a comment |Â
up vote
8
down vote
favorite
I'm mounting a filesystem as root
and I don't understand why it is not owned by root
but by an unprivileged user.
Here's fstab:
cat /etc/fstab
[...]
/dev/sdb /mnt/projects ext4 defaults 0 2
And here's what happens when mounting:
ls -al /mnt/projects/
total 8
drwxr-xr-x 2 root root 4096 mai 25 17:55 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
mount /dev/sdb
ls -al /mnt/projects/
total 24
drwx------ 3 jerome jerome 4096 mai 25 17:52 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
drwx------ 2 root root 16384 mai 25 17:52 lost+found
I'm not using sudo
. I switch to root
user with the su
command.
The user that gains ownership is my normal user, the first declared when installing the system (uid: 1000).
The mount point is owned by root. I don't think that matters anyway.
My normal user doesn't have the permissions to mount the filesystem here himself.
mount ownership
add a comment |Â
up vote
8
down vote
favorite
up vote
8
down vote
favorite
I'm mounting a filesystem as root
and I don't understand why it is not owned by root
but by an unprivileged user.
Here's fstab:
cat /etc/fstab
[...]
/dev/sdb /mnt/projects ext4 defaults 0 2
And here's what happens when mounting:
ls -al /mnt/projects/
total 8
drwxr-xr-x 2 root root 4096 mai 25 17:55 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
mount /dev/sdb
ls -al /mnt/projects/
total 24
drwx------ 3 jerome jerome 4096 mai 25 17:52 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
drwx------ 2 root root 16384 mai 25 17:52 lost+found
I'm not using sudo
. I switch to root
user with the su
command.
The user that gains ownership is my normal user, the first declared when installing the system (uid: 1000).
The mount point is owned by root. I don't think that matters anyway.
My normal user doesn't have the permissions to mount the filesystem here himself.
mount ownership
I'm mounting a filesystem as root
and I don't understand why it is not owned by root
but by an unprivileged user.
Here's fstab:
cat /etc/fstab
[...]
/dev/sdb /mnt/projects ext4 defaults 0 2
And here's what happens when mounting:
ls -al /mnt/projects/
total 8
drwxr-xr-x 2 root root 4096 mai 25 17:55 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
mount /dev/sdb
ls -al /mnt/projects/
total 24
drwx------ 3 jerome jerome 4096 mai 25 17:52 .
drwxr-xr-x 3 root root 4096 mai 25 17:55 ..
drwx------ 2 root root 16384 mai 25 17:52 lost+found
I'm not using sudo
. I switch to root
user with the su
command.
The user that gains ownership is my normal user, the first declared when installing the system (uid: 1000).
The mount point is owned by root. I don't think that matters anyway.
My normal user doesn't have the permissions to mount the filesystem here himself.
mount ownership
asked May 28 at 7:31
Jérôme
7812728
7812728
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
22
down vote
accepted
This means that the file system being mounted contains a root directory owned by user 1000 and group 1000. The ownership of a mounted file systemâÂÂs root directory becomes the ownership of the mount point.
1
I suppose this is because I created the partition usinggnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.
â Jérôme
May 28 at 8:22
3
@Jérôme The owner of the root of a file system can be changed withchown
just like any other directory.
â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it wasjerome
and notroot
in the first place since I thought I did everything asroot
.
â Jérôme
May 28 at 10:29
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
22
down vote
accepted
This means that the file system being mounted contains a root directory owned by user 1000 and group 1000. The ownership of a mounted file systemâÂÂs root directory becomes the ownership of the mount point.
1
I suppose this is because I created the partition usinggnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.
â Jérôme
May 28 at 8:22
3
@Jérôme The owner of the root of a file system can be changed withchown
just like any other directory.
â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it wasjerome
and notroot
in the first place since I thought I did everything asroot
.
â Jérôme
May 28 at 10:29
add a comment |Â
up vote
22
down vote
accepted
This means that the file system being mounted contains a root directory owned by user 1000 and group 1000. The ownership of a mounted file systemâÂÂs root directory becomes the ownership of the mount point.
1
I suppose this is because I created the partition usinggnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.
â Jérôme
May 28 at 8:22
3
@Jérôme The owner of the root of a file system can be changed withchown
just like any other directory.
â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it wasjerome
and notroot
in the first place since I thought I did everything asroot
.
â Jérôme
May 28 at 10:29
add a comment |Â
up vote
22
down vote
accepted
up vote
22
down vote
accepted
This means that the file system being mounted contains a root directory owned by user 1000 and group 1000. The ownership of a mounted file systemâÂÂs root directory becomes the ownership of the mount point.
This means that the file system being mounted contains a root directory owned by user 1000 and group 1000. The ownership of a mounted file systemâÂÂs root directory becomes the ownership of the mount point.
answered May 28 at 7:45
Stephen Kitt
140k22302363
140k22302363
1
I suppose this is because I created the partition usinggnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.
â Jérôme
May 28 at 8:22
3
@Jérôme The owner of the root of a file system can be changed withchown
just like any other directory.
â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it wasjerome
and notroot
in the first place since I thought I did everything asroot
.
â Jérôme
May 28 at 10:29
add a comment |Â
1
I suppose this is because I created the partition usinggnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.
â Jérôme
May 28 at 8:22
3
@Jérôme The owner of the root of a file system can be changed withchown
just like any other directory.
â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it wasjerome
and notroot
in the first place since I thought I did everything asroot
.
â Jérôme
May 28 at 10:29
1
1
I suppose this is because I created the partition using
gnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.â Jérôme
May 28 at 8:22
I suppose this is because I created the partition using
gnome-disks
as unprivileged user. But there is nothing in that GUI informing me about it.â Jérôme
May 28 at 8:22
3
3
@Jérôme The owner of the root of a file system can be changed with
chown
just like any other directory.â kasperd
May 28 at 10:21
@Jérôme The owner of the root of a file system can be changed with
chown
just like any other directory.â kasperd
May 28 at 10:21
OK @kasperd. I was just surprised it was
jerome
and not root
in the first place since I thought I did everything as root
.â Jérôme
May 28 at 10:29
OK @kasperd. I was just surprised it was
jerome
and not root
in the first place since I thought I did everything as root
.â Jérôme
May 28 at 10:29
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f446423%2ffilesystem-mounted-as-root-but-owned-by-user-why%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password