What happens when you make a hard link to a file in /mnt, and then unmount?How to make and restore incremental snapshots of hard diskWhy are hard links not allowed for directories?Mount and unmount errors when usb is connected in 12.10.What are some typical uses of hard links?Are softlinks and hardlinks somewhat related to mutable and immutable objects (in java) in any sense?Default number of links for directory?Mount an ext hard drive and then delete the target mount folderWhat is a file system seen as by the OS?Nautilus - no support for hard links?Make link open target file, not file at link location

What is better: yes / no radio, or simple checkbox?

Sampling from Gaussian mixture models, when are the sampled data independent?

What should I do when a paper is published similar to my PhD thesis without citation?

Can I negotiate a patent idea for a raise, under French law?

Does the US political system, in principle, allow for a no-party system?

Can the Witch Sight warlock invocation see through the Mirror Image spell?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

What was so special about The Piano that Ada was willing to do anything to have it?

Are these two graphs isomorphic? Why/Why not?

Trocar background-image com delay via jQuery

Writing text next to a table

Are small insurances worth it?

Is there a way to make cleveref distinguish two environments with the same counter?

Difference between `nmap local-IP-address` and `nmap localhost`

Can one live in the U.S. and not use a credit card?

Why is there an extra space when I type "ls" on the Desktop?

If sound is a longitudinal wave, why can we hear it if our ears aren't aligned with the propagation direction?

Professor forcing me to attend a conference, I can't afford even with 50% funding

What does *dead* mean in *What do you mean, dead?*?

Either of .... (Plural/Singular)

Is it possible to clone a polymorphic object without manually adding overridden clone method into each derived class in C++?

Which country has more?

How to write a chaotic neutral protagonist and prevent my readers from thinking they are evil?

Graphic representation of a triangle using ArrayPlot



What happens when you make a hard link to a file in /mnt, and then unmount?


How to make and restore incremental snapshots of hard diskWhy are hard links not allowed for directories?Mount and unmount errors when usb is connected in 12.10.What are some typical uses of hard links?Are softlinks and hardlinks somewhat related to mutable and immutable objects (in java) in any sense?Default number of links for directory?Mount an ext hard drive and then delete the target mount folderWhat is a file system seen as by the OS?Nautilus - no support for hard links?Make link open target file, not file at link location













3















As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.



But what happens when you mount a file system to /mnt for example, create a hard link to a file on that volume, unmount the volume, and then try to open the hard link?










share|improve this question




























    3















    As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.



    But what happens when you mount a file system to /mnt for example, create a hard link to a file on that volume, unmount the volume, and then try to open the hard link?










    share|improve this question


























      3












      3








      3








      As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.



      But what happens when you mount a file system to /mnt for example, create a hard link to a file on that volume, unmount the volume, and then try to open the hard link?










      share|improve this question
















      As far as I know, hard links will not break when a file is deleted. Because the file will remain to exist.



      But what happens when you mount a file system to /mnt for example, create a hard link to a file on that volume, unmount the volume, and then try to open the hard link?







      mount filesystem hard-link






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 5 hours ago









      Volker Siegel

      9,09043350




      9,09043350










      asked Apr 14 '15 at 18:27









      latias1290latias1290

      1861620




      1861620




















          2 Answers
          2






          active

          oldest

          votes


















          5














          You cannot create hardlinks across mount boundaries. You'll get something like:



          ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link





          share|improve this answer






























            0














            Yes, hard links will not break when a file is deleted. Because the file will remain to exist.



            But a hard link to a file on a different file system is not possible, in a fundamental way.



            Practically, that means you can not create hard links to files on different file systems, and get an error when trying.



            Now, why is it not possible?



            A hard link is what you normally call a file. When there is a file system mounted in /mnt, and you see /mnt/example.txt, you see the name of the hard link example.txt on the file system in /mnt, that points to the data of thee file.
            A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.



            Creating a hard link means to create a reference to the same file data with a new name.



            So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.



            In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.



            With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text






            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%2f609287%2fwhat-happens-when-you-make-a-hard-link-to-a-file-in-mnt-and-then-unmount%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









              5














              You cannot create hardlinks across mount boundaries. You'll get something like:



              ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link





              share|improve this answer



























                5














                You cannot create hardlinks across mount boundaries. You'll get something like:



                ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link





                share|improve this answer

























                  5












                  5








                  5







                  You cannot create hardlinks across mount boundaries. You'll get something like:



                  ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link





                  share|improve this answer













                  You cannot create hardlinks across mount boundaries. You'll get something like:



                  ln: failed to create hard link ‘X’ => ‘Y’: Invalid cross-device link






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Apr 14 '15 at 18:32









                  Michael TerryMichael Terry

                  3,3901431




                  3,3901431























                      0














                      Yes, hard links will not break when a file is deleted. Because the file will remain to exist.



                      But a hard link to a file on a different file system is not possible, in a fundamental way.



                      Practically, that means you can not create hard links to files on different file systems, and get an error when trying.



                      Now, why is it not possible?



                      A hard link is what you normally call a file. When there is a file system mounted in /mnt, and you see /mnt/example.txt, you see the name of the hard link example.txt on the file system in /mnt, that points to the data of thee file.
                      A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.



                      Creating a hard link means to create a reference to the same file data with a new name.



                      So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.



                      In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.



                      With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text






                      share|improve this answer



























                        0














                        Yes, hard links will not break when a file is deleted. Because the file will remain to exist.



                        But a hard link to a file on a different file system is not possible, in a fundamental way.



                        Practically, that means you can not create hard links to files on different file systems, and get an error when trying.



                        Now, why is it not possible?



                        A hard link is what you normally call a file. When there is a file system mounted in /mnt, and you see /mnt/example.txt, you see the name of the hard link example.txt on the file system in /mnt, that points to the data of thee file.
                        A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.



                        Creating a hard link means to create a reference to the same file data with a new name.



                        So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.



                        In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.



                        With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text






                        share|improve this answer

























                          0












                          0








                          0







                          Yes, hard links will not break when a file is deleted. Because the file will remain to exist.



                          But a hard link to a file on a different file system is not possible, in a fundamental way.



                          Practically, that means you can not create hard links to files on different file systems, and get an error when trying.



                          Now, why is it not possible?



                          A hard link is what you normally call a file. When there is a file system mounted in /mnt, and you see /mnt/example.txt, you see the name of the hard link example.txt on the file system in /mnt, that points to the data of thee file.
                          A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.



                          Creating a hard link means to create a reference to the same file data with a new name.



                          So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.



                          In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.



                          With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text






                          share|improve this answer













                          Yes, hard links will not break when a file is deleted. Because the file will remain to exist.



                          But a hard link to a file on a different file system is not possible, in a fundamental way.



                          Practically, that means you can not create hard links to files on different file systems, and get an error when trying.



                          Now, why is it not possible?



                          A hard link is what you normally call a file. When there is a file system mounted in /mnt, and you see /mnt/example.txt, you see the name of the hard link example.txt on the file system in /mnt, that points to the data of thee file.
                          A file system contains file data and file names to access parts of the data. There is a reference from the name to the data. This reference is a hard link.



                          Creating a hard link means to create a reference to the same file data with a new name.



                          So a hard link is a central part of a file system, referencing the data. That means that a hard link to a different file system is not possible - because it is a different file system.



                          In principle, there could be a file system that spans more than one partition, and enlarges when adding /mnt to it. Then a hard link to a different partition, but in the same file system could be created, and would break when the partition with the data is unmounted.



                          With this reasons, it's not only that a hard link to a different file system can not be created, but that it can not even exist by definition.strong text







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 5 hours ago









                          Volker SiegelVolker Siegel

                          9,09043350




                          9,09043350



























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f609287%2fwhat-happens-when-you-make-a-hard-link-to-a-file-in-mnt-and-then-unmount%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

                              Möglingen Índice Localización Historia Demografía Referencias Enlaces externos Menú de navegación48°53′18″N 9°07′45″E / 48.888333333333, 9.129166666666748°53′18″N 9°07′45″E / 48.888333333333, 9.1291666666667Sitio web oficial Mapa de Möglingen«Gemeinden in Deutschland nach Fläche, Bevölkerung und Postleitzahl am 30.09.2016»Möglingen

                              Virtualbox - Configuration error: Querying “UUID” failed (VERR_CFGM_VALUE_NOT_FOUND)“VERR_SUPLIB_WORLD_WRITABLE” error when trying to installing OS in virtualboxVirtual Box Kernel errorFailed to open a seesion for the virtual machineFailed to open a session for the virtual machineUbuntu 14.04 LTS Virtualbox errorcan't use VM VirtualBoxusing virtualboxI can't run Linux-64 Bit on VirtualBoxUnable to insert the virtual optical disk (VBoxguestaddition) in virtual machine for ubuntu server in win 10VirtuaBox in Ubuntu 18.04 Issues with Win10.ISO Installation

                              Torre de la Isleta Índice Véase también Referencias Bibliografía Enlaces externos Menú de navegación38°25′58″N 0°23′02″O / 38.43277778, -0.3838888938°25′58″N 0°23′02″O / 38.43277778, -0.38388889Torre de la Illeta de l’Horta o Torre Saleta. Base de datos de bienes inmuebles. Patrimonio Cultural. Secretaría de Estado de CulturaFicha BIC Torre de la Illeta de l’Horta. Dirección General de Patrimonio Cultural. Generalitat ValencianaLugares de interés. Ayuntamiento del CampelloTorre de la Isleta en CastillosNet.org