Unable to mount internal HDD on choosen mount point

  • Hello,
    I'm new, i've got LibreElec installed on SD card (Intel NUC). I 've got an internal 2,5'' HDD that i can see.
    The hdd is automounted on /media/sda-ata-<randomlabel>
    I want it to be mounted on /media/hdd, that i succeed to do manually via ssh console. To do it permanently i 've tried to modify /etc/fstab but the file is read only file for good reason i suppose ...

    I wokrarounded the problem using autostart.sh , despite the fact i'm not completle statify whith that solution, samba shares are already established and a directory "sda-ata-<randomstring>" display in shares and is no longer a valid share... Is there a way to restart samba ? I 've tried sytemctl restart samba.service ... without success...

    Can anyone help me ?
    [hr]
    I'm replying to myself, finally i've put in autostart.sh :
    (
    umount /dev/sda
    mkdir /media/hdd
    rm -rf /media/sda-ata-*
    mount /dev/sda /media/hdd
    systemctl restart nmbd
    )&

    It's working ...
    Even if i'm not completly satified with that solution ...

    If someone can give me a better one.

    Edited once, last by tanguy (October 22, 2016 at 11:31 AM).

  • Using /etc/fstab is perhaps a logical step in Linux, but not in LibreELEC as the system part of it is set up as an readonly system by design. Any changes you make in that section will be overwritten with the next update of LibreELEC.

    I'm not quite sure why the automount is issuing random names after each boot/mount.
    Which disk format does the internal hdd have? NTFS, EXT4, something else?

    If you disable your manual mount in start.sh, and plug in your HDD and do reboot, then get us the results of the following commands (via SSH) of a 'clean' mount:

    Code
    blkid | pastebinit
    mount | pastebinit
    dmesg | pastebinit

    Also, mounting and sharing via Samba are two different things, so let's take one step at a time. :)

  • Edited once, last by tanguy (October 22, 2016 at 12:23 PM).

  • I see intel based stuff and you boot from an SD... What kind of (sourcery) box are you using?
    Never mind, I see it's a NUC now... Sunday mornings have their effect on me ;)

    Alternatively you could mount the HDD using its UUID. That will not be a random number after every boot.

  • Why?

    We auto mount the disk based on it's disk label, so if your HDD doesn't have a label then it will be mounted as some form of the disk name such as

    Code
    /media/sda1-usb-Lexar_JumpDrive_/


    this is not reliable as sda1 can change depending on if other disks are installed

    After labeling it using

    Code
    e2label /dev/sda1 testdisk


    it shows up like

    Code
    /media/testdisk/

    for fat32 formatted disks use

    Code
    fatlabel <device-number> <label>

    This is much easier to do than hacking around our automounting

    then you can always create a symlink if you want to have it located somewhere else.

    Code
    ln -s /media/testdisk /storage/videofiles