LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-13-2021, 02:41 AM   #1
merc718
LQ Newbie
 
Registered: Jan 2021
Posts: 11

Rep: Reputation: Disabled
mounting/change permission of partition


I set up a partition/ext4 of a nvme. Even though it shows as mounted, i dont think its actually mounted. I have
Code:
sudo mount /dev/nvme1n1p1 /mnt/data
] and i check
Code:
 lsblk -f
and it shows as mounted. Whatever files i write to in /mnt/data it remains whether or not the m.2 is mounted or not.

I also tired to change permissions to the partition with
Code:
sudo chmod 777 /dev/disk/by-uuid/e9a483d3-2923-4e48-818c-4738a9151414
, but it doesnt work. i still have to sudo my cmds.

thanks in advance.

Quote:
nvme1n1: nvme1n1p1 ext4 1.0 data e9a483d3-2923-4e48-818c-4738a9151414 890.1G 0% /mnt/data
Quote:
Disk /dev/nvme1n1: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: PCIe SSD
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xac5f3c30

Device Boot Start End Sectors Size Id Type
/dev/nvme1n1p1 2048 2000409263 2000407216 953.9G 83 Linux

Last edited by merc718; 02-13-2021 at 02:45 AM.
 
Old 02-13-2021, 02:57 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,878
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078
Quote:
Originally Posted by merc718 View Post
I set up a partition/ext4 of a nvme. Even though it shows as mounted, i dont think its actually mounted. I have
Code:
sudo mount /dev/nvme1n1p1 /mnt/data
] and i check
Code:
 lsblk -f
and it shows as mounted. Whatever files i write to in /mnt/data it remains whether or not the m.2 is mounted or not.
Use df or df -h to see what's mounted where, and space consumed and used. You should there be able to notice changes when you add or remove files.

For an internal device, such as nvme, it's usually best to mount via an fstab entry. If you don't wish it mounted always, use a noauto option in the fstab entry. Mounting and unmounting can then be done with a simpler command, and with greater reliability.

Quote:
I also tired to change permissions to the partition with
Code:
sudo chmod 777 /dev/disk/by-uuid/e9a483d3-2923-4e48-818c-4738a9151414
, but it doesnt work. i still have to sudo my cmds.
Changing permissions one does to directories or regular files, not device files. So, you would apply the command to /mnt/data/, not /dev/disk/by-uuid/yada...
 
Old 02-13-2021, 03:03 AM   #3
merc718
LQ Newbie
 
Registered: Jan 2021
Posts: 11

Original Poster
Rep: Reputation: Disabled
Does it matter if its mounted or not when I change permissions to the folder?
 
Old 02-13-2021, 03:23 AM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,878
Blog Entries: 1

Rep: Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078Reputation: 2078
Why not try chmod while unmounted, then mount, then give it a try?
 
Old 02-13-2021, 11:15 AM   #5
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Code:
/dev/nvme1n1p1	/mnt/data	ext4	defaults,uid=1000,gid=1000,umask=022	0 1
The above code is an example of the entry you could put in /etc/fstab, as already mentioned, you can add "noauto" to the options highlighted in blue so it is not auto-mounted upon bootup.
To mount manually with user read/write access, mount with the same options as in the example below. This assumes your user UID and GID are 1000 which is the typical ID values for first user created:
Code:
sudo mount -o defaults,uid=1000,gid=1000,umask=022 /dev/nvme1n1p1 /mnt/data
Umask example/meaning
 
Old 02-13-2021, 11:55 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,784

Rep: Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937Reputation: 5937
FYI:
uid, gid and umask mount options only apply to filesystems that do not support native linux permissions like FAT and NTFS. They are not valid options for ext filesystems.

What mrmazda is trying to explain (I believe) is that permissions apply to the filesystem not the mount point.
 
Old 02-13-2021, 12:01 PM   #7
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
Quote:
Originally Posted by michaelk View Post
FYI:
uid, gid and umask mount options only apply to filesystems that do not support native linux permissions like FAT and NTFS. They are not valid options for ext filesystems.
Good, didn't know that, TX.
EDIT: I do remember fighting with this in the past also, gave up and just expanded the / filesystem.

Last edited by Brains; 02-13-2021 at 12:04 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware 14.2 changes permission when mounting NTFS partition aparicio Slackware 6 04-18-2017 07:32 AM
Samba: Permission denied only when mounting fuse partition iternity Linux - Server 0 06-08-2011 07:56 AM
change permission of a ntfs partition mandrakeBren Linux - Newbie 7 02-16-2009 11:16 PM
Need ACCESS to change files! Every time I try to change a setting,"Permission Denied" Balarabay1 SUSE / openSUSE 2 03-06-2006 09:54 AM
Mounting mounting extended partition and its Logical drives desbyleo Linux - Newbie 10 02-18-2002 03:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration