Auto-mount problem

Hello,

After a long try I managed to make Transmission work, because I was getting an “access denied” error with my external HDD. For the record, how I managed to make it work was like that

First I installed the ntfs-3g package

$sudo apt-get install ntfs-3g

Then I un-mount my HDD

$sudo umount /dev/sad1

Then I created an already actually created directory in my HDD (I don’t know if that was necessary)

$sudo mkdir /media/elements

And last I mounted the HDD again

$sudo mount /dev/sda1 /media/elements -ntfs

My problem is that if I restart Raspberry, OSMC mounts again automatically my HDD with the old settings and I get again the same “access denied” error.

So my question is how I can tell to the OSMC to mount my HDD with the -ntfs extension???

Thank you

I believe that the elements under /media are treated as temporary by the system. Consider trying with /mnt/… as the place for your permanent directory for mounting.
Derek

Everything needed to mount NTFS on OSMC should be installed already. What version of OSMC are you running?

S

But the OSMC is auto mounting my HDD to /media. That means that if I do it your way and restart Raspberry, I will have two images of my HDD. One in /mnt and one in /media?

My OSMC version is the last one (I suppose), since I got my Raspberry2 last week…

I was offering a suggestion.
I don’t have problems with NTFS hdds being mounted.
Is it possible that your real problem is the way yours hs been created (ownership and permissions)?
I have found that proper labelling on the filesystems to be mounted can help with some problems.
If you do have problems still, you may need to post details and logs.
Derek

I had the same issue, once I had made a new directory and tested it with a temporary mount I changed the fstab (sudo nano /etc/fstab) so it would auto mount correctly. Use the following where /mnt/HDD is your new location.

/dev/sda1 /mnt/hdd ntfs-3g defaults,auto,uid=1000,gid=1000, 0 0
Then reboot and test.

Also don’t use /media as you will get permission issues like I did. Make a new mount point in /mnt. Also I don’t think /media is persistent, it un mounts and remounts on every reboot.

If it doesn’t work then try again with a fresh install. I didn’t need to mess around with any permissions, simply create a new mount point, change the location of the transmission downloads and then edit fstab.
Hope the above makes sense.

I to mount the HDD to the /mnt but after a reboot it turn back to /media.

I don’t know how to edit the fstab, so any guide on that will be extremely helpful.

Thank you

Log into your OSMC with ssh.
Create mount point in /mnt/

osmc@osmc:~$ mkdir /mnt/elements

Open fstab in nano for editing:

osmc@osmc:~$ sudo nano /etc/fstab

add this line to /etc/fstab with nano:

/dev/sda1 /mnt/elements ntfs-3g defaults,auto,uid=1000,gid=1000, 0 0

Ctrl-O & Ctrl-X to save the file and exit.

Unmount anything in /media/:

osmc@osmc:~$ sudo umount /media/*

Mount what is configured in fstab:

osmc@osmc:~$ sudo mount -a

Check your mounts to see if it mounted right:

osmc@osmc:~$ mount

I tried to add the line in fstab like you said and I bricked OSMC. I had to reinstall everything again… obviously I did something very wrong…

At what point did you run into the problem?

For future reference, if you have the latest updates installed you can hold down the shift key (on a USB keyboard) at the beginning of boot for an emergency root recovery console - from there you could edit your fstab file to undo any changes.

2 Likes

I inserted the command line in the fstab and after the restart there was just the logo of OSMC with some dozens of command lines failing to start. Probably I “inserted” wrong the command line? Do I have to delete any of the commands that already are in the fstab? Do I insert it before of after the ones that already exist?

Thank you

I just inserted it after the existing ones, trying again with a fresh install should help

I don’t see anything in your fstab that would conflict. At the end of the file is as good a place as any.

sudo mount -a mounts everything in your fstab without rebooting. Use this to test if the fstab is configured correctly before rebooting. That way, if it’s not mounting for some reason, you can diagnose the error without having to reinstall OSMC.

I tried this, didn’t work for me. Had to plug the SD card into my laptop and edit /etc/fstab there.

I have the same problem

If you run sudo mount -a
Do you get any errors?

Hello
I’ve got a question to this.
In opening osmc@osmc:~$ sudo nano /etc/fstab
I find this:
‘/dev/mmcblk0p1 /boot vfat defaults,noatime 0 0
/dev/sda1 / ext4 defaults,noatime 0 0’

In the mnt folder is already an empty folder called usbdrive , also mnt/usbdrive ,

So the question is when I add this line
/dev/sda1 /mnt/elements ntfs-3g defaults,auto,uid=1000,gid=1000, 0 0
Via the nano editor is it okay to change the mnt/elements to read mnt/usbdrive?
Also please note that in my fstab there already is a /dev/sda1 / line - just leave it or should it
be replaced with the new line of
/dev/sda1 /mnt/usbdrive ntfs-3g defaults,auto,uid=1000,gid=1000, 0 0
Thanks, for your time.
For the moment my usb external is sitting in /media/Big Basement

It looks to me like /dev/sda1 is already being mounted as your root filesystem. That means your whole OSMC installation is located on the /dev/sda1 partition. Changing that line will, in all likelihood, make your Pi inoperative.

Please do a
mount
and also
fdisk -l
and post the results here.

Hello
Thanks for the reply, here is part of the fdisk -1
"Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000adbfe

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 499711 497664 243M c W95 FAT32 (LBA)

Disk /dev/sda: 29.9 GiB, 32034041856 bytes, 62566488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00070eaf

Device Boot Start End Sectors Size Id Type
/dev/sda1 4096 62566399 62562304 29.9G 83 Linux

Disk /dev/sdb: 1.4 TiB, 1500301910016 bytes, 2930277168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb13c4651

Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 2930272064 2930272002 1.4T 7 HPFS/NTFS/exFAT"

The setup is Boot is of course an SD card (Disk /dev/mmcblk0: 14.9 GiB,)
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 2048 499711 497664 243M c W95 FAT32 (LBA)

with OSMC on an USB stick (Disk /dev/sda: 29.9 GiB,)
Device Boot Start End Sectors Size Id Type
/dev/sda1 4096 62566399 62562304 29.9G 83 Linux

The external USB HDD (name is Big Basement) is for now listed in the /media/Big Basement
Disk /dev/sdb: 1.4 TiB,
Device Boot Start End Sectors Size Id Type
/dev/sdb1 63 2930272064 2930272002 1.4T 7 HPFS/NTFS/exFAT

So what do I need to do to get this into the /mnt and not in /media?
Oh and as you can tell, I haven’t much Linux knowledge. Using WinSCP (it has a text editor)
and Putty as a terminal.
The Raspberry Pi 2 is on a TV in the living room and controlled with Yatse on my smart phone.
Once again, many thanks for your response and help.