What is DISK=/dev/sdX?












0















I am following this link
to create a bootable SD card. I am stuck at mkfs.ext4 <= 1.42.



for: DISK=/dev/mmcblk0


The terminal complains that no 'for' command is found. I suppose I should leave 'for' out? Next:



for: DISK=/dev/sdX
sudo mount ${DISK}1 /media/rootfs/


The terminal throws this error:



mke2fs 1.42.13 (17-May-2015)
The file /dev/sdX1 does not exist and no size was specified.


What am I doing wrong? Also, how can I have mke2fs updated to mke2fs 1.43-WIP (15-Mar-2016)? Thanks.










share|improve this question



























    0















    I am following this link
    to create a bootable SD card. I am stuck at mkfs.ext4 <= 1.42.



    for: DISK=/dev/mmcblk0


    The terminal complains that no 'for' command is found. I suppose I should leave 'for' out? Next:



    for: DISK=/dev/sdX
    sudo mount ${DISK}1 /media/rootfs/


    The terminal throws this error:



    mke2fs 1.42.13 (17-May-2015)
    The file /dev/sdX1 does not exist and no size was specified.


    What am I doing wrong? Also, how can I have mke2fs updated to mke2fs 1.43-WIP (15-Mar-2016)? Thanks.










    share|improve this question

























      0












      0








      0








      I am following this link
      to create a bootable SD card. I am stuck at mkfs.ext4 <= 1.42.



      for: DISK=/dev/mmcblk0


      The terminal complains that no 'for' command is found. I suppose I should leave 'for' out? Next:



      for: DISK=/dev/sdX
      sudo mount ${DISK}1 /media/rootfs/


      The terminal throws this error:



      mke2fs 1.42.13 (17-May-2015)
      The file /dev/sdX1 does not exist and no size was specified.


      What am I doing wrong? Also, how can I have mke2fs updated to mke2fs 1.43-WIP (15-Mar-2016)? Thanks.










      share|improve this question














      I am following this link
      to create a bootable SD card. I am stuck at mkfs.ext4 <= 1.42.



      for: DISK=/dev/mmcblk0


      The terminal complains that no 'for' command is found. I suppose I should leave 'for' out? Next:



      for: DISK=/dev/sdX
      sudo mount ${DISK}1 /media/rootfs/


      The terminal throws this error:



      mke2fs 1.42.13 (17-May-2015)
      The file /dev/sdX1 does not exist and no size was specified.


      What am I doing wrong? Also, how can I have mke2fs updated to mke2fs 1.43-WIP (15-Mar-2016)? Thanks.







      sd-card beagleboard






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 31 '17 at 8:55









      CaTxCaTx

      1045




      1045






















          4 Answers
          4






          active

          oldest

          votes


















          1














          The lines "for: DISK=/dev/mmcblk0" and "for: DISK=/dev/sdX" are for your eyes only, not command lines. "for:"only points to the following instructions in the tutorial, which are command lines and should be run.





          The following command lines set the environment variable DISK





          • for a card connected via a PCI card reader



            DISK=/dev/mmcblk0



          • for a card connected via a USB card reader,



            DISK=/dev/sdX


            In this case you should replace X with the actual drive letter (a, b, c ...), so for example /dev/sdb, that you can identify with the commands



            sudo lsblk --fs     # Output info about filesystems
            sudo lsblk --perms # Output info about device owner, group and mode
            sudo parted -ls # --list: lists partition layout on all block devices; --script: never prompts for user intervention


            In general, you can use the commands above to find out how the card is connected and identified.




          This environment variable is used in the next command in the tutorial as ${DISK}, for example (depending on the version of mkfs.ext4),





          • when connected via PCI



            sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1



          • or when connected via USB



            sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}1



          ${DISK}p1 and ${DISK}1 specify the partition where you want to create an ext4 file system.






          share|improve this answer


























          • Thank you so much! I wish the documentation can be that clear.

            – CaTx
            Dec 31 '17 at 23:21











          • @CaTx, You are welcome :-)

            – sudodus
            Jan 1 '18 at 9:17



















          0














          Instead of using for: try using export command and to the mounting part , like Cornea Valentin said , check if your target is detected by using



          sudo fdisk -l /dev/mmcblk0


          If detected and still there is problem during mounting try this :



          sudo mount -v -t ext4 /dev/mmcblk0 /media/rootfs





          share|improve this answer































            0














            For is not a command, he is giving examples for two different partition labels since /sdX and /mmcblk have different notations for partitions.



            sdX is a generic notation for a block device (HDD, SSD, USB). The "X" is replaced by a letter that is determined by the order in which the device was mounted.



            Change the generic statements he uses for the specific information from your system. Use lsblk to find the label linux is using for your SDcard. Then use that in the statement DISK=.



            Examples:



            DISK=/dev/sdb -- partition=/dev/sdb1  


            or



            DISK=/dev/mmcblk0 -- partition=/dev/mmcblk0p1





            share|improve this answer

































              -1














              check if target really exist with fdisk or gparted



              sudo fdisk -l


              gparted must be installed:



              sudo apt install gparted





              share|improve this answer
























              • Could you elaborate on how the two commands could help OP solving the question ?

                – Soren A
                Dec 31 '17 at 10:46











              • well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                – Cornea Valentin
                Jan 1 '18 at 6:34











              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%2f991016%2fwhat-is-disk-dev-sdx%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              The lines "for: DISK=/dev/mmcblk0" and "for: DISK=/dev/sdX" are for your eyes only, not command lines. "for:"only points to the following instructions in the tutorial, which are command lines and should be run.





              The following command lines set the environment variable DISK





              • for a card connected via a PCI card reader



                DISK=/dev/mmcblk0



              • for a card connected via a USB card reader,



                DISK=/dev/sdX


                In this case you should replace X with the actual drive letter (a, b, c ...), so for example /dev/sdb, that you can identify with the commands



                sudo lsblk --fs     # Output info about filesystems
                sudo lsblk --perms # Output info about device owner, group and mode
                sudo parted -ls # --list: lists partition layout on all block devices; --script: never prompts for user intervention


                In general, you can use the commands above to find out how the card is connected and identified.




              This environment variable is used in the next command in the tutorial as ${DISK}, for example (depending on the version of mkfs.ext4),





              • when connected via PCI



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1



              • or when connected via USB



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}1



              ${DISK}p1 and ${DISK}1 specify the partition where you want to create an ext4 file system.






              share|improve this answer


























              • Thank you so much! I wish the documentation can be that clear.

                – CaTx
                Dec 31 '17 at 23:21











              • @CaTx, You are welcome :-)

                – sudodus
                Jan 1 '18 at 9:17
















              1














              The lines "for: DISK=/dev/mmcblk0" and "for: DISK=/dev/sdX" are for your eyes only, not command lines. "for:"only points to the following instructions in the tutorial, which are command lines and should be run.





              The following command lines set the environment variable DISK





              • for a card connected via a PCI card reader



                DISK=/dev/mmcblk0



              • for a card connected via a USB card reader,



                DISK=/dev/sdX


                In this case you should replace X with the actual drive letter (a, b, c ...), so for example /dev/sdb, that you can identify with the commands



                sudo lsblk --fs     # Output info about filesystems
                sudo lsblk --perms # Output info about device owner, group and mode
                sudo parted -ls # --list: lists partition layout on all block devices; --script: never prompts for user intervention


                In general, you can use the commands above to find out how the card is connected and identified.




              This environment variable is used in the next command in the tutorial as ${DISK}, for example (depending on the version of mkfs.ext4),





              • when connected via PCI



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1



              • or when connected via USB



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}1



              ${DISK}p1 and ${DISK}1 specify the partition where you want to create an ext4 file system.






              share|improve this answer


























              • Thank you so much! I wish the documentation can be that clear.

                – CaTx
                Dec 31 '17 at 23:21











              • @CaTx, You are welcome :-)

                – sudodus
                Jan 1 '18 at 9:17














              1












              1








              1







              The lines "for: DISK=/dev/mmcblk0" and "for: DISK=/dev/sdX" are for your eyes only, not command lines. "for:"only points to the following instructions in the tutorial, which are command lines and should be run.





              The following command lines set the environment variable DISK





              • for a card connected via a PCI card reader



                DISK=/dev/mmcblk0



              • for a card connected via a USB card reader,



                DISK=/dev/sdX


                In this case you should replace X with the actual drive letter (a, b, c ...), so for example /dev/sdb, that you can identify with the commands



                sudo lsblk --fs     # Output info about filesystems
                sudo lsblk --perms # Output info about device owner, group and mode
                sudo parted -ls # --list: lists partition layout on all block devices; --script: never prompts for user intervention


                In general, you can use the commands above to find out how the card is connected and identified.




              This environment variable is used in the next command in the tutorial as ${DISK}, for example (depending on the version of mkfs.ext4),





              • when connected via PCI



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1



              • or when connected via USB



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}1



              ${DISK}p1 and ${DISK}1 specify the partition where you want to create an ext4 file system.






              share|improve this answer















              The lines "for: DISK=/dev/mmcblk0" and "for: DISK=/dev/sdX" are for your eyes only, not command lines. "for:"only points to the following instructions in the tutorial, which are command lines and should be run.





              The following command lines set the environment variable DISK





              • for a card connected via a PCI card reader



                DISK=/dev/mmcblk0



              • for a card connected via a USB card reader,



                DISK=/dev/sdX


                In this case you should replace X with the actual drive letter (a, b, c ...), so for example /dev/sdb, that you can identify with the commands



                sudo lsblk --fs     # Output info about filesystems
                sudo lsblk --perms # Output info about device owner, group and mode
                sudo parted -ls # --list: lists partition layout on all block devices; --script: never prompts for user intervention


                In general, you can use the commands above to find out how the card is connected and identified.




              This environment variable is used in the next command in the tutorial as ${DISK}, for example (depending on the version of mkfs.ext4),





              • when connected via PCI



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}p1



              • or when connected via USB



                sudo mkfs.ext4 -L rootfs -O ^metadata_csum,^64bit ${DISK}1



              ${DISK}p1 and ${DISK}1 specify the partition where you want to create an ext4 file system.







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited 7 hours ago









              Pablo Bianchi

              2,92521535




              2,92521535










              answered Dec 31 '17 at 16:14









              sudodussudodus

              25.1k32977




              25.1k32977













              • Thank you so much! I wish the documentation can be that clear.

                – CaTx
                Dec 31 '17 at 23:21











              • @CaTx, You are welcome :-)

                – sudodus
                Jan 1 '18 at 9:17



















              • Thank you so much! I wish the documentation can be that clear.

                – CaTx
                Dec 31 '17 at 23:21











              • @CaTx, You are welcome :-)

                – sudodus
                Jan 1 '18 at 9:17

















              Thank you so much! I wish the documentation can be that clear.

              – CaTx
              Dec 31 '17 at 23:21





              Thank you so much! I wish the documentation can be that clear.

              – CaTx
              Dec 31 '17 at 23:21













              @CaTx, You are welcome :-)

              – sudodus
              Jan 1 '18 at 9:17





              @CaTx, You are welcome :-)

              – sudodus
              Jan 1 '18 at 9:17













              0














              Instead of using for: try using export command and to the mounting part , like Cornea Valentin said , check if your target is detected by using



              sudo fdisk -l /dev/mmcblk0


              If detected and still there is problem during mounting try this :



              sudo mount -v -t ext4 /dev/mmcblk0 /media/rootfs





              share|improve this answer




























                0














                Instead of using for: try using export command and to the mounting part , like Cornea Valentin said , check if your target is detected by using



                sudo fdisk -l /dev/mmcblk0


                If detected and still there is problem during mounting try this :



                sudo mount -v -t ext4 /dev/mmcblk0 /media/rootfs





                share|improve this answer


























                  0












                  0








                  0







                  Instead of using for: try using export command and to the mounting part , like Cornea Valentin said , check if your target is detected by using



                  sudo fdisk -l /dev/mmcblk0


                  If detected and still there is problem during mounting try this :



                  sudo mount -v -t ext4 /dev/mmcblk0 /media/rootfs





                  share|improve this answer













                  Instead of using for: try using export command and to the mounting part , like Cornea Valentin said , check if your target is detected by using



                  sudo fdisk -l /dev/mmcblk0


                  If detected and still there is problem during mounting try this :



                  sudo mount -v -t ext4 /dev/mmcblk0 /media/rootfs






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Dec 31 '17 at 10:49









                  VijayVijay

                  184




                  184























                      0














                      For is not a command, he is giving examples for two different partition labels since /sdX and /mmcblk have different notations for partitions.



                      sdX is a generic notation for a block device (HDD, SSD, USB). The "X" is replaced by a letter that is determined by the order in which the device was mounted.



                      Change the generic statements he uses for the specific information from your system. Use lsblk to find the label linux is using for your SDcard. Then use that in the statement DISK=.



                      Examples:



                      DISK=/dev/sdb -- partition=/dev/sdb1  


                      or



                      DISK=/dev/mmcblk0 -- partition=/dev/mmcblk0p1





                      share|improve this answer






























                        0














                        For is not a command, he is giving examples for two different partition labels since /sdX and /mmcblk have different notations for partitions.



                        sdX is a generic notation for a block device (HDD, SSD, USB). The "X" is replaced by a letter that is determined by the order in which the device was mounted.



                        Change the generic statements he uses for the specific information from your system. Use lsblk to find the label linux is using for your SDcard. Then use that in the statement DISK=.



                        Examples:



                        DISK=/dev/sdb -- partition=/dev/sdb1  


                        or



                        DISK=/dev/mmcblk0 -- partition=/dev/mmcblk0p1





                        share|improve this answer




























                          0












                          0








                          0







                          For is not a command, he is giving examples for two different partition labels since /sdX and /mmcblk have different notations for partitions.



                          sdX is a generic notation for a block device (HDD, SSD, USB). The "X" is replaced by a letter that is determined by the order in which the device was mounted.



                          Change the generic statements he uses for the specific information from your system. Use lsblk to find the label linux is using for your SDcard. Then use that in the statement DISK=.



                          Examples:



                          DISK=/dev/sdb -- partition=/dev/sdb1  


                          or



                          DISK=/dev/mmcblk0 -- partition=/dev/mmcblk0p1





                          share|improve this answer















                          For is not a command, he is giving examples for two different partition labels since /sdX and /mmcblk have different notations for partitions.



                          sdX is a generic notation for a block device (HDD, SSD, USB). The "X" is replaced by a letter that is determined by the order in which the device was mounted.



                          Change the generic statements he uses for the specific information from your system. Use lsblk to find the label linux is using for your SDcard. Then use that in the statement DISK=.



                          Examples:



                          DISK=/dev/sdb -- partition=/dev/sdb1  


                          or



                          DISK=/dev/mmcblk0 -- partition=/dev/mmcblk0p1






                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Dec 31 '17 at 16:40

























                          answered Dec 31 '17 at 9:23









                          raveryravery

                          5,49351132




                          5,49351132























                              -1














                              check if target really exist with fdisk or gparted



                              sudo fdisk -l


                              gparted must be installed:



                              sudo apt install gparted





                              share|improve this answer
























                              • Could you elaborate on how the two commands could help OP solving the question ?

                                – Soren A
                                Dec 31 '17 at 10:46











                              • well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                                – Cornea Valentin
                                Jan 1 '18 at 6:34
















                              -1














                              check if target really exist with fdisk or gparted



                              sudo fdisk -l


                              gparted must be installed:



                              sudo apt install gparted





                              share|improve this answer
























                              • Could you elaborate on how the two commands could help OP solving the question ?

                                – Soren A
                                Dec 31 '17 at 10:46











                              • well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                                – Cornea Valentin
                                Jan 1 '18 at 6:34














                              -1












                              -1








                              -1







                              check if target really exist with fdisk or gparted



                              sudo fdisk -l


                              gparted must be installed:



                              sudo apt install gparted





                              share|improve this answer













                              check if target really exist with fdisk or gparted



                              sudo fdisk -l


                              gparted must be installed:



                              sudo apt install gparted






                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Dec 31 '17 at 9:17









                              Cornea ValentinCornea Valentin

                              1357




                              1357













                              • Could you elaborate on how the two commands could help OP solving the question ?

                                – Soren A
                                Dec 31 '17 at 10:46











                              • well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                                – Cornea Valentin
                                Jan 1 '18 at 6:34



















                              • Could you elaborate on how the two commands could help OP solving the question ?

                                – Soren A
                                Dec 31 '17 at 10:46











                              • well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                                – Cornea Valentin
                                Jan 1 '18 at 6:34

















                              Could you elaborate on how the two commands could help OP solving the question ?

                              – Soren A
                              Dec 31 '17 at 10:46





                              Could you elaborate on how the two commands could help OP solving the question ?

                              – Soren A
                              Dec 31 '17 at 10:46













                              well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                              – Cornea Valentin
                              Jan 1 '18 at 6:34





                              well from what he said up there he try to mount nonexistent partition and with fdisk/lsblk/gparted he can see all partition from pc.

                              – Cornea Valentin
                              Jan 1 '18 at 6:34


















                              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%2f991016%2fwhat-is-disk-dev-sdx%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

                              GameSpot

                              日野市

                              Tu-95轟炸機