0

What I am trying to do:
I have a TP-Link Router running OpenWRT. I have files on my router in the OpenWRT OS that I want to save to a flash drive.

Steps to complete the task:
1. I navigated to the dev folder and checked my directory.
2. I put the flash drive into the router and checked the route directory again
3. I saw sdc and sdc1 (So I knew that it was recognizing the flash drive).
4. Before trying to see if I could transfer files from the router to the drive, I wanted to see if I could view the files already on the flash drive.
5. I tried to cd into the flash drive and got a cannot cd into sdc error.
6. I tried the step above with sdc1 and got the same error.
7. I then thought, maybe I cannot cd into the directory, but I can transfer files from flash drive to the router.
8. So, I created a new directory, /media/usb, according to another stack exchange site answer I found.
9. I ran mount [destination][source] or mount media/usb sdc. I got a directory does not exist error.
10. I tried the same above with sdc1 and got the same error.
11. At this point, I tried to cd into each directory to make sure they were all valid.
12. I could cd into media/usb, but when I tried to cd into sdc and sdc1, I got a cannot cd into sdc and cannot cd into sdc1 error.
13. At this point, I tried to go to what I originally wanted to do which was save the files on the router to the flash drive.
14. I ran mount sdc filesDirectory. I also tried the same with sdc1, and that did not work as well. I got a directory does not exist error.

I didn’t try mount –t ext4… (like found here) because I know the disk is formatted, but I wasn’t sure if it was formatted with an “ext4” system or not.

Can someone let me know what I am doing wrong or point me in the right direction? Is there something else I am supposed to do to prep the disk, for example, before trying to use it. I assumed automatic mount on boot took care of the majority of the prep work and that it was working because I could see the drive. I’ve never tried this with Linux, so I’m not sure I could be going wrong.

1

This is simple syntax error. You are entering the wrong commands and for the wrong reasons.

Assuming your OpenWRT install has the required packages (block mount, filesystem kmod, etc.), your issues are:

Step 5. You are trying to cd (change directory) into a device. /dev/sdc is a 'special file' (aka a device) not a directory.

Step 9. You created /media/usb but tried to mount media/usb into sdc. Not only is that the wrong way round but you left out the / in the mount command.

The syntax is

mount [device] [mountpoint]

so the correct command would be

mount /dev/sdc1 /media/usb

  1. It's not sdc1, it's /dev/sdc1. You need to specify the full path.

  2. See 5. You can't CD into something that's not a D.

  3. Again, you're using incorrect syntax. Where either or any of the things you refer to do not exist in the current directory you need to specify how to get there.

There's also the issue you don't seem to understand the difference between /dev/sdc and /dev/sdc1. In short, /dev/sdc is the entire device, /dev/sdc1 is the first partition on the device. USB devices are finicky in that, unlike hard drives, it's almost common to put a filesystem directly onto the device, outside of any partition, but it's still not a good idea. Always use /dev/sdcX if it exists.

  • I still wasn't able to get it working even following that syntax. It says mounting /sdc1 on /media/usb failed: no such file or directory. But your answer did answer my question in terms of letting me know what I was doing wrong. Thanks for such a thorough explanation! Is there any other reason I might get that error? – user461262 Jun 22 '15 at 13:18
  • @user461262 You made the same error again. It's mount /dev/sda1 not /sda1. Any time you get the error "No such file or directory" it almost always means exactly that, make sure the file or directory you've specified is valid and exists, and is in the folder you specified. – Circus Cat Jun 22 '15 at 13:19
  • I tried that too. Im in the dev directory and I typed mount /dev/sdc1 /media/usb. I got the same error – user461262 Jun 22 '15 at 13:22
  • @user46126: Does both /dev/sdc1 and /media/usb exist? Are you sure neither has changed since you asked the question? – Circus Cat Jun 22 '15 at 13:23
  • I'm positive. I start at the root and run cd dev. I do ls -a and see sdc, sdc1, and media. Then, right there in the dev directory, I run the mount command. I even did a cd into media to make sure usb was there. – user461262 Jun 22 '15 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.