Page 5 of 5
Re: Can't take ownership of exFAT HDD's as root
Posted: Sat Feb 16, 2019 3:45 pm
by Death
I formatted one of the drives back to exFAT to test the following suggestions..
jonetsu wrote:Instead of using mount with those options (or less as it works well with less) as root, simply use pmount as a simple user for your removable devices :
pmount /dev/sde1
And that's it. It will even create a mount point for you You have full read/write access as simple user.
I gather that Death wants it simple at the command line. Maybe to better enjoy Life ! pmount is exactly made for that.
pmount works great on Ubuntu systems. Should work also on Linux MInt systems. (DID NOT TRY IT)
I had to install pmount first and then ran the command for the specific drive. First it said the operation was permitted for root only so I ran it with sudo in front and it did indeed mount the drive. However, I was still unable to change ownership of the drive for the same reason as before. Seems this method might not work for my situation?
merlyn wrote:@Death Here's some commands that will change the ownership of your backup drive.
Because your drive was automatically mounted the mountpoint will probably disappear, so to be on the safe side make a new directory.
Check your user id is 1000.
Now the mount command. Replace device with your device. If id -u returned a number other than 1000, change uid=1000 and gid=1000 to the number you got.
Code: Select all
$ sudo mount -o rw,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2 device /mnt/backup
You may have to tell your backup program about the new location of the drive. Eventually you'll want this to be automatic when you plug the drive in. I'm sure you can figure that out. The bit that caused problems was uid=1000,gid=1000. If they aren't specified the default is the uid of the process doing the mounting, in this case 0 which is root.
EDIT: You must have posted while I was writing this. Stick with ext4 if that's working.
So I ran the commands and they all worked until the final one. Here was the result:
Code: Select all
~$ sudo mount -o rw,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2 device /mnt/usb-USB3.0_USB_Device_DB9876543211167-0:0-part1
mount: /mnt/usb-USB3.0_USB_Device_DB9876543211167-0:0-part1: special device device does not exist.
I did change the last section to the mountpoint for my drive, but for some reason it didn't work. It wouldn't mount the drive.
Btw, keeping the drives as ext4 is not really ideal in the long run. I need to use them on different systems with different OS's so exFAT is the best way to do that. I just needed a break from troubleshooting this situation for a couple days as I just wanted to work on some music
Edit: Btw, there was nothing in the mnt/backup folder. Not sure what exactly was supposed to happen there. Just thought I'd mention it.
Thanks for your help, guys. Really appreciate it!
Re: Can't take ownership of exFAT HDD's as root
Posted: Sat Feb 16, 2019 5:01 pm
by jonetsu
Death wrote: I had to install pmount first and then ran the command for the specific drive. First it said the operation was permitted for root only so I ran it with sudo in front and it did indeed mount the drive. However, I was still unable to change ownership of the drive for the same reason as before. Seems this method might not work for my situation?
It looks like it. Here's a complete run on Xubuntu 18.04 LTS.
Code: Select all
% whoami
mevla
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8021552 0 8021552 0% /dev
tmpfs 1610600 1628 1608972 1% /run
/dev/sdb1 76371728 25898676 46550468 36% /
tmpfs 8052996 138456 7914540 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8052996 0 8052996 0% /sys/fs/cgroup
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda7 201454560 187011128 4187048 98% /Share
tmpfs 1610596 12 1610584 1% /run/user/1000
% pmount /dev/sde1
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8021552 0 8021552 0% /dev
tmpfs 1610600 1628 1608972 1% /run
/dev/sdb1 76371728 25898676 46550468 36% /
tmpfs 8052996 138456 7914540 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8052996 0 8052996 0% /sys/fs/cgroup
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda7 201454560 187011128 4187048 98% /Share
tmpfs 1610596 12 1610584 1% /run/user/1000
/dev/sde1 2884120800 1119860196 1617732656 41% /media/sde1
% touch /media/sde1/test
% rm /media/sde1/test
% pumount /media/sde1/
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8021552 0 8021552 0% /dev
tmpfs 1610600 1628 1608972 1% /run
/dev/sdb1 76371728 25898676 46550468 36% /
tmpfs 8052996 138456 7914540 2% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8052996 0 8052996 0% /sys/fs/cgroup
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda7 201454560 187011128 4187048 98% /Share
tmpfs 1610596 12 1610584 1% /run/user/1000
And for the sake of it, this time only, here's a complete run using Linux Mint 18.1
Code: Select all
% whoami
mevla
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8035044 0 8035044 0% /dev
tmpfs 1611276 9732 1601544 1% /run
/dev/sdc1 61796348 51044516 7589720 88% /
tmpfs 8056368 80560 7975808 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8056368 0 8056368 0% /sys/fs/cgroup
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda7 201454560 187011128 4187048 98% /Share
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sdc3 490127496 414126048 51081384 90% /B3
cgmfs 100 0 100 0% /run/cgmanager/fs
tmpfs 1611276 0 1611276 0% /run/user/121
tmpfs 1611276 20 1611256 1% /run/user/1000
% pmount /dev/sde1
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8035044 0 8035044 0% /dev
tmpfs 1611276 9736 1601540 1% /run
/dev/sdc1 61796348 51044524 7589712 88% /
tmpfs 8056368 80560 7975808 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8056368 0 8056368 0% /sys/fs/cgroup
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda7 201454560 187011128 4187048 98% /Share
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sdc3 490127496 414126048 51081384 90% /B3
cgmfs 100 0 100 0% /run/cgmanager/fs
tmpfs 1611276 0 1611276 0% /run/user/121
tmpfs 1611276 20 1611256 1% /run/user/1000
/dev/sde1 2884120800 1119860196 1617732656 41% /media/sde1
% touch /media/sde1/test
% rm /media/sde1/test
% pumount /media/sde1/
% df
Filesystem 1K-blocks Used Available Use% Mounted on
udev 8035044 0 8035044 0% /dev
tmpfs 1611276 9732 1601544 1% /run
/dev/sdc1 61796348 51044528 7589708 88% /
tmpfs 8056368 80560 7975808 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 8056368 0 8056368 0% /sys/fs/cgroup
/dev/sda13 189076252 176852064 2596592 99% /B2
/dev/sda3 302248384 283052080 3819920 99% /B1
/dev/sda7 201454560 187011128 4187048 98% /Share
/dev/sda6 302248384 242774004 44097996 85% /VM
/dev/sda9 30106576 6984380 21569812 25% /LFS-8.3
/dev/sda10 9948012 22488 9397140 1% /LFS-8.3.B
/dev/sda2 503833832 436263644 41953804 92% /MM
/dev/sdc3 490127496 414126048 51081384 90% /B3
cgmfs 100 0 100 0% /run/cgmanager/fs
tmpfs 1611276 0 1611276 0% /run/user/121
tmpfs 1611276 20 1611256 1% /run/user/1000
Re: Can't take ownership of exFAT HDD's
Posted: Sun Feb 17, 2019 1:39 am
by Death
Yeh. That photorec program must've really screwed with something. If I'd have realised what had happened sooner I'd have just restored the system from a Timeshift backup instead. Maybe I'll just do a clean install when Mint 19.2 is out. I could do with the practice anyway I suppose!
Re: Can't take ownership of exFAT HDD's
Posted: Mon Feb 18, 2019 1:35 am
by milkii
while it has already been stated, from the phrasing of words in recent posts it seems it might need stating again that; exfat formatted drives do not have a concept of ownership/permissions for files within that filesystem. it will be the mount point that has ownership. figuring out the method of mounting (and what has changed with it in recent times) is key to resolving this issue. if a drive automatically mounts, it's part of the DE doing that, or possibly the file manager (or possibly a line in /etc/fstab, or some other app separately installed to auto mount drives. but if that were either of these two i really guess it'd be known about).
this is a RTFM from start to finish kind of issue, especially if you're doing things with backup drives as root(!).
reading the pmount man, it does not appear to support exfat. there is a patch available, which, for Arch Linux users, is applied as part of the
pmount package in the AUR. i'm not sure whether this is the case for the Linux Mint pmount package. can anyone advise how to confirm if this is the case or not?
edit: reading the [short] photorec man; "PhotoRec is file data recovery software designed to recover lost files including video, documents and archives from Hard Disks and CDRom and lost pictures (Photo Recovery) from digital camera memory.
PhotoRec ignores the filesystem and goes after the underlying data, so it'll work even if your media's filesystem is severely damaged or formatted. PhotoRec is safe to use,
it will never attempt to write to the drive or memory support you are about to recover lost data from."
i'm now doubting it was photorec that caused the problem.
Re: Can't take ownership of exFAT HDD's
Posted: Mon Feb 18, 2019 3:47 am
by jonetsu
milk wrote:reading the pmount man, it does not appear to support exfat. there is a patch available, which, for Arch Linux users, is applied as part of the
pmount package in the AUR. i'm not sure whether this is the case for the Linux Mint pmount package. can anyone advise how to confirm if this is the case or not?
As I've said I'm not using Windows partitions, but, pmount is used with a USB key that has a windows partition as such:
Code: Select all
% df -Th
/dev/sde1 vfat 3.0G 173M 2.9G 6% /media/mevla/E223-9F8C
... On both Linux MInt 18,1 and Xubuntu 18.04. Not sure though if that vfat qualifies to be, or is in the same family of file systems as the exfat you mentioned.
Re: Can't take ownership of exFAT HDD's
Posted: Tue Feb 19, 2019 1:58 am
by milkii
jonetsu wrote:As I've said I'm not using Windows partitions, but, pmount is used with a USB key that has a windows partition as such:
Code: Select all
% df -Th
/dev/sde1 vfat 3.0G 173M 2.9G 6% /media/mevla/E223-9F8C
I did not use the term "Windows", but I don't actually think there is any technical difference between the two things that I think you refer to (unless you are being /too/ laconic and actually referring to the use of pmount on a USB key by someone else, which would change the meaning).
to note; the "Type" column returned by "df -Th" is the filesystem type. partitions are at a lower level. partitions do have a type, which can be viewed by doing "sudo fdisk -l", but i would advise against saying "windows partition" to refer to a vfat or exfat filesystem as it's conflating different levels and will only add to confusion in understanding (i would even advise not to use "Windows partition" to refer to a *fat partition" - trying to be very careful with language is one of the best ways to avoid others misunderstanding you)
... On both Linux MInt 18,1 and Xubuntu 18.04. Not sure though if that vfat qualifies to be, or is in the same family of file systems as the exfat you mentioned.
they are different enough
exFAT is a later creation, aimed towards USB [and other] flash media devices.
Death - what variety of Linux Mint are you using? i see there are Cinnamon, MATE and Xfce flavours. these refer to the default
DE these varieties use. knowing which one will allow us to understand by what mechanism drives are automatically mounted and thus assist in troubleshooting the problem.
Re: Can't take ownership of exFAT HDD's
Posted: Tue Feb 19, 2019 2:30 am
by Death
milk wrote:Death - what variety of Linux Mint are you using? i see there are Cinnamon, MATE and Xfce flavours. these refer to the default
DE these varieties use. knowing which one will allow us to understand by what mechanism drives are automatically mounted and thus assist in troubleshooting the problem.
I'm using the latest Mint (19.1) with Cinnamon. I heard that Cinnamon is based on GNOME 3 if that makes any difference (not sure if that info is correct though). Cheers.
Re: Can't take ownership of exFAT HDD's
Posted: Tue Feb 19, 2019 3:49 am
by milkii
Thanks. I've just gone and reread most of this thread, apologies for missing/forgetting it was Cinnamon previously.
So in Cinnamon, it's Nemo, the file manager, that manages the external drive automounting.
source:
https://www.systutorials.com/241394/how ... -cinnamon/
You stated at the start that you ran Nemo as root and had the problem. What exactly happens when you run Nemo as your regular user z? Are things exactly the same?
What happens when you run Nemo from a terminal? Do you get any insightful messages in the terminal when connecting or trying to access the drive?
If the problem is the same, untick the "Automatically mount removable media when inserted and on startup" option and reboot. What happens when you open Nemo as z and try to access the drive?
Edit:
P.S. I have a hunch that underneath it's the exfat-fuse system being used to mount the drive, which is why there was a fuse entry in the /proc/mounts information earlier.
Btw, "lsblk" is my favourite command for drive drive information. also "lsblk -f" gives filesystem information rather than partition information.
Re: Can't take ownership of exFAT HDD's
Posted: Tue Feb 19, 2019 11:41 am
by merlyn
Death wrote:
So I ran the commands and they all worked until the final one. Here was the result:
Code: Select all
~$ sudo mount -o rw,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2 device /mnt/usb-USB3.0_USB_Device_DB9876543211167-0:0-part1
mount: /mnt/usb-USB3.0_USB_Device_DB9876543211167-0:0-part1: special device device does not exist.
I did change the last section to the mountpoint for my drive, but for some reason it didn't work. It wouldn't mount the drive.
Ok, you didn't do that right. The last bit is wrong:
Code: Select all
device /mnt/usb-USB3.0_USB_Device_DB9876543211167-0:0-part1
You have to replace 'device' with the path to your device, which will be something like 'dev/sde1'. You'll have to find out where your usb drive is. You could use
lsblk -f as milk suggested. The mountpoint should be /mnt/backup which is the directory you've made for this purpose.
Re: Can't take ownership of exFAT HDD's
Posted: Tue Feb 19, 2019 3:31 pm
by jonetsu
milk wrote:Btw, "lsblk" is my favourite command for drive drive information. also "lsblk -f" gives filesystem information rather than partition information.
I've used lsblk quite a few times recently when switching from LM 18.1 to Xubuntu 18.04. However in the case above the information returned is the same as df -T as seen below (which at the same time would hopefully answer any doubt about me "
being /too/ laconic and actually referring to the use of pmount on a USB key by someone else" since the same USB key was remounted just now to show the lsblk output)
Code: Select all
sde
├─sde1 vfat E223-9F8C /media/mevla/E223-9F8C
└─sde2
sde2 of that USB key is formatted ext3.
Re: Can't take ownership of exFAT HDD's
Posted: Sun May 05, 2019 10:24 am
by Linuxmusician01
Red through the five (!) pages of this. Only got to learn a little bit about what can be the underlying problem after reading the replies by @Milk. This is a Music forum and I think that this is a very basic but difficult Linux problem. That does not mean that the solution will turn out to be very, very simple when we find it.
The USB drive appears to be formatted as
exFAT (
wiki). The wiki says: "exFAT is proprietary, and Microsoft owns patents on several elements of its design". So don't use
exFAT in Linux. I don't think it'll ever work in Linux.
@topic starter Death: how did you format the USB drive? Did you do that in Windows by any chance? If not, how do we/you know that it's
exFAT and not 'ye 'olde
VFAT?
Problem is getting more and more complex, sorry...
P.S. Do not run you file manager (Nemo) as root!
Re: Can't take ownership of exFAT HDD's
Posted: Sun May 05, 2019 11:23 am
by merlyn
My instructions would work if he typed them in right.
Re: Can't take ownership of exFAT HDD's
Posted: Sun May 05, 2019 2:10 pm
by Linuxmusician01
merlyn wrote:My instructions would work if he typed them in right.
So you know for sure that Linux works o.k. with the proprietary
exFAT?
Re: Can't take ownership of exFAT HDD's
Posted: Sun May 05, 2019 2:21 pm
by merlyn
I've got it working with vfat and exfat is an extension of that. It will work with Linux because @Death used to have it working, then it broke, perhaps because of photorec but, as @milk pointed out, that looks unlikely.
Re: Can't take ownership of exFAT HDD's
Posted: Wed May 08, 2019 12:26 am
by Death
Thanks for everyone's efforts to help me solve this. I left this thread alone for a while with the intention of coming back at a later date to have another go at sorting it out, but I probably won't do that anytime soon. I've just been sticking with Ext4 for now. When I need to use an Ex-Fat drive, I'll either figure out a workaround or see if I can solve the issue again. Maybe it'll work when I do a major upgrade to my distro next as it worked when I first did it.
Anyway, thanks for all your help. I really do recognise and appreciate the efforts everyone has gone to, to help me solve this. Cheers