New Linux Server - Need Help Mounting USB Drive that was used on Pi

I setup a server with Ubuntu 20.04 and would like to take the USB drive I am currently using for my Channels DVR via a Raspberry Pi 4 and just restore the config and shows. I am new to Linux so I am struggling to get the USB drive mounted in a read/write mode. I got it mounted with some fstab settings I found but I get an error when I am at the step of where to store DVR recordings and data. I am trying to pick /mnt/usb/ and it tells me Error: no write permissions on dvr directory

From what I read it's because the drive is mounted as root but Channels is running as my user? How do I get it to auto mount the USB drive after reboots so that Channels can read and write to it?

For now I have put the drive back on my Pi so my family's shows get recorded. Any assistance in this area is appreciated.

Give your user permissions for the folders on the drive, and put the drive in your fstab.

As I said, I am new to Linux. What would those commands be? I am working from an SSH terminal.

what's the output of

cat /etc/fstab

and also

mount

and also

ls -la /mnt/usb

and

ps -ef | grep dvr

Sorry, I missed that. To grant yourself ownership/permissions, and assuming the drive is mounted at /mnt/usb, then:
sudo chown -R USER:USER /mnt/usb
will give your user full ownership and control of everything on the drive. (Replace USER with your username, though.)

I’ll be able to give these a shot tomorrow as the drive is in use with the Pi this evening. Gotta work on it in between recording windows, haha

You need to mount just the exfat partition, which should not require any use of chown. I think maybe mount option to set the user is what's missing

Yeah, I was mounting the UUID for the exfat partition. I am sure you at right it is just some kind of option I am missing in fstab.

It was something like

UUID=uuid_for_exfat /mnt/usb exfat defaults 0 0

I tried a few variations with uid= and gid= but they were for sure wrong because after saving and using mount -a it would error at that line.

I checked and recordings for the evening will be done in 15 minutes. I’ll be able to try things at that time.

You're missing the type field in your fstab:

UUID=... /mnt/usb exfat defaults,uid=...,gid=... 0 2

You may want to check out the Arch wiki entry for fstab, as their documentation is pretty great, and applicable across most distros.

1 Like

Yeah, I just missed that, I am working from memory at the moment. I have updated my post.

I will look at that documentation posted as well.

I haven't rebooted yet to ensure it automatically mounts at start up, but I believe I got it. I was able to get past that step in the setup. I was on the right track earlier, I just had the UID and GID in the wrong place.

Thank you all so much for your help and insight so far.

It came back after a reboot, success!

I have one other problem though, I can start a new thread if need be.

I forgot to do a database backup when it was connected to the Pi just before I did the restore on the Linux machine. Is there a process I can do to get the few recordings that are in the TV directory that are not showing up since they were not in the database backup I restored from since they recorded in the time since I took the backup?

Move them to imports

I will keep that in mind for the future. What I did to get what I wanted was connect it back to the Pi, save the database, and then do another restore on Linux. I just had to be careful which I picked because the "latest" one was from the Linux when it booted.

I appreciate you all! This is such a great and responsive community and developers.

1 Like