[Abandoned] Can't take ownership of exFAT HDD's

What other apps and distros do you use to round out your studio?

Moderators: khz, MattKingUSA

Death
Established Member
Posts: 162
Joined: Sun Oct 11, 2015 1:43 pm

Re: Can't take ownership of exFAT HDD's as root

Postby Death » Sat Feb 16, 2019 3:45 pm

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.

Code: Select all

$ sudo umount mountpoint

Because your drive was automatically mounted the mountpoint will probably disappear, so to be on the safe side make a new directory.

Code: Select all

$ sudo mkdir /mnt/backup

Check your user id is 1000.

Code: Select all

$ id -u

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!

jonetsu
Established Member
Posts: 1457
Joined: Sat Jun 11, 2016 12:05 am

Re: Can't take ownership of exFAT HDD's as root

Postby jonetsu » Sat Feb 16, 2019 5:01 pm

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

Death
Established Member
Posts: 162
Joined: Sun Oct 11, 2015 1:43 pm

Re: Can't take ownership of exFAT HDD's

Postby Death » Sun Feb 17, 2019 1:39 am

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!

User avatar
milk
Established Member
Posts: 174
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Contact:

Re: Can't take ownership of exFAT HDD's

Postby milk » Mon Feb 18, 2019 1:35 am

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.
they/them ta / wiki.thingsandstuff.org/Audio and related pages - a collection of mostly Linux and free links / Linux Digital Audio and Music Workstation Comparison Matrix - collaborative Google Sheet (slightly broken, no time/cpu power to fix here)

jonetsu
Established Member
Posts: 1457
Joined: Sat Jun 11, 2016 12:05 am

Re: Can't take ownership of exFAT HDD's

Postby jonetsu » Mon Feb 18, 2019 3:47 am

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.

User avatar
milk
Established Member
Posts: 174
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Contact:

Re: Can't take ownership of exFAT HDD's

Postby milk » Tue Feb 19, 2019 1:58 am

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.
they/them ta / wiki.thingsandstuff.org/Audio and related pages - a collection of mostly Linux and free links / Linux Digital Audio and Music Workstation Comparison Matrix - collaborative Google Sheet (slightly broken, no time/cpu power to fix here)

Death
Established Member
Posts: 162
Joined: Sun Oct 11, 2015 1:43 pm

Re: Can't take ownership of exFAT HDD's

Postby Death » Tue Feb 19, 2019 2:30 am

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.

User avatar
milk
Established Member
Posts: 174
Joined: Tue Jan 05, 2016 9:08 am
Location: Edinburgh
Contact:

Re: Can't take ownership of exFAT HDD's

Postby milk » Tue Feb 19, 2019 3:49 am

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.
they/them ta / wiki.thingsandstuff.org/Audio and related pages - a collection of mostly Linux and free links / Linux Digital Audio and Music Workstation Comparison Matrix - collaborative Google Sheet (slightly broken, no time/cpu power to fix here)

merlyn
Established Member
Posts: 516
Joined: Thu Oct 11, 2018 4:13 pm

Re: Can't take ownership of exFAT HDD's

Postby merlyn » Tue Feb 19, 2019 11:41 am

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.

jonetsu
Established Member
Posts: 1457
Joined: Sat Jun 11, 2016 12:05 am

Re: Can't take ownership of exFAT HDD's

Postby jonetsu » Tue Feb 19, 2019 3:31 pm

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.

User avatar
Linuxmusician01
Established Member
Posts: 672
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Can't take ownership of exFAT HDD's

Postby Linuxmusician01 » Sun May 05, 2019 10:24 am

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!

merlyn
Established Member
Posts: 516
Joined: Thu Oct 11, 2018 4:13 pm

Re: Can't take ownership of exFAT HDD's

Postby merlyn » Sun May 05, 2019 11:23 am

My instructions would work if he typed them in right. :D

User avatar
Linuxmusician01
Established Member
Posts: 672
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland

Re: Can't take ownership of exFAT HDD's

Postby Linuxmusician01 » Sun May 05, 2019 2:10 pm

merlyn wrote:My instructions would work if he typed them in right. :D

So you know for sure that Linux works o.k. with the proprietary exFAT?

merlyn
Established Member
Posts: 516
Joined: Thu Oct 11, 2018 4:13 pm

Re: Can't take ownership of exFAT HDD's

Postby merlyn » Sun May 05, 2019 2:21 pm

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.

Death
Established Member
Posts: 162
Joined: Sun Oct 11, 2015 1:43 pm

Re: Can't take ownership of exFAT HDD's

Postby Death » Wed May 08, 2019 12:26 am

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 :wink:


Return to “Linux Distributions & Other Software”

Who is online

Users browsing this forum: No registered users and 1 guest