Meaning of root in GRUB config file

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





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








2















Refering to here



with a configuration as



grub> root (hd0,0)
grub> kernel /vmlinuz-i686-up-4GB root=/dev/hda9
grub> boot

The preceding is usually sufficient to boot a Linux box. The standalone root statement tells the partition containing the kernel. The kernel statement describes the path and filename, within the partition containing the kernel of the kernel. The argument to the root= argument to the kernel statement tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

Be careful of these duelling root keywords. The standalone one is the root as seen from grub, and contains the kernel. The argument to the kernel statement is the root as seen from the fully booted system, and contains /sbin/init.


I don't quite get the meaning of the 2 root configs. Does it mean the OS stays on /dev/hda9 to be mounted on (hd0, 0), or the OS is /vmlinuz to be mounted to /dev/had9 ?










share|improve this question




























    2















    Refering to here



    with a configuration as



    grub> root (hd0,0)
    grub> kernel /vmlinuz-i686-up-4GB root=/dev/hda9
    grub> boot

    The preceding is usually sufficient to boot a Linux box. The standalone root statement tells the partition containing the kernel. The kernel statement describes the path and filename, within the partition containing the kernel of the kernel. The argument to the root= argument to the kernel statement tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

    Be careful of these duelling root keywords. The standalone one is the root as seen from grub, and contains the kernel. The argument to the kernel statement is the root as seen from the fully booted system, and contains /sbin/init.


    I don't quite get the meaning of the 2 root configs. Does it mean the OS stays on /dev/hda9 to be mounted on (hd0, 0), or the OS is /vmlinuz to be mounted to /dev/had9 ?










    share|improve this question
























      2












      2








      2


      1






      Refering to here



      with a configuration as



      grub> root (hd0,0)
      grub> kernel /vmlinuz-i686-up-4GB root=/dev/hda9
      grub> boot

      The preceding is usually sufficient to boot a Linux box. The standalone root statement tells the partition containing the kernel. The kernel statement describes the path and filename, within the partition containing the kernel of the kernel. The argument to the root= argument to the kernel statement tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

      Be careful of these duelling root keywords. The standalone one is the root as seen from grub, and contains the kernel. The argument to the kernel statement is the root as seen from the fully booted system, and contains /sbin/init.


      I don't quite get the meaning of the 2 root configs. Does it mean the OS stays on /dev/hda9 to be mounted on (hd0, 0), or the OS is /vmlinuz to be mounted to /dev/had9 ?










      share|improve this question














      Refering to here



      with a configuration as



      grub> root (hd0,0)
      grub> kernel /vmlinuz-i686-up-4GB root=/dev/hda9
      grub> boot

      The preceding is usually sufficient to boot a Linux box. The standalone root statement tells the partition containing the kernel. The kernel statement describes the path and filename, within the partition containing the kernel of the kernel. The argument to the root= argument to the kernel statement tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

      Be careful of these duelling root keywords. The standalone one is the root as seen from grub, and contains the kernel. The argument to the kernel statement is the root as seen from the fully booted system, and contains /sbin/init.


      I don't quite get the meaning of the 2 root configs. Does it mean the OS stays on /dev/hda9 to be mounted on (hd0, 0), or the OS is /vmlinuz to be mounted to /dev/had9 ?







      mount configuration root grub grub-legacy






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 15 '16 at 11:07









      KennyKenny

      52511019




      52511019




















          2 Answers
          2






          active

          oldest

          votes


















          1















          root (hd0,0) - Configures the root partition for GRUB, such as (hd0,0) first hard disk, first Partition and mounts the partition.



          kernel /vmlinuz-i686-up-4GB root=/dev/hda9 - Specifies the kernel location which is inside the /boot folder. This location is related to the root(hd0,0) statement.The root partition is specified according to the Linux naming convention (/dev/hda9/)




          The Kernel image will be mounted on root file system (/dev/hda9)






          share|improve this answer


















          • 1





            The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

            – Chris Down
            Jan 15 '16 at 12:10






          • 1





            Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

            – Siddharth sharma
            Jan 15 '16 at 12:16











          • Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

            – Kenny
            Jan 15 '16 at 14:04







          • 1





            @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

            – Siddharth sharma
            Jan 16 '16 at 5:21



















          0














          The way I have my system, on /dev/sda1-3.
          The first partition of my hardisk is sda1 and contains the boot partition.
          I have a swap drive in sda2. I have my main partition in sda3. Sda3 holds the root "/" directory and all its subdirectories like /etc, and /usr.



          In my Grub.cfg I have set



          set root=(hostdisk//dev/sda,gpt1)


          This lets the bootloader find the kernel files before any filesystem is ready. Technically you are booting sda1.



          When the kernel loads and mounts the drives in the fstab, root "/" itself is on sda3, but /boot (the files that booted) are mounted to sda1.



          linux /kernel-genkernel-x86_64-4.9.144-3 root=/dev/sda3 real_root=/dev/sda3 rootfstype=ext4
          initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.9.144-3


          So even though the system booted with the files on sda1, the root "/" is really on sda3.






          share|improve this answer

























            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/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%2funix.stackexchange.com%2fquestions%2f255503%2fmeaning-of-root-in-grub-config-file%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









            1















            root (hd0,0) - Configures the root partition for GRUB, such as (hd0,0) first hard disk, first Partition and mounts the partition.



            kernel /vmlinuz-i686-up-4GB root=/dev/hda9 - Specifies the kernel location which is inside the /boot folder. This location is related to the root(hd0,0) statement.The root partition is specified according to the Linux naming convention (/dev/hda9/)




            The Kernel image will be mounted on root file system (/dev/hda9)






            share|improve this answer


















            • 1





              The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

              – Chris Down
              Jan 15 '16 at 12:10






            • 1





              Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

              – Siddharth sharma
              Jan 15 '16 at 12:16











            • Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

              – Kenny
              Jan 15 '16 at 14:04







            • 1





              @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

              – Siddharth sharma
              Jan 16 '16 at 5:21
















            1















            root (hd0,0) - Configures the root partition for GRUB, such as (hd0,0) first hard disk, first Partition and mounts the partition.



            kernel /vmlinuz-i686-up-4GB root=/dev/hda9 - Specifies the kernel location which is inside the /boot folder. This location is related to the root(hd0,0) statement.The root partition is specified according to the Linux naming convention (/dev/hda9/)




            The Kernel image will be mounted on root file system (/dev/hda9)






            share|improve this answer


















            • 1





              The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

              – Chris Down
              Jan 15 '16 at 12:10






            • 1





              Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

              – Siddharth sharma
              Jan 15 '16 at 12:16











            • Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

              – Kenny
              Jan 15 '16 at 14:04







            • 1





              @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

              – Siddharth sharma
              Jan 16 '16 at 5:21














            1












            1








            1








            root (hd0,0) - Configures the root partition for GRUB, such as (hd0,0) first hard disk, first Partition and mounts the partition.



            kernel /vmlinuz-i686-up-4GB root=/dev/hda9 - Specifies the kernel location which is inside the /boot folder. This location is related to the root(hd0,0) statement.The root partition is specified according to the Linux naming convention (/dev/hda9/)




            The Kernel image will be mounted on root file system (/dev/hda9)






            share|improve this answer














            root (hd0,0) - Configures the root partition for GRUB, such as (hd0,0) first hard disk, first Partition and mounts the partition.



            kernel /vmlinuz-i686-up-4GB root=/dev/hda9 - Specifies the kernel location which is inside the /boot folder. This location is related to the root(hd0,0) statement.The root partition is specified according to the Linux naming convention (/dev/hda9/)




            The Kernel image will be mounted on root file system (/dev/hda9)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 15 '16 at 11:34









            Siddharth sharmaSiddharth sharma

            1214




            1214







            • 1





              The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

              – Chris Down
              Jan 15 '16 at 12:10






            • 1





              Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

              – Siddharth sharma
              Jan 15 '16 at 12:16











            • Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

              – Kenny
              Jan 15 '16 at 14:04







            • 1





              @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

              – Siddharth sharma
              Jan 16 '16 at 5:21













            • 1





              The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

              – Chris Down
              Jan 15 '16 at 12:10






            • 1





              Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

              – Siddharth sharma
              Jan 15 '16 at 12:16











            • Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

              – Kenny
              Jan 15 '16 at 14:04







            • 1





              @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

              – Siddharth sharma
              Jan 16 '16 at 5:21








            1




            1





            The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

            – Chris Down
            Jan 15 '16 at 12:10





            The kernel image isn't "mounted on [the] root file system", the root file system is (by the kernel). :-)

            – Chris Down
            Jan 15 '16 at 12:10




            1




            1





            Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

            – Siddharth sharma
            Jan 15 '16 at 12:16





            Basically root= tells the partition containing /sbin/init, which of course turns out to be the root partition in the booted system.

            – Siddharth sharma
            Jan 15 '16 at 12:16













            Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

            – Kenny
            Jan 15 '16 at 14:04






            Can you elaborate ? You mentioned the root partion as (hd0,0) and later said the root partition /dev/hda9. The root partition for GRUB, from my understanding, is where the GRUb config files stays. But it has nothing to do with where the OS is. For example here, GRUB config is read from (hd0,0), the OS is in /vmlinuz which will be mounted at /dev/hda9

            – Kenny
            Jan 15 '16 at 14:04





            1




            1





            @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

            – Siddharth sharma
            Jan 16 '16 at 5:21






            @Kenny root(hd0,0) tells the grub where it's configuration files are located. In this case, they can be found under (hd0,0)/boot/grub. And, kernel /vmlinuz-i686-up-4GB root=/dev/hda9 specifies the actual kernel image location from where it can be read, which is inside the /boot folder. There can be many kernel images. root=/dev/hda9 specifies the location of your root ( "/") partition of the OS.

            – Siddharth sharma
            Jan 16 '16 at 5:21














            0














            The way I have my system, on /dev/sda1-3.
            The first partition of my hardisk is sda1 and contains the boot partition.
            I have a swap drive in sda2. I have my main partition in sda3. Sda3 holds the root "/" directory and all its subdirectories like /etc, and /usr.



            In my Grub.cfg I have set



            set root=(hostdisk//dev/sda,gpt1)


            This lets the bootloader find the kernel files before any filesystem is ready. Technically you are booting sda1.



            When the kernel loads and mounts the drives in the fstab, root "/" itself is on sda3, but /boot (the files that booted) are mounted to sda1.



            linux /kernel-genkernel-x86_64-4.9.144-3 root=/dev/sda3 real_root=/dev/sda3 rootfstype=ext4
            initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.9.144-3


            So even though the system booted with the files on sda1, the root "/" is really on sda3.






            share|improve this answer





























              0














              The way I have my system, on /dev/sda1-3.
              The first partition of my hardisk is sda1 and contains the boot partition.
              I have a swap drive in sda2. I have my main partition in sda3. Sda3 holds the root "/" directory and all its subdirectories like /etc, and /usr.



              In my Grub.cfg I have set



              set root=(hostdisk//dev/sda,gpt1)


              This lets the bootloader find the kernel files before any filesystem is ready. Technically you are booting sda1.



              When the kernel loads and mounts the drives in the fstab, root "/" itself is on sda3, but /boot (the files that booted) are mounted to sda1.



              linux /kernel-genkernel-x86_64-4.9.144-3 root=/dev/sda3 real_root=/dev/sda3 rootfstype=ext4
              initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.9.144-3


              So even though the system booted with the files on sda1, the root "/" is really on sda3.






              share|improve this answer



























                0












                0








                0







                The way I have my system, on /dev/sda1-3.
                The first partition of my hardisk is sda1 and contains the boot partition.
                I have a swap drive in sda2. I have my main partition in sda3. Sda3 holds the root "/" directory and all its subdirectories like /etc, and /usr.



                In my Grub.cfg I have set



                set root=(hostdisk//dev/sda,gpt1)


                This lets the bootloader find the kernel files before any filesystem is ready. Technically you are booting sda1.



                When the kernel loads and mounts the drives in the fstab, root "/" itself is on sda3, but /boot (the files that booted) are mounted to sda1.



                linux /kernel-genkernel-x86_64-4.9.144-3 root=/dev/sda3 real_root=/dev/sda3 rootfstype=ext4
                initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.9.144-3


                So even though the system booted with the files on sda1, the root "/" is really on sda3.






                share|improve this answer















                The way I have my system, on /dev/sda1-3.
                The first partition of my hardisk is sda1 and contains the boot partition.
                I have a swap drive in sda2. I have my main partition in sda3. Sda3 holds the root "/" directory and all its subdirectories like /etc, and /usr.



                In my Grub.cfg I have set



                set root=(hostdisk//dev/sda,gpt1)


                This lets the bootloader find the kernel files before any filesystem is ready. Technically you are booting sda1.



                When the kernel loads and mounts the drives in the fstab, root "/" itself is on sda3, but /boot (the files that booted) are mounted to sda1.



                linux /kernel-genkernel-x86_64-4.9.144-3 root=/dev/sda3 real_root=/dev/sda3 rootfstype=ext4
                initrd /early_ucode.cpio /initramfs-genkernel-x86_64-4.9.144-3


                So even though the system booted with the files on sda1, the root "/" is really on sda3.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 18 at 2:49

























                answered Mar 18 at 2:37









                EngineerEngineer

                1014




                1014



























                    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%2f255503%2fmeaning-of-root-in-grub-config-file%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 check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay