Announcement

Collapse
No announcement yet.

Mount network drive in 2.4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mount network drive in 2.4

    Up until VB 2.3 I used to modify the /etc/fstab file and add the line

    //remote-server-IP/sharename/ /storage/movies cifs guest defaults 0 0

    and it used to mount the remote share just fine

    In 2.4, while the command works from ssh, it doesn't mount at startup. Can someone guide with the correct procedure please?

  • #2
    Hello! Can anyone please help me with this? I cannot have VB rip my music directly to my NAS because of this. I have run out of space on the Vortexbox hard disk and matter is somewhat urgent. Copying manually over the network each time is a tedious solution.

    Comment


    • #3
      Take this with many grains of salt. I am a neophyte (not even a novice) in Linux.
      Disclaimer: I have NOT tried this and don’t know if it will work.
      Please backup all data to your NAS just in case of the worst case.

      From the dim and hazy past (one Solaris class):
      Under /etc there are startup & shutdown files in several subdirectories
      (/etc/rc?.d) which are executed in sequence (rc0, rc1, rc2 …etc.) up to the desired
      run level. Run level 6 is normal operation. The filenames in these subdirectories take
      the form S##comment or K##comment for Start or Kill. These files are executed in
      numerical sequence. For example, if you wanted to signal that the boot process had
      completed by opening the CD drive, in the file /etc/rc6.d/S99openCD you would find
      the text necessary to cause the CD to open.

      I’ve been poking around in my VB2.4 and found only K (kill) files. Apparently, the standard
      Linux startup processes are embedded in the kernel and only need to be killed at shutdown.
      Try creating the file S90mountNAS in /etc/rc6.d with the text of the command to mount the NAS.
      It should be executable by all (chmod 777 S90mountNAS).

      I repeat Disclaimer: I have NOT tried this and don’t know if it will work. Please backup all data
      to your NAS just in case of the worst case.

      Comment


      • #4
        Just put that command in the file /opt/vortexbox/post_startup.sh

        This gets run after the system boots.

        Comment


        • #5
          Im trying to follow this guide but I cant make it work. No I manually need to add the following line in Putty every time I reboot:

          mount.cifs //192.168.2.23/Musik /storage/music -o username=admin,password=grendel11,domain=WORKGROUP

          Id like that route to be permanent, but im not good at linux

          Comment


          • #6
            I dont have a file post:startup.sh, just startup

            #!/bin/sh
            # Copyright (C) 2008 - 2015 vortexbox.org
            #
            # This program is free software; you can redistribute it and/or
            # modify it under the terms of the GNU General Public License
            # as published by the Free Software Foundation; either version 2
            # of the License, or (at your option) any later version.
            #
            # This program is distributed in the hope that it will be useful,
            # but WITHOUT ANY WARRANTY; without even the implied warranty of
            # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
            # GNU General Public License for more details.
            #

            # Mount storage partition
            if [ -f /opt/vortexbox/mount_drives.sh ] ; then
            chmod +x /opt/vortexbox/mount_drives.sh
            /opt/vortexbox/mount_drives.sh
            fi

            # Clean up permissions
            chmod -R 755 /storage/music/
            chown -R squeezeboxserver:squeezeboxserver /storage/music/playlist/

            # Clean up old temp files
            tmpwatch -au 1 /tmp
            rm -f /etc/vortexbox/mirror-flac-mp3.*
            rm -f /etc/vortexbox/mirror-flac-aac.*
            rm -f /etc/vortexbox/mirror.running
            rm -f /etc/vortexbox/backup.running /etc/vortexbox/restore.running

            # Check if this is a new install
            if [ -f /etc/vortexbox/newinstall ]; then
            /usr/local/sbin/setup-vortexbox > /var/tmp/vb_setup.log 2>&1
            fi
            /opt/vortexbox/getnews.php > /dev/null 2>&1

            # Unmute audio cards
            /opt/vortexbox/unmute_all.sh > /dev/null 2>&1

            if [ -f /opt/vortexbox/player_reset.sh ]; then
            chmod +x /opt/vortexbox/player_reset.sh
            /opt/vortexbox/player_reset.sh
            fi

            # Post startup process
            if [ -f /opt/vortexbox/post_startup.sh ] ; then
            chmod +x /opt/vortexbox/post_startup.sh
            /opt/vortexbox/post_startup.sh


            fi

            exit 0

            Comment


            • #7
              bump for reply.

              Comment


              • #8
                What version of Vortexbox are you running? If you are not running 2.4, the Wiki and what the people above used is not going to help you any.

                Comment


                • #9
                  Im on version 2.4

                  Comment


                  • #10
                    bump for help

                    Comment


                    • #11
                      Nimnut,

                      I think Andrew want you to create a file called post_startup.sh at /opt/vortexbox/ (instead of editing)
                      see the last command in startup.sh
                      Code:
                      # Post startup process
                      if [ -f /opt/vortexbox/post_startup.sh ] ; then
                      chmod +x /opt/vortexbox/post_startup.sh
                      /opt/vortexbox/post_startup.sh
                      I assume you have to write your command in this new file, which wil be executed as soon as startup.sh has found a file called post_startup.sh


                      cheers
                      /bart
                      Last edited by bart; 07-18-2017, 12:38 PM.

                      Comment


                      • #12
                        OK, like this

                        # Post startup process
                        if [ -f /opt/vortexbox/post_startup.sh ] ; then
                        chmod +x /opt/vortexbox/post_startup.sh
                        /opt/vortexbox/post_startup.sh
                        mount.cifs //192.168.2.23/Musik /storage/music -o username=admin,password=grendel11,domain=WORKGROUP

                        ??

                        Comment


                        • #13
                          Originally posted by nimnul View Post
                          OK, like this

                          # Post startup process
                          if [ -f /opt/vortexbox/post_startup.sh ] ; then
                          chmod +x /opt/vortexbox/post_startup.sh
                          /opt/vortexbox/post_startup.sh
                          mount.cifs //192.168.2.23/Musik /storage/music -o username=admin,password=grendel11,domain=WORKGROUP

                          ??
                          Not exactly
                          That script is saying - if post_startup.sh exists then run it
                          Create a new file called post_startup.sh within /opt/vortexbox and put your command in that

                          I imagine that it is done this way so that if VB's startup script is upgraded you won't lose your change

                          Comment


                          • #14
                            Great, thanks it works now!!!

                            Comment


                            • #15
                              Perfect!
                              Glad we can push each other in the right direction....

                              To be of help for others in the future, what exactly did you write/put into the newly created file post_startup.sh ?

                              cheers
                              /bart
                              Last edited by bart; 07-21-2017, 04:57 AM. Reason: typo

                              Comment

                              Working...
                              X