[SOLVED] NTFS Bad Permissions on Partition
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
[SOLVED] NTFS Bad Permissions on Partition
Earlier tonight I realized that my main/boot partition (sda5) ran out of space. So, I moved the data on sda6 temporarily and deleted the sda6 partition to make room for sda5 to expand. I expanded sda5 with gparted and then created sda6 as NTFS using "Disks" which comes stock with Linux Mint. Then, I re-created a smaller sda6 and updated grub and fstab, though not correctly at first. I managed to get back into my system after a while (booting from and into sda5).
But then, I downloaded hplip stuff to my NTFS partition on sda6 which is mounted to /data.
And realized I was having weirdness.
Problem is, the permissions are all messed up--and for sub-directories as well. I'd like this to always be available to my normal permissions user "wmeler." I am the only person using this laptop. I want it as NTFS so I can access the directory in Windows as this is a Dual Boot laptop.
Here's what the permissions look like:
wmeler@wander:/$ ls -al /data
total 9
drwxrwx--- 1 root plugdev 4096 Dec 2 22:45 .
drwxr-xr-x 22 root root 4096 Dec 2 22:43 ..
drwxrwx--- 1 root plugdev 512 Dec 2 23:25 downloads
Here's a bit more on how the partition is being mounted in case it matters:
wmeler@wander:/etc/default$ sudo blkid
/dev/sda2: LABEL="Windows" BLOCK_SIZE="512" UUID="B0FC6032FC5FF0D8" TYPE="ntfs" PARTUUID="d4f04c7f-02"
/dev/sda5: UUID="bb9e4ab8-b91b-4bd9-8198-6015ab08c02e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d4f04c7f-05"
/dev/sda3: LABEL="HP_RECOVERY" BLOCK_SIZE="512" UUID="A6CE00F0CE00BA97" TYPE="ntfs" PARTUUID="d4f04c7f-03"
/dev/sda1: LABEL="SYSTEM" BLOCK_SIZE="512" UUID="7CB2E8C8B2E887CA" TYPE="ntfs" PARTUUID="d4f04c7f-01"
/dev/sda6: LABEL="DATA" BLOCK_SIZE="512" UUID="06EA83ED2E587A8B" TYPE="ntfs" PARTUUID="d4f04c7f-06"
wmeler@wander:/etc$ cat fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=bb9e4ab8-b91b-4bd9-8198-6015ab08c02e / ext4 errors=remount-ro 0 1
# /data was on /dev/sda6 during installation
UUID=06EA83ED2E587A8B /data ntfs defaults,umask=007,gid=46 0 0
# /windows was on /dev/sda2 during installation
UUID=B0FC6032FC5FF0D8 /windows ntfs defaults,umask=007,gid=46 0 0
/swapfile none swap sw 0 0
But then, I downloaded hplip stuff to my NTFS partition on sda6 which is mounted to /data.
And realized I was having weirdness.
Problem is, the permissions are all messed up--and for sub-directories as well. I'd like this to always be available to my normal permissions user "wmeler." I am the only person using this laptop. I want it as NTFS so I can access the directory in Windows as this is a Dual Boot laptop.
Here's what the permissions look like:
wmeler@wander:/$ ls -al /data
total 9
drwxrwx--- 1 root plugdev 4096 Dec 2 22:45 .
drwxr-xr-x 22 root root 4096 Dec 2 22:43 ..
drwxrwx--- 1 root plugdev 512 Dec 2 23:25 downloads
Here's a bit more on how the partition is being mounted in case it matters:
wmeler@wander:/etc/default$ sudo blkid
/dev/sda2: LABEL="Windows" BLOCK_SIZE="512" UUID="B0FC6032FC5FF0D8" TYPE="ntfs" PARTUUID="d4f04c7f-02"
/dev/sda5: UUID="bb9e4ab8-b91b-4bd9-8198-6015ab08c02e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="d4f04c7f-05"
/dev/sda3: LABEL="HP_RECOVERY" BLOCK_SIZE="512" UUID="A6CE00F0CE00BA97" TYPE="ntfs" PARTUUID="d4f04c7f-03"
/dev/sda1: LABEL="SYSTEM" BLOCK_SIZE="512" UUID="7CB2E8C8B2E887CA" TYPE="ntfs" PARTUUID="d4f04c7f-01"
/dev/sda6: LABEL="DATA" BLOCK_SIZE="512" UUID="06EA83ED2E587A8B" TYPE="ntfs" PARTUUID="d4f04c7f-06"
wmeler@wander:/etc$ cat fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=bb9e4ab8-b91b-4bd9-8198-6015ab08c02e / ext4 errors=remount-ro 0 1
# /data was on /dev/sda6 during installation
UUID=06EA83ED2E587A8B /data ntfs defaults,umask=007,gid=46 0 0
# /windows was on /dev/sda2 during installation
UUID=B0FC6032FC5FF0D8 /windows ntfs defaults,umask=007,gid=46 0 0
/swapfile none swap sw 0 0
Last edited by LockBot on Sat Jun 03, 2023 10:00 pm, edited 5 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: NTFS Bad Permissions on Partition
Your issue is not with Linux, but with Windows.
You need to stop Fast Startup/Hibernation working in Windows - Google will will you how.
It leaves the disk in a state that does not allow Linux to do any alterations to it.
If disabling Fast Startup/Hibernation is something that you do not want to do, for some reason, then ejecting the disk from Windows before you shut Windows down will also work..
You need to stop Fast Startup/Hibernation working in Windows - Google will will you how.
It leaves the disk in a state that does not allow Linux to do any alterations to it.
If disabling Fast Startup/Hibernation is something that you do not want to do, for some reason, then ejecting the disk from Windows before you shut Windows down will also work..
Re: NTFS Bad Permissions on Partition
Thank you for the rapid response. I'm not saying you're not right--you may be. But can you convince me a bit? Here's why I ask:
Earlier tonight I realized that my main/boot partition (sda5) ran out of space. So, I moved the data on sda6 temporarily and deleted the sda6 partition to make room for sda5 to expand. I did so. Then, I re-created a smaller sda6 and updated grub and fstab, though not correctly at first. I managed to get back into my system just fine (booting from and into sda5).
But then, I downloaded hplip stuff to my data partition. And realized I was having weirdness.
Never had this before.
So, again, I am not sure why this would be a Windows problem when I've never had it before and did not use Windows before my problems earlier tonight....?
UPDATE:
I went into Windows 10 to try your solution, nonetheless.
That said, I couldn't disable it, because I don't have administrative permissions in Windows.
Earlier tonight I realized that my main/boot partition (sda5) ran out of space. So, I moved the data on sda6 temporarily and deleted the sda6 partition to make room for sda5 to expand. I did so. Then, I re-created a smaller sda6 and updated grub and fstab, though not correctly at first. I managed to get back into my system just fine (booting from and into sda5).
But then, I downloaded hplip stuff to my data partition. And realized I was having weirdness.
Never had this before.
So, again, I am not sure why this would be a Windows problem when I've never had it before and did not use Windows before my problems earlier tonight....?
UPDATE:
I went into Windows 10 to try your solution, nonetheless.
That said, I couldn't disable it, because I don't have administrative permissions in Windows.
Last edited by wmeler on Sat Dec 03, 2022 2:24 am, edited 2 times in total.
Re: NTFS Bad Permissions on Partition
Ah....
What did you use to create the partitions? - GParted?
Are you sure that sda6 is formatted to NTFS??
A GParted picture of your disk might be useful..
What did you use to create the partitions? - GParted?
Are you sure that sda6 is formatted to NTFS??
A GParted picture of your disk might be useful..
Re: NTFS Bad Permissions on Partition
I will do post a picture of my disk from Disks, but you can see from my original post that it is NTFS indeed.
Look under what I posted for "sudo blkid".
It's in boldface.
Look under what I posted for "sudo blkid".
It's in boldface.
Last edited by wmeler on Sat Dec 03, 2022 2:30 am, edited 1 time in total.
Re: NTFS Bad Permissions on Partition
And actually, I extended sda5 (my boot/main partition) with gparted, but created sda6 within the Disks app that comes stock with LM21.
Last edited by wmeler on Sat Dec 03, 2022 2:37 am, edited 1 time in total.
Re: NTFS Bad Permissions on Partition
Here's sda6. NTFS.
Re: NTFS Bad Permissions on Partition
Yeah, from your previous output it looks like your sda6/Data is owned by root, rather than you.
I am puzzled as to how that happened. It automatically happens when formatting a partition to ext4 with GParted, but you neither used GParted nor formatted to ext4..
Anyway, the usual route to claim back ownership of a partition from root back to the user is:
Obviously replacing YOURUSERNAME & LOCATIONOFDRIVE with the real thing.
then try running
again to make sure that you are now the owner..
I am puzzled as to how that happened. It automatically happens when formatting a partition to ext4 with GParted, but you neither used GParted nor formatted to ext4..
Anyway, the usual route to claim back ownership of a partition from root back to the user is:
Code: Select all
sudo chown -Rc YOURUSERNAME:YOURUSERNAME /LOCATIONOFDRIVE
Obviously replacing YOURUSERNAME & LOCATIONOFDRIVE with the real thing.
then try running
Code: Select all
ls -al /data
Re: NTFS Bad Permissions on Partition
FWIW, I have three computers with NTFS data partitions shared with Windows.
Be that as it may, if you are the only user, something like this (with no permission restrictions) should work fine:
You want that last parameter to assure any file names assigned in Linux are Windows compatible. Whether to use ntfs or ntfs-3g is a matter of debate. Both work, but I've concluded the latter is better. If you want to stay with what you've been using, that would be fine also.
Running chown on an NTFS partition doesn't accomplish anything. What will make you appear as owner are the uid and gid parameters.
Where did those parameters come from? Were they assigned by the installer automatically? Or did you supply them?
Be that as it may, if you are the only user, something like this (with no permission restrictions) should work fine:
Code: Select all
UUID=06EA83ED2E587A8B /data ntfs-3g defaults,uid=1000,gid=1000,windows-names 0 0
Running chown on an NTFS partition doesn't accomplish anything. What will make you appear as owner are the uid and gid parameters.
Re: NTFS Bad Permissions on Partition
Already tried that earlier. Tried again. When I run the command, it looks like the permissions change, but they don't. (See ls -al below)
wmeler@wander:/data$ sudo chown -Rc wmeler:wmeler /data
[sudo] password for wmeler:
changed ownership of '/data/$RECYCLE.BIN/S-1-5-21-3645783575-1546664496-3157300502-1151/desktop.ini' from root:plugdev to wmeler:wmeler
changed ownership of '/data/$RECYCLE.BIN/S-1-5-21-3645783575-1546664496-3157300502-1151' from root:plugdev to wmeler:wmeler
changed ownership of '/data/$RECYCLE.BIN' from root:plugdev to wmeler:wmeler
changed ownership of '/data/downloads/hplip-3.22.10/Dat2drv.h' from root:plugdev to wmeler:wmeler
wmeler@wander:/data$ ls -al
total 16
drwxrwx--- 1 root plugdev 4096 Dec 3 00:14 .
drwxr-xr-x 22 root root 4096 Dec 2 22:43 ..
drwxrwx--- 1 root plugdev 0 Dec 3 00:14 '$RECYCLE.BIN'
drwxrwx--- 1 root plugdev 4096 Dec 3 00:38 downloads
drwxrwx--- 1 root plugdev 4096 Dec 3 00:08 'System Volume Information'
(Thanks for your help. I have to go to bed, but will respond tomorrow.)
wmeler@wander:/data$ sudo chown -Rc wmeler:wmeler /data
[sudo] password for wmeler:
changed ownership of '/data/$RECYCLE.BIN/S-1-5-21-3645783575-1546664496-3157300502-1151/desktop.ini' from root:plugdev to wmeler:wmeler
changed ownership of '/data/$RECYCLE.BIN/S-1-5-21-3645783575-1546664496-3157300502-1151' from root:plugdev to wmeler:wmeler
changed ownership of '/data/$RECYCLE.BIN' from root:plugdev to wmeler:wmeler
changed ownership of '/data/downloads/hplip-3.22.10/Dat2drv.h' from root:plugdev to wmeler:wmeler
wmeler@wander:/data$ ls -al
total 16
drwxrwx--- 1 root plugdev 4096 Dec 3 00:14 .
drwxr-xr-x 22 root root 4096 Dec 2 22:43 ..
drwxrwx--- 1 root plugdev 0 Dec 3 00:14 '$RECYCLE.BIN'
drwxrwx--- 1 root plugdev 4096 Dec 3 00:38 downloads
drwxrwx--- 1 root plugdev 4096 Dec 3 00:08 'System Volume Information'
(Thanks for your help. I have to go to bed, but will respond tomorrow.)
Re: NTFS Bad Permissions on Partition
Did you do what linux-rox suggested:
Change the mount paramters in /etc/fstab to:
Then remount:
Side note:
That is exactly how the installer would mount an ntfs partition if you ask it to automount.
For a single user system it's not really an issue since by default the first user specified in an install is automatically made a member of the plugdev group ( gid=46 ).
Code: Select all
sudo umount /data
Code: Select all
UUID=06EA83ED2E587A8B /data ntfs-3g defaults,uid=1000,gid=1000,windows-names 0 0
Code: Select all
sudo mount -a
UUID=06EA83ED2E587A8B /data ntfs defaults,umask=007,gid=46 0 0
That is exactly how the installer would mount an ntfs partition if you ask it to automount.
For a single user system it's not really an issue since by default the first user specified in an install is automatically made a member of the plugdev group ( gid=46 ).
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
[SOLVED] NTFS Bad Permissions on Partition
Thank you, linux-rox and altair4. You were both absolutely right about that fixing the issue.
I learned a lot too in about 3 seconds, so very helpful.
Out of curiousity, in the future, if I play manually make some changes to my partitions using Disks or gparted, how do I automatically update /etc/fstab appropriately? Or should I just manually change it like you suggested? (Would prefer to not do the latter as it's open to user/my error.)
Thanks again. Very helpful.
Also, for future reference for others who see this, the following may also help somehow. It did for me:
viewtopic.php?f=46&t=386552
I learned a lot too in about 3 seconds, so very helpful.
Out of curiousity, in the future, if I play manually make some changes to my partitions using Disks or gparted, how do I automatically update /etc/fstab appropriately? Or should I just manually change it like you suggested? (Would prefer to not do the latter as it's open to user/my error.)
Thanks again. Very helpful.
Also, for future reference for others who see this, the following may also help somehow. It did for me:
viewtopic.php?f=46&t=386552
Re: [SOLVED] NTFS Bad Permissions on Partition
Congratulations, glad it worked out.
Meanwhile, if you take the time to learn fstab (and Grub) well enough to know whether the GUI apps are taking you to the right place, it's easier and faster to make the changes yourself. One important precaution. Always make a backup of fstab before editing, so you can unwind or do over if necessary. And bear in mind, if the modification goes sideways, you always can edit the file from a live session. That's your fallback.
IMHO, editing fstab is one of two common problems (boot repair is the other) where the GUI solutions are more work than doing it yourself manually. In defense of the developers of both apps, these are complex problems, so it's not possible to write a comprehensive script which covers all scenarios. For the apps to be usable, the devs have to simplify, cover the most common cases, and settle for the apps working most of the time.wmeler wrote: ⤴Sun Dec 04, 2022 1:09 am Out of curiousity, in the future, if I play manually make some changes to my partitions using Disks or gparted, how do I automatically update /etc/fstab appropriately? Or should I just manually change it like you suggested? (Would prefer to not do the latter as it's open to user/my error.)
Meanwhile, if you take the time to learn fstab (and Grub) well enough to know whether the GUI apps are taking you to the right place, it's easier and faster to make the changes yourself. One important precaution. Always make a backup of fstab before editing, so you can unwind or do over if necessary. And bear in mind, if the modification goes sideways, you always can edit the file from a live session. That's your fallback.