How do I mount a folder from another partition?












57














Is there a command to mount a folder from one partition to my main partition?



Example of what I'd like to do, which obviously doesn't work:





mount /media/tc1/folder /home/dvad/home



If not by using a command, is there another way I can do this?










share|improve this question





























    57














    Is there a command to mount a folder from one partition to my main partition?



    Example of what I'd like to do, which obviously doesn't work:





    mount /media/tc1/folder /home/dvad/home



    If not by using a command, is there another way I can do this?










    share|improve this question



























      57












      57








      57


      33





      Is there a command to mount a folder from one partition to my main partition?



      Example of what I'd like to do, which obviously doesn't work:





      mount /media/tc1/folder /home/dvad/home



      If not by using a command, is there another way I can do this?










      share|improve this question















      Is there a command to mount a folder from one partition to my main partition?



      Example of what I'd like to do, which obviously doesn't work:





      mount /media/tc1/folder /home/dvad/home



      If not by using a command, is there another way I can do this?







      command-line bash mount directory partitions






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 3 '16 at 11:59









      Marc.2377

      165116




      165116










      asked Oct 24 '12 at 16:41









      user100541user100541

      388144




      388144






















          2 Answers
          2






          active

          oldest

          votes


















          93














          Yes but before I go that far, couldn't you just symlink?



          ln -s /media/tc1/folder ~/home


          This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



          Failing that you can use mount as you described but the syntax is slightly different:



          mount --bind /media/tc1/folder /home/dvad/home


          This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



          /media/tc1/folder    /home/dvad/home    none    bind


          If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.






          share|improve this answer



















          • 1




            yup symlink worked, thanks for the help!
            – user100541
            Oct 24 '12 at 18:16










          • Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
            – JoshStrange
            Oct 31 '14 at 15:31






          • 2




            mount --bind source destination
            – Michel Samia
            Nov 27 '14 at 14:03






          • 4




            mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
            – abyss.7
            Nov 20 '15 at 10:46






          • 1




            @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
            – Oli
            Apr 7 '17 at 8:59





















          1














          An alternative to mount:



          bindfs -n /media/tc1/folder /home/dvad/home


          Requires sudo apt-install bindfs.



          Like with mount, this will be a (non-permanent) actual mount point, i.e. for instance not tracked as only a reference but version-control systems. But like ln -s, it does not require superuser permissions like mount does.



          Unmount with fusermount -u /home/dvad/home (or by restarting).






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f205841%2fhow-do-i-mount-a-folder-from-another-partition%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            93














            Yes but before I go that far, couldn't you just symlink?



            ln -s /media/tc1/folder ~/home


            This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



            Failing that you can use mount as you described but the syntax is slightly different:



            mount --bind /media/tc1/folder /home/dvad/home


            This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



            /media/tc1/folder    /home/dvad/home    none    bind


            If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.






            share|improve this answer



















            • 1




              yup symlink worked, thanks for the help!
              – user100541
              Oct 24 '12 at 18:16










            • Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
              – JoshStrange
              Oct 31 '14 at 15:31






            • 2




              mount --bind source destination
              – Michel Samia
              Nov 27 '14 at 14:03






            • 4




              mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
              – abyss.7
              Nov 20 '15 at 10:46






            • 1




              @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
              – Oli
              Apr 7 '17 at 8:59


















            93














            Yes but before I go that far, couldn't you just symlink?



            ln -s /media/tc1/folder ~/home


            This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



            Failing that you can use mount as you described but the syntax is slightly different:



            mount --bind /media/tc1/folder /home/dvad/home


            This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



            /media/tc1/folder    /home/dvad/home    none    bind


            If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.






            share|improve this answer



















            • 1




              yup symlink worked, thanks for the help!
              – user100541
              Oct 24 '12 at 18:16










            • Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
              – JoshStrange
              Oct 31 '14 at 15:31






            • 2




              mount --bind source destination
              – Michel Samia
              Nov 27 '14 at 14:03






            • 4




              mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
              – abyss.7
              Nov 20 '15 at 10:46






            • 1




              @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
              – Oli
              Apr 7 '17 at 8:59
















            93












            93








            93






            Yes but before I go that far, couldn't you just symlink?



            ln -s /media/tc1/folder ~/home


            This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



            Failing that you can use mount as you described but the syntax is slightly different:



            mount --bind /media/tc1/folder /home/dvad/home


            This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



            /media/tc1/folder    /home/dvad/home    none    bind


            If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.






            share|improve this answer














            Yes but before I go that far, couldn't you just symlink?



            ln -s /media/tc1/folder ~/home


            This link is just a file that is interpreted. It is automatically permanent (until you delete the file).



            Failing that you can use mount as you described but the syntax is slightly different:



            mount --bind /media/tc1/folder /home/dvad/home


            This is not permanent at all, and will be nuked by a restart. If you want it to persist, you'll need something in your /etc/fstab like this:



            /media/tc1/folder    /home/dvad/home    none    bind


            If you're trying a mount and it's not working, you should make sure that the block-level device is mounted. You can't directly mount a subdirectory of a partition without first mounting the partition.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 27 '14 at 14:31

























            answered Oct 24 '12 at 17:03









            OliOli

            220k85558762




            220k85558762








            • 1




              yup symlink worked, thanks for the help!
              – user100541
              Oct 24 '12 at 18:16










            • Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
              – JoshStrange
              Oct 31 '14 at 15:31






            • 2




              mount --bind source destination
              – Michel Samia
              Nov 27 '14 at 14:03






            • 4




              mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
              – abyss.7
              Nov 20 '15 at 10:46






            • 1




              @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
              – Oli
              Apr 7 '17 at 8:59
















            • 1




              yup symlink worked, thanks for the help!
              – user100541
              Oct 24 '12 at 18:16










            • Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
              – JoshStrange
              Oct 31 '14 at 15:31






            • 2




              mount --bind source destination
              – Michel Samia
              Nov 27 '14 at 14:03






            • 4




              mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
              – abyss.7
              Nov 20 '15 at 10:46






            • 1




              @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
              – Oli
              Apr 7 '17 at 8:59










            1




            1




            yup symlink worked, thanks for the help!
            – user100541
            Oct 24 '12 at 18:16




            yup symlink worked, thanks for the help!
            – user100541
            Oct 24 '12 at 18:16












            Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
            – JoshStrange
            Oct 31 '14 at 15:31




            Thanks for the fstab trick. I use mount --bind to "link" folders into a users home folder that I expose to my friends (symlink doesn't play well with chroot) and now I don't have to re-do it or run a script that does it after each reboot. Not sure why I didn't think of using fstab before as I use it for all my media drives. Thanks again!
            – JoshStrange
            Oct 31 '14 at 15:31




            2




            2




            mount --bind source destination
            – Michel Samia
            Nov 27 '14 at 14:03




            mount --bind source destination
            – Michel Samia
            Nov 27 '14 at 14:03




            4




            4




            mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
            – abyss.7
            Nov 20 '15 at 10:46




            mount --bind is useful in chroot'ed environment - since symlinks doesn't work there.
            – abyss.7
            Nov 20 '15 at 10:46




            1




            1




            @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
            – Oli
            Apr 7 '17 at 8:59






            @GabrielStaples Nope. man fstab will tell you the final two fields Defaults to zero (don't {dump,fsck}) if not present.
            – Oli
            Apr 7 '17 at 8:59















            1














            An alternative to mount:



            bindfs -n /media/tc1/folder /home/dvad/home


            Requires sudo apt-install bindfs.



            Like with mount, this will be a (non-permanent) actual mount point, i.e. for instance not tracked as only a reference but version-control systems. But like ln -s, it does not require superuser permissions like mount does.



            Unmount with fusermount -u /home/dvad/home (or by restarting).






            share|improve this answer


























              1














              An alternative to mount:



              bindfs -n /media/tc1/folder /home/dvad/home


              Requires sudo apt-install bindfs.



              Like with mount, this will be a (non-permanent) actual mount point, i.e. for instance not tracked as only a reference but version-control systems. But like ln -s, it does not require superuser permissions like mount does.



              Unmount with fusermount -u /home/dvad/home (or by restarting).






              share|improve this answer
























                1












                1








                1






                An alternative to mount:



                bindfs -n /media/tc1/folder /home/dvad/home


                Requires sudo apt-install bindfs.



                Like with mount, this will be a (non-permanent) actual mount point, i.e. for instance not tracked as only a reference but version-control systems. But like ln -s, it does not require superuser permissions like mount does.



                Unmount with fusermount -u /home/dvad/home (or by restarting).






                share|improve this answer












                An alternative to mount:



                bindfs -n /media/tc1/folder /home/dvad/home


                Requires sudo apt-install bindfs.



                Like with mount, this will be a (non-permanent) actual mount point, i.e. for instance not tracked as only a reference but version-control systems. But like ln -s, it does not require superuser permissions like mount does.



                Unmount with fusermount -u /home/dvad/home (or by restarting).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 5 '18 at 13:09









                leftaroundaboutleftaroundabout

                549213




                549213






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f205841%2fhow-do-i-mount-a-folder-from-another-partition%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to change which sound is reproduced for terminal bell?

                    Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?