2

I have a headless RPI booting from a USB pen.

I want to setup other headless RPIs that are meant to be booted from the NOOBS SD card.

So, I'd like to access the SD card from the USB-booted RPI in order to setup the wpa_supplicant.conf with the wifi credentials so that I can then ssh into them.

(If there is an easier alternative for first time setups without access to peripherals or ethernet connections, please let me know)

How should I find/mount the SD card from the terminal of the USB booted RPI?

By checking the diff on /dev with and without the SD card plugged in, it seems it's /dev/mmcblk0 . I've tried to mount it to a new folder, but I get "its already mounted/busy", and with ps aux | grep mmcblk0 I do find a process with the name.

I dont wanna mess up anything, so I havent unmounted it, im not sure whats going on.

Thank you for the help!

1
  • does creating an os image containing an empty file entitled ssh in root solve your issue? then flash the os image to connect thru ssh. does this make sense?
    – m_antis
    Feb 11 at 19:49
1

Just found out about the "lsblk" command.

It showed me that the SD card was automatically mounted to /media/pi/boot despite it not being the original boot source, and there I see the contents of the SD card and the the wpa_supplicant.conf that I was looking for.

0

For anyone who needs it in the future to find the needed information to mount the partition on the card you can use the already mentioned blkid or fdisk. This if the card does not auto mount for you.

root@zeus-H370M-DS3H:~# fdisk -l
snip....
Disk /dev/sde: 29.81 GiB, 32010928128 bytes, 62521344 sectors
Disk model: Storage Device  
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8d99794c

Device     Boot  Start      End  Sectors  Size Id Type
/dev/sde1         8192   532479   524288  256M  c W95 FAT32 (LBA)
/dev/sde2       532480 62521343 61988864 29.6G 83 Linux

Make yourself a mount point and mount it.

root@zeus-H370M-DS3H:~# mkdir /tmp/cardboot
root@zeus-H370M-DS3H:~# mount /dev/sde1 /tmp/cardboot

root@zeus-H370M-DS3H:~# ll /tmp/cardboot/c*
-rwxr-xr-x 1 root root  166 Dec 31  1979 /tmp/cardboot/cmdline.txt
-rwxr-xr-x 1 root root 1722 May 27  2020 /tmp/cardboot/config.txt

Make your changes and unmount the drive.

root@zeus-H370M-DS3H:~# nano /tmp/cardboot/wpa_supplicant.conf
root@zeus-H370M-DS3H:~# touch SSH
root@zeus-H370M-DS3H:~# umount /tmp/cardboot

Then take the card out.

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.