The change directory (cd) command is not working with a USB driveGhost USB drives left behind when power is...

How to count words in a line

Hacker Rank: Array left rotation

What type of postprocessing gives the effect of people standing out

Are small insurances worth it

You'll find me clean when something is full

Is divide-by-zero a security vulnerability?

Use comma instead of & in table

Skis versus snow shoes - when to choose which for travelling the backcountry?

How can atoms be electrically neutral when there is a difference in the positions of the charges?

Significance and timing of "mux scans"

As a new poet, where can I find help from a professional to judge my work?

What's the purpose of these copper coils with resistors inside them in A Yamaha RX-V396RDS amplifier?

The change directory (cd) command is not working with a USB drive

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

What can I substitute for soda pop in a sweet pork recipe?

Non-Italian European mafias in USA?

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Is there a German word for “analytics”?

Why is working on the same position for more than 15 years not a red flag?

Whom do I have to contact for a ticket refund in case of denied boarding (in the EU)?

How to count occurrences of Friday 13th

Reason Why Dimensional Travelling Would be Restricted

Did 5.25" floppies undergo a change in magnetic coating?

Compare four integers, return word based on maximum



The change directory (cd) command is not working with a USB drive


Ghost USB drives left behind when power is cycled off and onRPi does not work with USB thumb drive anymoreExternal USB drive changes to read-onlyDoes PI go to sleep or does it stop supply to USB if the drive is not being used for some time?Raspberry pi 2 not detecting my Seagate External Hard Driveusb 1-1.2: device not accepting address 44, error -71Switching from 128 to 512GB USB storage drive makes computer unusably slowGhost USB drives left behind when power is cycled off and onProblems booting rpi 3 from USB disk driveRaspberry Pi Boot USB Flash Drive Automatic Image BackupPhysically Identify a faulty USB drive on the Pi (3B+)













9















When navigating the file system of my USB drive in the terminal, some weird things happen that didn't used to happen on my Raspberry Pi B+. I'm not quite sure how to articulate this, so I'll just show what is




  1. I open the command line and navigate to my USB drive with cd /media/pi/MYUSB/


  2. I use cd to enter a folder of the USB drive with cd /myFolder/myOtherFolder


  3. I navigate backwards to myFolder with cd ..


  4. I try to navigate again to myOtherFolder with cd /myOtherFolder. However, this raises the bash error bash: cd: /myOtherFolder: no such file or directory



I have no idea what or why this is happening, but I used to be able to do this without the error message. Sometimes I have power outages that cause the Raspberry Pi to shut off with the USB drive in it, so I have "ghost USB drives" like the ones described in Ghost USB drives left behind when power is cycled off and on.










share|improve this question









New contributor




Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    9















    When navigating the file system of my USB drive in the terminal, some weird things happen that didn't used to happen on my Raspberry Pi B+. I'm not quite sure how to articulate this, so I'll just show what is




    1. I open the command line and navigate to my USB drive with cd /media/pi/MYUSB/


    2. I use cd to enter a folder of the USB drive with cd /myFolder/myOtherFolder


    3. I navigate backwards to myFolder with cd ..


    4. I try to navigate again to myOtherFolder with cd /myOtherFolder. However, this raises the bash error bash: cd: /myOtherFolder: no such file or directory



    I have no idea what or why this is happening, but I used to be able to do this without the error message. Sometimes I have power outages that cause the Raspberry Pi to shut off with the USB drive in it, so I have "ghost USB drives" like the ones described in Ghost USB drives left behind when power is cycled off and on.










    share|improve this question









    New contributor




    Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      9












      9








      9








      When navigating the file system of my USB drive in the terminal, some weird things happen that didn't used to happen on my Raspberry Pi B+. I'm not quite sure how to articulate this, so I'll just show what is




      1. I open the command line and navigate to my USB drive with cd /media/pi/MYUSB/


      2. I use cd to enter a folder of the USB drive with cd /myFolder/myOtherFolder


      3. I navigate backwards to myFolder with cd ..


      4. I try to navigate again to myOtherFolder with cd /myOtherFolder. However, this raises the bash error bash: cd: /myOtherFolder: no such file or directory



      I have no idea what or why this is happening, but I used to be able to do this without the error message. Sometimes I have power outages that cause the Raspberry Pi to shut off with the USB drive in it, so I have "ghost USB drives" like the ones described in Ghost USB drives left behind when power is cycled off and on.










      share|improve this question









      New contributor




      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      When navigating the file system of my USB drive in the terminal, some weird things happen that didn't used to happen on my Raspberry Pi B+. I'm not quite sure how to articulate this, so I'll just show what is




      1. I open the command line and navigate to my USB drive with cd /media/pi/MYUSB/


      2. I use cd to enter a folder of the USB drive with cd /myFolder/myOtherFolder


      3. I navigate backwards to myFolder with cd ..


      4. I try to navigate again to myOtherFolder with cd /myOtherFolder. However, this raises the bash error bash: cd: /myOtherFolder: no such file or directory



      I have no idea what or why this is happening, but I used to be able to do this without the error message. Sometimes I have power outages that cause the Raspberry Pi to shut off with the USB drive in it, so I have "ghost USB drives" like the ones described in Ghost USB drives left behind when power is cycled off and on.







      usb






      share|improve this question









      New contributor




      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 15 hours ago









      Peter Mortensen

      1,81911117




      1,81911117






      New contributor




      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      Henry WestfallHenry Westfall

      484




      484




      New contributor




      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Henry Westfall is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          24














          You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path.
          Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway.



          But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, filesystems, and such.






          share|improve this answer








          New contributor




          Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.




























            6














            To go into a bit more detail —



            Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).



            Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.



            This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.



            Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.



            Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).



            Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.



            Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.






            share|improve this answer










            New contributor




            Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.





















            • For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

              – Monty Harder
              3 hours ago











            Your Answer






            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("schematics", function () {
            StackExchange.schematics.init();
            });
            }, "cicuitlab");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "447"
            };
            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
            });


            }
            });






            Henry Westfall is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fraspberrypi.stackexchange.com%2fquestions%2f94877%2fthe-change-directory-cd-command-is-not-working-with-a-usb-drive%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









            24














            You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path.
            Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway.



            But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, filesystems, and such.






            share|improve this answer








            New contributor




            Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.

























              24














              You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path.
              Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway.



              But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, filesystems, and such.






              share|improve this answer








              New contributor




              Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.























                24












                24








                24







                You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path.
                Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway.



                But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, filesystems, and such.






                share|improve this answer








                New contributor




                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.










                You put a leading / to your path names! That's the root directory, meaning what you write next is an absolute path.
                Your /myFolder/myOtherFolder is not on your USB if it's mounted inside /media/pi/MYUSB/ anyway.



                But you can use cd myOtherFolder in the case you're asking. I suggest reading some basic tutorial about Linux's (or Unix) file handling, filesystems, and such.







                share|improve this answer








                New contributor




                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                share|improve this answer



                share|improve this answer






                New contributor




                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                answered yesterday









                NyosNyos

                39115




                39115




                New contributor




                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.





                New contributor





                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.






                Nyos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.

























                    6














                    To go into a bit more detail —



                    Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).



                    Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.



                    This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.



                    Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.



                    Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).



                    Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.



                    Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.






                    share|improve this answer










                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





















                    • For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                      – Monty Harder
                      3 hours ago
















                    6














                    To go into a bit more detail —



                    Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).



                    Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.



                    This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.



                    Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.



                    Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).



                    Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.



                    Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.






                    share|improve this answer










                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





















                    • For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                      – Monty Harder
                      3 hours ago














                    6












                    6








                    6







                    To go into a bit more detail —



                    Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).



                    Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.



                    This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.



                    Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.



                    Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).



                    Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.



                    Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.






                    share|improve this answer










                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.










                    To go into a bit more detail —



                    Whether you come from a Windows or Mac OS X background, you will be used to external drives being independent places from your hard disk (more or less).



                    Part of Unix tradition is "avoid special cases wherever possible". For instance in Unix (and GNU/Linux), a keyboard is represented as a file that can be opened and read from just like a text file. So is a serial port (which can be written to as well). On a Raspberry Pi even the GPIO pins can be controlled like this. There is a file called /dev/zero that produces a sequence of 0-bytes when you read it. Etc.



                    This was a brilliant idea as it allowed programs to be constructed without having all sorts of special cases.



                    Anyway, in a similar tradition, there is one directory structure for the entire system, starting at / (the root directory). No special cases, no "drive letters". Just /.



                    Drives can be "attached" somewhere in this structure using the mount command (an Raspberry Pi is configured to do this automatically, but you can also do it manually).



                    Every file's path descends from / in some way (for example, /home/pi/test.txt). Because of this, a path starting with / is assumed to be an "absolute" path, starting from the root directory of the entire system. Without the / at the start, it is considered a "relative" path, i.e. it starts from the current directory.



                    Two other tricks—you probably know that a path starting with .. refers to the parent directory. A path starting with ~ starts from your home directory, e.g. ~/test.txt works the same no matter what your current directory is.







                    share|improve this answer










                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    share|improve this answer



                    share|improve this answer








                    edited 15 hours ago









                    Peter Mortensen

                    1,81911117




                    1,81911117






                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.









                    answered 23 hours ago









                    ArteliusArtelius

                    1611




                    1611




                    New contributor




                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.





                    New contributor





                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.






                    Artelius is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                    Check out our Code of Conduct.













                    • For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                      – Monty Harder
                      3 hours ago



















                    • For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                      – Monty Harder
                      3 hours ago

















                    For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                    – Monty Harder
                    3 hours ago





                    For completeness, a path starting with . refers to the current directory. This is important when one wishes to run a command stored in the current directory: Simply typing foo will cause the $PATH to be searched, and the first directory listed in it that contains a file named foo will be executed. But typing ./foo instructs the shell to explicitly look in the current directory rather than search $PATH.

                    – Monty Harder
                    3 hours ago










                    Henry Westfall is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    Henry Westfall is a new contributor. Be nice, and check out our Code of Conduct.













                    Henry Westfall is a new contributor. Be nice, and check out our Code of Conduct.












                    Henry Westfall is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Raspberry Pi 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%2fraspberrypi.stackexchange.com%2fquestions%2f94877%2fthe-change-directory-cd-command-is-not-working-with-a-usb-drive%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

                    El tren de la libertad Índice Antecedentes "Porque yo decido" Desarrollo de la...

                    Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...

                    Castillo d'Acher Características Menú de navegación