How does the Linux command “mount -a” work?Have to run partprobe at every boothow should I mount my ext4 partition in fstabbind mounting and df outputProblems with (local) mount at boot (sysvinit)How to hide original mount points with bind mount?umount a busy device without killing process?fstab mount options for /etc /opt /var partitionsWhy does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?

Is there a Ukrainian transcript of Trump's controversial July 25 call to President Zelensky?

Is homebrew Martial Spear as balanced as the Chultan spear (yklwa)?

Peano's dot notation

Log user out after change of IP address?

Is (manual) feature extraction outdated?

Removing characters from end of string from character to character

What would an inclusive curriculum look like in a computer science course?

Dodging a Deathbeam travelling at speed of light

Decrypt T-SQL log backup header and read LSN

A question about modulus for polynomials

How do you link two checking accounts from two different banks in two different countries?

How exactly do you avoid fooling yourself?

What is the type of English used in the King James Bible Called?

Why is the HTTP protocol more susceptible to being intercepted than the BitTorrent protocol?

Is this bible in Koine Greek?

how can I enforce the prohibition on love potions?

What does "2 fingers to Scotland" mean in Peter Grant's statement about Johnson not listening to the SNP's Westminster leader speeches?

Were mixed race kids theorized to look like zebras?

I was mistakenly identified as a criminal, and this has caused rumors. How can I convince my friends that it is all a mistake?

How does Deep Packet Inspection work with encrypted packets?

Would the US government of the 1960’s be able to feasibly recreate a modern laptop?

Tapping 3 times on one leg and 4 times on another leg in 4 beats. What is it called and how to do it?

Do dead weight 'components' exist?

What is the topology on the set of field orders



How does the Linux command “mount -a” work?


Have to run partprobe at every boothow should I mount my ext4 partition in fstabbind mounting and df outputProblems with (local) mount at boot (sysvinit)How to hide original mount points with bind mount?umount a busy device without killing process?fstab mount options for /etc /opt /var partitionsWhy does a copy operation to a directory that serves as a mountpoint not copy the data to the mounted drive?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









7

















After adding a new mount point in /etc/fstab, we usually execute mount -a to reflect the change (if we want to bypass reboot), and df -kh output shows the new mount point.



How does mount -a work/impact already mounted partitions, which have reference to the /etc/fstab file?  Does it umount and then mount those partitions, or just ignore them since they are already mounted?










share|improve this question























  • 1





    Why do you usually run mount -a instead of just mount <thenewmountpoint>?

    – RonJohn
    Jun 15 at 4:11

















7

















After adding a new mount point in /etc/fstab, we usually execute mount -a to reflect the change (if we want to bypass reboot), and df -kh output shows the new mount point.



How does mount -a work/impact already mounted partitions, which have reference to the /etc/fstab file?  Does it umount and then mount those partitions, or just ignore them since they are already mounted?










share|improve this question























  • 1





    Why do you usually run mount -a instead of just mount <thenewmountpoint>?

    – RonJohn
    Jun 15 at 4:11













7












7








7


1






After adding a new mount point in /etc/fstab, we usually execute mount -a to reflect the change (if we want to bypass reboot), and df -kh output shows the new mount point.



How does mount -a work/impact already mounted partitions, which have reference to the /etc/fstab file?  Does it umount and then mount those partitions, or just ignore them since they are already mounted?










share|improve this question

















After adding a new mount point in /etc/fstab, we usually execute mount -a to reflect the change (if we want to bypass reboot), and df -kh output shows the new mount point.



How does mount -a work/impact already mounted partitions, which have reference to the /etc/fstab file?  Does it umount and then mount those partitions, or just ignore them since they are already mounted?







linux mount partition fstab






share|improve this question
















share|improve this question













share|improve this question




share|improve this question








edited Jun 15 at 4:11









G-Man

15.6k9 gold badges45 silver badges89 bronze badges




15.6k9 gold badges45 silver badges89 bronze badges










asked Jun 14 at 10:54









RaufRauf

541 silver badge2 bronze badges




541 silver badge2 bronze badges










  • 1





    Why do you usually run mount -a instead of just mount <thenewmountpoint>?

    – RonJohn
    Jun 15 at 4:11












  • 1





    Why do you usually run mount -a instead of just mount <thenewmountpoint>?

    – RonJohn
    Jun 15 at 4:11







1




1





Why do you usually run mount -a instead of just mount <thenewmountpoint>?

– RonJohn
Jun 15 at 4:11





Why do you usually run mount -a instead of just mount <thenewmountpoint>?

– RonJohn
Jun 15 at 4:11










3 Answers
3






active

oldest

votes


















14


















It skips ones already mounted.



https://github.com/karelzak/util-linux/blob/master/sys-utils/mount.c#L185-L193



while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) 

const char *tgt = mnt_fs_get_target(fs);

if (ignored)
if (mnt_context_is_verbose(cxt))
printf(ignored == 1 ? _("%-25s: ignoredn") :
_("%-25s: already mountedn"),
tgt);

// ...






share|improve this answer



































    5


















    It will ignore already mounted partitions.



    In the same time, you can do a mount -o remount /dev/xxx on a partition already mounted, this won't cause any problem even if users are using this partition






    share|improve this answer

































      0


















      The better option would be mount the new file system manually and add the new file system entry in the /etc/fstab to make sure this f/s get mounted on every reboot.



      As mentioned above "mount -a" will ignore the already mounted file systems and mount only the file system which was not mounted yet (new file system).



      Hope this will helps.






      share|improve this answer


























      • I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

        – Rauf
        Jun 23 at 13:56












      Your Answer








      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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/4.0/"u003ecc by-sa 4.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%2funix.stackexchange.com%2fquestions%2f524871%2fhow-does-the-linux-command-mount-a-work%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      14


















      It skips ones already mounted.



      https://github.com/karelzak/util-linux/blob/master/sys-utils/mount.c#L185-L193



      while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) 

      const char *tgt = mnt_fs_get_target(fs);

      if (ignored)
      if (mnt_context_is_verbose(cxt))
      printf(ignored == 1 ? _("%-25s: ignoredn") :
      _("%-25s: already mountedn"),
      tgt);

      // ...






      share|improve this answer
































        14


















        It skips ones already mounted.



        https://github.com/karelzak/util-linux/blob/master/sys-utils/mount.c#L185-L193



        while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) 

        const char *tgt = mnt_fs_get_target(fs);

        if (ignored)
        if (mnt_context_is_verbose(cxt))
        printf(ignored == 1 ? _("%-25s: ignoredn") :
        _("%-25s: already mountedn"),
        tgt);

        // ...






        share|improve this answer






























          14














          14










          14









          It skips ones already mounted.



          https://github.com/karelzak/util-linux/blob/master/sys-utils/mount.c#L185-L193



          while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) 

          const char *tgt = mnt_fs_get_target(fs);

          if (ignored)
          if (mnt_context_is_verbose(cxt))
          printf(ignored == 1 ? _("%-25s: ignoredn") :
          _("%-25s: already mountedn"),
          tgt);

          // ...






          share|improve this answer
















          It skips ones already mounted.



          https://github.com/karelzak/util-linux/blob/master/sys-utils/mount.c#L185-L193



          while (mnt_context_next_mount(cxt, itr, &fs, &mntrc, &ignored) == 0) 

          const char *tgt = mnt_fs_get_target(fs);

          if (ignored)
          if (mnt_context_is_verbose(cxt))
          printf(ignored == 1 ? _("%-25s: ignoredn") :
          _("%-25s: already mountedn"),
          tgt);

          // ...







          share|improve this answer















          share|improve this answer




          share|improve this answer








          edited Jun 15 at 6:01









          Henry Malinowski

          3882 silver badges6 bronze badges




          3882 silver badges6 bronze badges










          answered Jun 14 at 11:01









          stevesteve

          15.1k2 gold badges29 silver badges57 bronze badges




          15.1k2 gold badges29 silver badges57 bronze badges


























              5


















              It will ignore already mounted partitions.



              In the same time, you can do a mount -o remount /dev/xxx on a partition already mounted, this won't cause any problem even if users are using this partition






              share|improve this answer






























                5


















                It will ignore already mounted partitions.



                In the same time, you can do a mount -o remount /dev/xxx on a partition already mounted, this won't cause any problem even if users are using this partition






                share|improve this answer




























                  5














                  5










                  5









                  It will ignore already mounted partitions.



                  In the same time, you can do a mount -o remount /dev/xxx on a partition already mounted, this won't cause any problem even if users are using this partition






                  share|improve this answer














                  It will ignore already mounted partitions.



                  In the same time, you can do a mount -o remount /dev/xxx on a partition already mounted, this won't cause any problem even if users are using this partition







                  share|improve this answer













                  share|improve this answer




                  share|improve this answer










                  answered Jun 14 at 11:01









                  darxmurfdarxmurf

                  71912 bronze badges




                  71912 bronze badges
























                      0


















                      The better option would be mount the new file system manually and add the new file system entry in the /etc/fstab to make sure this f/s get mounted on every reboot.



                      As mentioned above "mount -a" will ignore the already mounted file systems and mount only the file system which was not mounted yet (new file system).



                      Hope this will helps.






                      share|improve this answer


























                      • I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                        – Rauf
                        Jun 23 at 13:56















                      0


















                      The better option would be mount the new file system manually and add the new file system entry in the /etc/fstab to make sure this f/s get mounted on every reboot.



                      As mentioned above "mount -a" will ignore the already mounted file systems and mount only the file system which was not mounted yet (new file system).



                      Hope this will helps.






                      share|improve this answer


























                      • I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                        – Rauf
                        Jun 23 at 13:56













                      0














                      0










                      0









                      The better option would be mount the new file system manually and add the new file system entry in the /etc/fstab to make sure this f/s get mounted on every reboot.



                      As mentioned above "mount -a" will ignore the already mounted file systems and mount only the file system which was not mounted yet (new file system).



                      Hope this will helps.






                      share|improve this answer














                      The better option would be mount the new file system manually and add the new file system entry in the /etc/fstab to make sure this f/s get mounted on every reboot.



                      As mentioned above "mount -a" will ignore the already mounted file systems and mount only the file system which was not mounted yet (new file system).



                      Hope this will helps.







                      share|improve this answer













                      share|improve this answer




                      share|improve this answer










                      answered Jun 15 at 17:38









                      Prithvirajan BalakrishnanPrithvirajan Balakrishnan

                      595 bronze badges




                      595 bronze badges















                      • I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                        – Rauf
                        Jun 23 at 13:56

















                      • I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                        – Rauf
                        Jun 23 at 13:56
















                      I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                      – Rauf
                      Jun 23 at 13:56





                      I prefer "mount -a" option for a new file system rather than manually mount it. In this way, I'm also verifying if /etc/fstab entry is correct.

                      – Rauf
                      Jun 23 at 13:56


















                      draft saved

                      draft discarded















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • 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%2funix.stackexchange.com%2fquestions%2f524871%2fhow-does-the-linux-command-mount-a-work%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

                      Tamil (spriik) Luke uk diar | Nawigatjuun

                      Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                      Training a classifier when some of the features are unknownWhy does Gradient Boosting regression predict negative values when there are no negative y-values in my training set?How to improve an existing (trained) classifier?What is effect when I set up some self defined predisctor variables?Why Matlab neural network classification returns decimal values on prediction dataset?Fitting and transforming text data in training, testing, and validation setsHow to quantify the performance of the classifier (multi-class SVM) using the test data?How do I control for some patients providing multiple samples in my training data?Training and Test setTraining a convolutional neural network for image denoising in MatlabShouldn't an autoencoder with #(neurons in hidden layer) = #(neurons in input layer) be “perfect”?