I am trying to copy a file from the boot directory for a rasbian image in it's boot directory. I would like to write once to the sd card and not have to run rasbian for the file to be in the /home/pi directory.

I have a custom configuration file that I would like to copy over during startup, preferably into /home/pi. I put the sd card into my computer and dropped this into the boot directory.

The issue is that the file isnt visible in /boot when I boot up the pi and ssh into it. I am putting a file named config.txt into the /boot directory (next to wpa_supplicant and ssh files).

What am I doing wrong? Is there a better way to do this? I know I can put the file in there manually but I would like to not have to ssh in to do so, would like to just drop it onto the sd card after writing the image with etcher.

  • What OS are you attempting to copy the file from? You should be able to mount the root filesystem and copy the file to that. – Torin Apr 25 at 14:08
  • "I am putting a file named config.txt into the /boot directory (next to wpa_supplicant and ssh files)." ... wpa_supplicant and ssh typically are in /etc so I'm really confused by your description. Please describe your context in more detail... – yeti Apr 25 at 14:14
  • @torin It is using raspbian (a flavor of linux for the raspberry pi). you can see for instance here how you can drop files into the boot directory on the sd card which are copied over on launch .raspberrypi.stackexchange.com/questions/10251/… – timmyg13 Apr 25 at 18:09
  • @timmyg13 I meant the OS used when "writing the image with etcher.". You may be able to immediately mount the root partition from the sdcard and copy your file directly to home/pi. – Torin Apr 25 at 18:18
  • @Torin sorry - am using OSX – timmyg13 Apr 25 at 19:23

Your Answer

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

Browse other questions tagged or ask your own question.