Mounting root partition on embedded file system

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











up vote
1
down vote

favorite












Linux embedded file system (Linux v. 2.6.26.5) running on raw NAND flash, it use Full Image's RootFS. U-boot 2009.03 bootloader. I need access shell after the Kernel is fully loaded, so that I can reset password.
For now I use busybox emergency shell, so Linux kernel not fully loaded, the root partition is not mounted, not all drivers are loaded and many commands not work. I need mount the root partition, but I don't know exactly what is the real root partition on /dev. Boot log contain some lines,



Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y

LINUX_ROOTFS is 4
VFS: Mounted root (squashfs filesystem) readonly.
...


I guess root can be /dev/mtdblock5, but not sure. What is correct command to mount the root partition?



mount /dev/mtdblock5 /


Also what is worst case scenario, if I don't guess partition and set it incorrectly?



edit: I tried fdisk



BusyBox v1.10.2 (2017-08-02 14:07:25 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
# fdisk -l
/bin/sh: fdisk: not found
#

# mount
mount: no /proc/mounts
#

# lsblk
/bin/sh: lsblk: not found



I managed mount /proc. But can't mount /dev, /sys.



# cd /
# mount -t dev dev /dev
mount: mounting dev on /dev failed: No such device
# mount -t proc proc /proc
# mount -t sys sys /sys
mount: mounting sys on /sys failed: No such device
# mount -t devpts devpts /dev/pts
mount: mounting devpts on /dev/pts failed: No such file or directory






share|improve this question


























    up vote
    1
    down vote

    favorite












    Linux embedded file system (Linux v. 2.6.26.5) running on raw NAND flash, it use Full Image's RootFS. U-boot 2009.03 bootloader. I need access shell after the Kernel is fully loaded, so that I can reset password.
    For now I use busybox emergency shell, so Linux kernel not fully loaded, the root partition is not mounted, not all drivers are loaded and many commands not work. I need mount the root partition, but I don't know exactly what is the real root partition on /dev. Boot log contain some lines,



    Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y

    LINUX_ROOTFS is 4
    VFS: Mounted root (squashfs filesystem) readonly.
    ...


    I guess root can be /dev/mtdblock5, but not sure. What is correct command to mount the root partition?



    mount /dev/mtdblock5 /


    Also what is worst case scenario, if I don't guess partition and set it incorrectly?



    edit: I tried fdisk



    BusyBox v1.10.2 (2017-08-02 14:07:25 CST) built-in shell (ash)
    Enter 'help' for a list of built-in commands.

    /bin/sh: can't access tty; job control turned off
    # fdisk -l
    /bin/sh: fdisk: not found
    #

    # mount
    mount: no /proc/mounts
    #

    # lsblk
    /bin/sh: lsblk: not found



    I managed mount /proc. But can't mount /dev, /sys.



    # cd /
    # mount -t dev dev /dev
    mount: mounting dev on /dev failed: No such device
    # mount -t proc proc /proc
    # mount -t sys sys /sys
    mount: mounting sys on /sys failed: No such device
    # mount -t devpts devpts /dev/pts
    mount: mounting devpts on /dev/pts failed: No such file or directory






    share|improve this question
























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      Linux embedded file system (Linux v. 2.6.26.5) running on raw NAND flash, it use Full Image's RootFS. U-boot 2009.03 bootloader. I need access shell after the Kernel is fully loaded, so that I can reset password.
      For now I use busybox emergency shell, so Linux kernel not fully loaded, the root partition is not mounted, not all drivers are loaded and many commands not work. I need mount the root partition, but I don't know exactly what is the real root partition on /dev. Boot log contain some lines,



      Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y

      LINUX_ROOTFS is 4
      VFS: Mounted root (squashfs filesystem) readonly.
      ...


      I guess root can be /dev/mtdblock5, but not sure. What is correct command to mount the root partition?



      mount /dev/mtdblock5 /


      Also what is worst case scenario, if I don't guess partition and set it incorrectly?



      edit: I tried fdisk



      BusyBox v1.10.2 (2017-08-02 14:07:25 CST) built-in shell (ash)
      Enter 'help' for a list of built-in commands.

      /bin/sh: can't access tty; job control turned off
      # fdisk -l
      /bin/sh: fdisk: not found
      #

      # mount
      mount: no /proc/mounts
      #

      # lsblk
      /bin/sh: lsblk: not found



      I managed mount /proc. But can't mount /dev, /sys.



      # cd /
      # mount -t dev dev /dev
      mount: mounting dev on /dev failed: No such device
      # mount -t proc proc /proc
      # mount -t sys sys /sys
      mount: mounting sys on /sys failed: No such device
      # mount -t devpts devpts /dev/pts
      mount: mounting devpts on /dev/pts failed: No such file or directory






      share|improve this question














      Linux embedded file system (Linux v. 2.6.26.5) running on raw NAND flash, it use Full Image's RootFS. U-boot 2009.03 bootloader. I need access shell after the Kernel is fully loaded, so that I can reset password.
      For now I use busybox emergency shell, so Linux kernel not fully loaded, the root partition is not mounted, not all drivers are loaded and many commands not work. I need mount the root partition, but I don't know exactly what is the real root partition on /dev. Boot log contain some lines,



      Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y

      LINUX_ROOTFS is 4
      VFS: Mounted root (squashfs filesystem) readonly.
      ...


      I guess root can be /dev/mtdblock5, but not sure. What is correct command to mount the root partition?



      mount /dev/mtdblock5 /


      Also what is worst case scenario, if I don't guess partition and set it incorrectly?



      edit: I tried fdisk



      BusyBox v1.10.2 (2017-08-02 14:07:25 CST) built-in shell (ash)
      Enter 'help' for a list of built-in commands.

      /bin/sh: can't access tty; job control turned off
      # fdisk -l
      /bin/sh: fdisk: not found
      #

      # mount
      mount: no /proc/mounts
      #

      # lsblk
      /bin/sh: lsblk: not found



      I managed mount /proc. But can't mount /dev, /sys.



      # cd /
      # mount -t dev dev /dev
      mount: mounting dev on /dev failed: No such device
      # mount -t proc proc /proc
      # mount -t sys sys /sys
      mount: mounting sys on /sys failed: No such device
      # mount -t devpts devpts /dev/pts
      mount: mounting devpts on /dev/pts failed: No such file or directory








      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 30 '17 at 23:24

























      asked Nov 29 '17 at 20:40









      triwo

      40931022




      40931022




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          For mount the partition the first step is know "where" is:



          fdisk -l 


          The answer must be something like this:



          Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes
          Disklabel type: dos
          Disk identifier: 0x00009971

          Device Boot Start End Sectors Size Id Type
          /dev/sda1 2048 10547199 10545152 5G 82 Linux swap / Solaris
          /dev/sda2 192243712 1953521663 1761277952 839,9G 7 HPFS/NTFS/exFAT
          /dev/sda3 * 10547200 192243711 181696512 86,7G 83 Linux


          In the last section you can see "where" are the partitions! Only rest mount them, with the comand you propose: "mount" (obviously :-) )



          For the second question: I don't think you will broke something...in the worst scenario the prompt will give you an error.



          Greetings






          share|improve this answer




















          • I already tried fdisk, please see edit.
            – triwo
            Nov 29 '17 at 23:28


















          up vote
          0
          down vote













          Sorry for the late answer, I only have internet in my work.



          So, you can use lsblk instead fdisk, here are the results:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the sda2 partition is not mounted, I mount:



          root@CyborgPC /h/cyborg# mount /dev/sda2 /media/cyborg/Almacen


          And use the lsblk again:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part /media/cyborg/Almacen
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the lsblk give you the path where the device is found in /dev and, if it's mounted, give you the localization.



          Hope you can solve your problem.






          share|improve this answer




















          • I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
            – triwo
            Nov 30 '17 at 23:31










          • But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
            – k.Cyborg
            Dec 1 '17 at 21:31











          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f407822%2fmounting-root-partition-on-embedded-file-system%23new-answer', 'question_page');

          );

          Post as a guest






























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          For mount the partition the first step is know "where" is:



          fdisk -l 


          The answer must be something like this:



          Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes
          Disklabel type: dos
          Disk identifier: 0x00009971

          Device Boot Start End Sectors Size Id Type
          /dev/sda1 2048 10547199 10545152 5G 82 Linux swap / Solaris
          /dev/sda2 192243712 1953521663 1761277952 839,9G 7 HPFS/NTFS/exFAT
          /dev/sda3 * 10547200 192243711 181696512 86,7G 83 Linux


          In the last section you can see "where" are the partitions! Only rest mount them, with the comand you propose: "mount" (obviously :-) )



          For the second question: I don't think you will broke something...in the worst scenario the prompt will give you an error.



          Greetings






          share|improve this answer




















          • I already tried fdisk, please see edit.
            – triwo
            Nov 29 '17 at 23:28















          up vote
          1
          down vote













          For mount the partition the first step is know "where" is:



          fdisk -l 


          The answer must be something like this:



          Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes
          Disklabel type: dos
          Disk identifier: 0x00009971

          Device Boot Start End Sectors Size Id Type
          /dev/sda1 2048 10547199 10545152 5G 82 Linux swap / Solaris
          /dev/sda2 192243712 1953521663 1761277952 839,9G 7 HPFS/NTFS/exFAT
          /dev/sda3 * 10547200 192243711 181696512 86,7G 83 Linux


          In the last section you can see "where" are the partitions! Only rest mount them, with the comand you propose: "mount" (obviously :-) )



          For the second question: I don't think you will broke something...in the worst scenario the prompt will give you an error.



          Greetings






          share|improve this answer




















          • I already tried fdisk, please see edit.
            – triwo
            Nov 29 '17 at 23:28













          up vote
          1
          down vote










          up vote
          1
          down vote









          For mount the partition the first step is know "where" is:



          fdisk -l 


          The answer must be something like this:



          Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes
          Disklabel type: dos
          Disk identifier: 0x00009971

          Device Boot Start End Sectors Size Id Type
          /dev/sda1 2048 10547199 10545152 5G 82 Linux swap / Solaris
          /dev/sda2 192243712 1953521663 1761277952 839,9G 7 HPFS/NTFS/exFAT
          /dev/sda3 * 10547200 192243711 181696512 86,7G 83 Linux


          In the last section you can see "where" are the partitions! Only rest mount them, with the comand you propose: "mount" (obviously :-) )



          For the second question: I don't think you will broke something...in the worst scenario the prompt will give you an error.



          Greetings






          share|improve this answer












          For mount the partition the first step is know "where" is:



          fdisk -l 


          The answer must be something like this:



          Disk /dev/sda: 931,5 GiB, 1000204886016 bytes, 1953525168 sectors
          Units: sectors of 1 * 512 = 512 bytes
          Sector size (logical/physical): 512 bytes / 4096 bytes
          I/O size (minimum/optimal): 4096 bytes / 4096 bytes
          Disklabel type: dos
          Disk identifier: 0x00009971

          Device Boot Start End Sectors Size Id Type
          /dev/sda1 2048 10547199 10545152 5G 82 Linux swap / Solaris
          /dev/sda2 192243712 1953521663 1761277952 839,9G 7 HPFS/NTFS/exFAT
          /dev/sda3 * 10547200 192243711 181696512 86,7G 83 Linux


          In the last section you can see "where" are the partitions! Only rest mount them, with the comand you propose: "mount" (obviously :-) )



          For the second question: I don't think you will broke something...in the worst scenario the prompt will give you an error.



          Greetings







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 29 '17 at 21:22









          k.Cyborg

          124111




          124111











          • I already tried fdisk, please see edit.
            – triwo
            Nov 29 '17 at 23:28

















          • I already tried fdisk, please see edit.
            – triwo
            Nov 29 '17 at 23:28
















          I already tried fdisk, please see edit.
          – triwo
          Nov 29 '17 at 23:28





          I already tried fdisk, please see edit.
          – triwo
          Nov 29 '17 at 23:28













          up vote
          0
          down vote













          Sorry for the late answer, I only have internet in my work.



          So, you can use lsblk instead fdisk, here are the results:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the sda2 partition is not mounted, I mount:



          root@CyborgPC /h/cyborg# mount /dev/sda2 /media/cyborg/Almacen


          And use the lsblk again:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part /media/cyborg/Almacen
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the lsblk give you the path where the device is found in /dev and, if it's mounted, give you the localization.



          Hope you can solve your problem.






          share|improve this answer




















          • I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
            – triwo
            Nov 30 '17 at 23:31










          • But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
            – k.Cyborg
            Dec 1 '17 at 21:31















          up vote
          0
          down vote













          Sorry for the late answer, I only have internet in my work.



          So, you can use lsblk instead fdisk, here are the results:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the sda2 partition is not mounted, I mount:



          root@CyborgPC /h/cyborg# mount /dev/sda2 /media/cyborg/Almacen


          And use the lsblk again:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part /media/cyborg/Almacen
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the lsblk give you the path where the device is found in /dev and, if it's mounted, give you the localization.



          Hope you can solve your problem.






          share|improve this answer




















          • I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
            – triwo
            Nov 30 '17 at 23:31










          • But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
            – k.Cyborg
            Dec 1 '17 at 21:31













          up vote
          0
          down vote










          up vote
          0
          down vote









          Sorry for the late answer, I only have internet in my work.



          So, you can use lsblk instead fdisk, here are the results:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the sda2 partition is not mounted, I mount:



          root@CyborgPC /h/cyborg# mount /dev/sda2 /media/cyborg/Almacen


          And use the lsblk again:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part /media/cyborg/Almacen
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the lsblk give you the path where the device is found in /dev and, if it's mounted, give you the localization.



          Hope you can solve your problem.






          share|improve this answer












          Sorry for the late answer, I only have internet in my work.



          So, you can use lsblk instead fdisk, here are the results:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the sda2 partition is not mounted, I mount:



          root@CyborgPC /h/cyborg# mount /dev/sda2 /media/cyborg/Almacen


          And use the lsblk again:



          root@CyborgPC /h/cyborg# lsblk 
          NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
          sda 8:0 0 931,5G 0 disk
          ├─sda1 8:1 0 5G 0 part [SWAP]
          ├─sda2 8:2 0 839,9G 0 part /media/cyborg/Almacen
          └─sda3 8:3 0 86,7G 0 part /
          sr0 11:0 1 1024M 0 rom


          As you can see the lsblk give you the path where the device is found in /dev and, if it's mounted, give you the localization.



          Hope you can solve your problem.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 30 '17 at 13:31









          k.Cyborg

          124111




          124111











          • I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
            – triwo
            Nov 30 '17 at 23:31










          • But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
            – k.Cyborg
            Dec 1 '17 at 21:31

















          • I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
            – triwo
            Nov 30 '17 at 23:31










          • But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
            – k.Cyborg
            Dec 1 '17 at 21:31
















          I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
          – triwo
          Nov 30 '17 at 23:31




          I mounted /proc. But can't mount /dev, /sys. I need also mount root partition, its mtd4 ("LINUX_ROOTFS").
          – triwo
          Nov 30 '17 at 23:31












          But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
          – k.Cyborg
          Dec 1 '17 at 21:31





          But are you trying to mount the partitions of the device in the same folders of yours partitions? First create a folder: mkdir -p /new_folder Then mount in that new folder the partition: mount /dev/partition_number /new_folder
          – k.Cyborg
          Dec 1 '17 at 21:31


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f407822%2fmounting-root-partition-on-embedded-file-system%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)