Help auto mounting HDD rpi2

  • Hello everyone, I have a problem with my raspberry 2 and a portable drive. The hard drive is connected to the raspberry through a USB hub. Every time I turn off or reboot the system, the file system management I see the state that is missing. To do that I have to mount the hard Dsik disconnect and then reconnect it. Is there a way that every time I turn on the raspberry or restart mounts the hard drive automatically? I use it a lot outside and if it happens that the power goes off or do I restart the raspberry for some reason, then I can not use features such as the downloader or bitorrent. Can you help me please? Thanks in advance to all

    • Offizieller Beitrag

    Pretty sure this happens because there is no boot delay on the RPi. It is past the mounting stage before the usb drive is ready and doesn't mount. You could try putting the mount -a command in /etc/rc.local before the exit command.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Pretty sure this happens because there is no boot delay on the RPi. It is past the mounting stage before the usb drive is ready and doesn't mount. You could try putting the <code class="inlineCode">mount -a</code> command in <code class="inlineCode">/etc/rc.local</code> before the exit command.


    Thank you, I try and update you if it solves the problem

  • Pretty sure this happens because there is no boot delay on the RPi. It is past the mounting stage before the usb drive is ready and doesn't mount. You could try putting the <code class="inlineCode">mount -a</code> command in <code class="inlineCode">/etc/rc.local</code> before the exit command.


    Nothing, same problem

    • Offizieller Beitrag

    You could try creating another script like the following and call it from rc.local


    put the following in /etc/rc.local before the exit command.
    /root/wait_to_mount.sh &


    nano /root/wait_to_mount.sh

    Bash
    #!/bin/sh
    sleep 10 # sleeps for 10 seconds - may need to adjust
    mount -a
    exit 0


    chmod +x /root/wait_to_mount.sh


    It would also be possible to loop until the device exists and then mount it but I would need to know more about the system.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Having the same problem, but not sure how to edit rc.local. I don't see an exit command...


    This is my file, where do I put the command?


    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.


    # Print the IP address
    _IP=$(hostname -I) || true
    if [ "$_IP" ]; then
    printf "My IP address is %s\n" "$_IP"
    fi


    test -f /etc/ssh/ssh_host_dsa_key || dpkg-reconfigure openssh-server


    ntpdate -b pool.ntp.org
    service ntp start

    • Offizieller Beitrag

    exit 0 should be the last line. Just add it.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!