Deleting file from USB stick mounted on Vero4K

I have a 256GB USB stick formatted exfat on which I have, over time, saved .mp4 files. I play these files using the Vero4K but have saved them on different machines such as laptops as well as Vero4K.

I recently wanted to remove some old files to free up space and as the stick was mounted I tried to use the OSMC system to delete them. I was using the remote and checking the files to view before deletion. Viewing and playing these files was not a problem but when I tried to delete a highlighted file it was not deleted.

It might be an ownership or permissions issue but I have not been able to sort this out. Please can somebody put me straight here.

https://kodi.wiki/view/Settings/Media/General#Allow_file_renaming_and_deletion

Hi and thanks for the link. I believe I have already done what is shown in the instructions on the link but sill no joy.

The remote long press does not take me to any menu. From Settings>Media>General>Allow file renaming and deletion is highlighted.

Going to Videos>Files>USB(on drive from here)>Downloads>Full_Movies>movie1.mp4 and using three line (r.hand) button on remote I can bring up 10 options including Delete, If I select this it brings up a “Confirm delete” popup. If I select “Yes” nothing is deleted.

What have I missed please?

That Kodi option only sets whether the delete option is shown or not. The reason why your seeing what your seeing is because the auto-mount is mounting the drive with read only user permissions. You can manually setup to mount the drive with more permissions and that would fix the issue.

Hi, many thanks; makes sense to me but if I am only using remote to a headless device, how may I mount the USB with appropriate rw permissions and why am I in this situation?

Did I do something wrong or did I miss something.

You didn’t do anything wrong. That is the default automount setup. I don’t know if the lack of permissions was intentional or not. Perhaps @sam_nazarko could clarify.

To fix this you can ssh into your device and type in “blkid” and hit enter. It will return something similar to the following…

osmc@VeroCave:~$ blkid
/dev/instaboot: UUID="Rna0mF-CvmZ-Fkuf-oj2l-YNtb-IbkE-uUWG4k" TYPE="LVM2_member"
/dev/system: UUID="kkHApO-X4aF-xCr3-GuqW-GIlT-Nfhf-flvTUg" TYPE="LVM2_member"
/dev/data: UUID="3jHfgZ-A4wp-VBHD-eOf6-tCTJ-H4fq-yv2HTC" TYPE="LVM2_member"
/dev/cache: UUID="yaRrh3-N4Wj-Tdrq-4QJV-nfpz-ewnS-Gwgnq4" TYPE="LVM2_member"
/dev/mapper/vero--nand-root: UUID="2478e873-d98f-4e8d-9f8a-4c629076ce6b" BLOCK_SIZE="4096" TYPE="ext4"
/dev/sda1: LABEL="exfat" UUID="40A6-AC06" BLOCK_SIZE="512" TYPE="exfat" PARTUUID="164bb7a7-01"
osmc@VeroCave:~$

Take a note of the UUID of the device you want to mount. Next you will enter the command…

sudo nano /etc/fstab

And add in a line like this replacing the UUID with the one you discovered earlier, and changing the file path (/mnt/exfat) to where you want it to mount (/mnt/your-name)…

UUID=40A6-AC06 /mnt/exfat exfat rw,users,uid=1000,dmask=000,fmask=000,nofail 0 0

You can then ctrl+x, y, then enter to save the file and exit nano. Next you need to make a folder where you told it to mount to. You would do this with the command…

sudo mkdir /mnt/your-name

and then

reboot

Are you testing the Bullseye release?
There’s an issue with permissions on exFAT drives. I haven’t had a chance to investigate as to why yet.

Hi darwindesign and Sam,
Many thanks for the help with this. I shall do as you suggest but I have to collect the device and plug in a lan connection. The wifi connection is on a different subnet with L2 security which means I cannot ssh into it since I have not set up a dedicated route through the firewalls. Now I know the nature of the problem I can follow darwindesign solution but I do have some comments.

Is there a note somewhere in the wiki about automount defaults or id my problem because I was using exfat and if I had used ext4 would the problem not occur?

In other words, is the problem because I am using exfat on USB. I use exfat so that if necessary the stick can be used in a windoze computer. I could reformat to ext4 if that would avoid the problem in future.

Finally I couldn’t see anything in the wiki about automount defaults, usb forming issues, if that is my problem and a note about avoiding ro with automounts. I know Sam is buried in work and I may have just failed to find it but at some point a paragraph in the wiki might be appreciated or is my problem unusual?

Will work on this when I can access the device, meanwhile many thanks for the help which is appreciated.

I think (I’m a Linux noob so grain of salt) what is going on, at least with the Bullseye test build (I didn’t check current stable) is that it is automounting according to Debian default behavior which I believe is currently to mount as root for the Microsoft format types. This means that Kodi/mediacenter which is running as user osmc is only getting read and execute permissions. This is most likely an oversight that will be fixed in a future update.

I was able to access device and plug in a lan cable: Just one question. Is there an alternative because I now see that mount is:-

# rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot)
#/dev/vero-nand/root  /    ext4      defaults,noatime    0   0

Any further comments?

You put it below those lines…

# rootfs is not mounted in fstab as we do it via initramfs. Uncomment for remount (slower boot)
#/dev/vero-nand/root  /    ext4      defaults,noatime    0   0
UUID=40A6-AC06 /mnt/exfat exfat rw,users,uid=1000,dmask=000,fmask=000,nofail 0 0

Many thanks. Am getting beyond my comfort zone with mounting options so I shall try just adding lines as you suggest but I am concerned by your earlier comments. I too live in a windoze free environment at home but in my office I have to live with the dark side for some applications. I am slightly surprised however that this issue has not been more fully addressed in a Wiki. I hope Sam will look into this before too long.

This only impacts installations on the testing/staging version of OSMC which I doubt you are actually on, or?

What comment; that I called myself a Linux noob? I prefaced that to information that I wasn’t going to bother spending the time making sure it was correct as it wasn’t important to this fix. I fully understand why your issue, and exactly what that particular mount I posted does and well as tested it before posting it.

Address what in the wiki? An issue that you are the first to report? That may only affect a test build… but we don’t know as it is pointless to check the scope as the fix will be in the test build that will become the next release? Sam already brought it to the attention to the dev that will likely be addressing it.

This issue has absolutely nothing to do with Microsoft or Windows. exFAT has no permissions but a Linux mount applies these properties to give control over how you can interact with it.

Post logs, I’m sure we will find out that you’re on an experimental version.

I am very sorry if I appeared critical, which was not intended. I am most grateful for your help and assistance and ask you to forgive me.

1 Like

Please post the logs

Hi Sam,
I believe I have now posted the logs.
Last night I found that I couldn’t reboot without the usb which I assume is due to the line added in fstab.

I was able to change USB however and tried a new drive with ext4 format. Serious issues to get this to work unless I use a similar fstab edit although I could perhaps have tried mounting with -R option.

I also tried with USB formatted to ntfs and this worked without a hitch.

I think the easy solution for me will be to use ntfs format for now. Given my problems over time with saving and deleting with USB working and then not working it could be an update but I would normally expect it to be my fault. Don’t waste time on it now as I can use ntfs but let me know in due course.
Many thanks once again.
Regards,
Budge.

You would need to tell us the url that was returned when you uploaded the logs.

It was. I updated my instructions above to include a “nofail” option which will prevent this from happening.