# Sd card issue

**URL:** <https://discussions.flightaware.com/t/sd-card-issue/57699>\
**Category:** ADS-B Flight Tracking\
**Created:** [November 29, 2019, 4:43pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699 "2019-11-29T16:43:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![icebob](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/icebob/32/53687_2.png) [@icebob](https://discussions.flightaware.com/u/icebob)\
**Post date:** [November 29, 2019, 4:43pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/1 "2019-11-29T16:43:44Z")

</div>

I.m trying to setup PiAware 3.7.2, Wrote the image to the card using etcher but when I try to see it on my windows 10 pc, it says the file system is not recognized so I cannot edit the config file to setup wifi. What am I doing wrong?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![wiedehopf](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/wiedehopf/32/114045_2.png) [@wiedehopf](https://discussions.flightaware.com/u/wiedehopf)\
**Post date:** [November 29, 2019, 5:07pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/2 "2019-11-29T17:07:35Z")

</div>

Remove the sd-card and plug it in again.

---

<div class="post-metadata">

**Author:** ![icebob](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/icebob/32/53687_2.png) [@icebob](https://discussions.flightaware.com/u/icebob)\
**Post date:** [November 29, 2019, 5:20pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/3 "2019-11-29T17:20:58Z")

</div>

Tried that and still not working

---

<div class="post-metadata">

**Author:** ![wiedehopf](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/wiedehopf/32/114045_2.png) [@wiedehopf](https://discussions.flightaware.com/u/wiedehopf)\
**Post date:** [November 29, 2019, 5:22pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/4 "2019-11-29T17:22:16Z")

</div>

Maybe you wrote the image to another drive? (would not be good for those data)

Otherwise try again or try another sd-card.

Note that the sd-card will have two partitions, only the first one is accesible by Windows.  
(it should just ignore the 2nd one)

---

<div class="post-metadata">

**Author:** ![icebob](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/icebob/32/53687_2.png) [@icebob](https://discussions.flightaware.com/u/icebob)\
**Post date:** [November 29, 2019, 5:27pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/5 "2019-11-29T17:27:45Z")

</div>

I put the card in the pi and it work, I can do sudo nano /boot/piaware-config.txt and edit the file. I cannot get wifi to work tho.

---

<div class="post-metadata">

**Author:** ![wiedehopf](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/wiedehopf/32/114045_2.png) [@wiedehopf](https://discussions.flightaware.com/u/wiedehopf)\
**Post date:** [November 29, 2019, 5:28pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/6 "2019-11-29T17:28:51Z")

</div>

The piaware-config.txt is only read on boot.

So set the correct values and do a reboot (sudo reboot).  
Also be sure to save the file with Ctrl-O and Enter.

I believe there are some pitfalls with spaces and # in wifi names or passwords.

---

<div class="post-metadata">

**Author:** ![icebob](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/icebob/32/53687_2.png) [@icebob](https://discussions.flightaware.com/u/icebob)\
**Post date:** [November 29, 2019, 5:34pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/7 "2019-11-29T17:34:27Z")

</div>

got it to work, had to add " wireless-type dhcp " to get it to work, now to find how to enable ssh as the pi will not be connected to a monitor when I get it in his final spot

---

<div class="post-metadata">

**Author:** ![wiedehopf](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/wiedehopf/32/114045_2.png) [@wiedehopf](https://discussions.flightaware.com/u/wiedehopf)\
**Post date:** [November 29, 2019, 5:35pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/8 "2019-11-29T17:35:15Z")

</div>

[https://flightaware.com/adsb/piaware/build/optional#wifi](https://flightaware.com/adsb/piaware/build/optional#wifi)

---

<div class="post-metadata">

**Author:** ![obj](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/obj/32/118984_2.png) [@obj](https://discussions.flightaware.com/u/obj)\
**Post date:** [November 30, 2019, 6:19am UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/9 "2019-11-30T06:19:30Z")

</div>

> [@icebob](#):
>
> had to add " wireless-type dhcp " to get it to work

This is already the default setting.

---

<div class="post-metadata">

**Author:** ![scroggie](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/scroggie/32/115176_2.png) [@scroggie](https://discussions.flightaware.com/u/scroggie)\
**Post date:** [November 30, 2019, 6:06pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/10 "2019-11-30T18:06:24Z")

</div>

Enabling SSH is easy. Just type:- sudo raspi-config and go to interfacing options and you will see enable SSH

---

<div class="post-metadata">

**Author:** ![SoNic67](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/sonic67/32/119872_2.png) [@SoNic67](https://discussions.flightaware.com/u/SoNic67)\
**Post date:** [November 30, 2019, 7:28pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/11 "2019-11-30T19:28:59Z")

</div>

You need a monitor and a keyboard connected to Pi for that.  
Writing an empty file named “ssh” in the boot folder, visible with a PC and card reader, is much easier.

---

<div class="post-metadata">

**Author:** ![Nitr0](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/nitr0/32/128824_2.png) [@Nitr0](https://discussions.flightaware.com/u/Nitr0)\
**Post date:** [November 30, 2019, 8:43pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/12 "2019-11-30T20:43:29Z")

</div>

Compounding on this solution to enable SSH, one may copy the raspbian image to a usb stick or hard drive of their choice (formatted fat32) and perform the following on any currently working linux system after plugging the drive in:

```auto
sudo mkdir /tmp/img
sudo mount /dev/sda1 /tmp/img
IMG="/tmp/img/`sudo ls /tmp/img |grep .img`"
SS=`sudo fdisk -l $IMG |grep "^Sector size" |awk '{print $4}'`
P1=`sudo fdisk -l $IMG |grep "^$IMG"1 |awk '{print $2}'`
P2=`sudo fdisk -l $IMG |grep "^$IMG"2 |awk '{print $2}'`
sudo mkdir /tmp/usb1 /tmp/usb2
sudo mount -v -o rw,offset=$((P1*=$SS)) -t vfat $IMG /tmp/usb1
sudo mount -v -o rw,offset=$((P2*=$SS)) -t ext4 $IMG /tmp/usb2

sudo touch /tmp/usb1/ssh

sudo sync
sudo umount /tmp/usb1
sudo umount /tmp/usb2
sudo umount /tmp/img

```

_The above is if your usb stick/drive containing the image shows up as sda1 - adjust accordingly if needed as this assumes only one device being connected and the target image is the only .img file in the rot folder of the drive._

From there, whenever the “injected” image is burned, ssh will be enabled on the first boot by default. It’s the same as performing whatever @SoNic67 mentioned, but it will be there on any subsequently burned sd card. I use this method since I am constantly burning images to cards and it eliminates me having to pull/push the sdcard after burning and manually adding the ssh file to the boot partition.

---

<div class="post-metadata">

**Author:** ![obj](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/obj/32/118984_2.png) [@obj](https://discussions.flightaware.com/u/obj)\
**Post date:** [December 1, 2019, 11:01am UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/13 "2019-12-01T11:01:17Z")

</div>

`kpartx` is a much simpler way to achieve the same thing.

---

<div class="post-metadata">

**Author:** ![Nitr0](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/nitr0/32/128824_2.png) [@Nitr0](https://discussions.flightaware.com/u/Nitr0)\
**Post date:** [December 1, 2019, 6:25pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/14 "2019-12-01T18:25:58Z")

</div>

Yup, a few ways to skin a cat:

```auto
#USE KPARTX
sudo apt install -y kpartx

mkdir img
sudo mount /dev/sda1 img
sudo kpartx -av img/*.img
sudo mount /dev/mapper/loop0p1 /mnt
sudo touch /mnt/ssh
sudo kpartx -d img/*.img
sudo umount -l /mnt img
sudo sync
rm -rf img

*OR*

#USE LOSETUP
mkdir img
sudo mount /dev/sda1 img
sudo losetup -P /dev/loop0 img/*.img
sudo mount /dev/loop0p1 /mnt
sudo touch /mnt/ssh
sudo losetup -d /dev/loop0
sudo umount -l /mnt img
sudo sync
rm -rf img

```

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [December 1, 2019, 8:34pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/15 "2019-12-01T20:34:51Z")

</div>

@SoNic67 is right.  
Slip-out micoSD card from RPi, slip-in into Desktop/Laptop using a card reader, and do following:

> [@Bake a Pi](https://discussions.flightaware.com/t/bake-a-pi/19886/2):
>
> After image is written, and microSD card is still in card reader of Desktop/Laptop, (a) Enable ssh (b) Configure WiFi
> 
> **(a) To enable SSH:**
> 
> **Windows:**  
> In File Explorer, double click the drive letter of microSD card. This will open the folder /boot and show lots of files and some folders. Right click in /boot folder, and create a new blank file named ssh or ssh.txt
> 
> **Mac:** Open terminal and give following command  
> $ touch /Volumes/piaware/ssh
> 
> **(b) To enable Wifi on first boot (if required):**
> 
> **Windows:**  
> In File Explorer, double click the drive letter of microSD card. This will open the folder /boot and show lots of files and some folders. Open file “piaware-config.txt” using a text editor like Notepad.
> 
> **Mac:** Open the Finder program. Select the Micro SD card device labeled piaware. Open the file “piaware-config.txt”. The file will open in TextEdit.
> 
> In the opened file “piaware-config.txt”, scroll down till you see this text:
> 
> wireless-ssid MyWifiNetwork  
> wireless-password s3cr3t99
> 
> Replace MyWifiNetwork by your router’s wifi ssid, and s3cr3t99 by your router’s wifi password

---

<div class="post-metadata">

**Author:** ![abcd567](https://sea1.discourse-cdn.com/flex019/user_avatar/discussions.flightaware.com/abcd567/32/113769_2.png) [@abcd567](https://discussions.flightaware.com/u/abcd567)\
**Post date:** [December 1, 2019, 9:04pm UTC](https://discussions.flightaware.com/t/sd-card-issue/57699/16 "2019-12-01T21:04:40Z")

</div>

The Raspbian’s `raspi-config` command uses fdisk to expand file system. Below are the commands generated when I did following:

sudo raspi-onfig \>\> Advance Options \>\> Expand File system

```auto
pi@raspberrypi:~ $ sudo raspi-config

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
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: 0x6c586e13

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 15523839 14991360 7.2G 83 Linux

Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.

Command (m for help): Partition type
   p primary (1 primary, 0 extended, 3 free)
   e extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-15523839, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-15523839, default 15523839):
Created a new partition 2 of type 'Linux' and of size 7.2 GiB.
Partition #2 contains a ext4 signature.

Command (m for help):
Disk /dev/mmcblk0: 7.4 GiB, 7948206080 bytes, 15523840 sectors
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: 0x6c586e13

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 532479 524288 256M c W95 FAT32 (LBA)
/dev/mmcblk0p2 532480 15523839 14991360 7.2G 83 Linux

Command (m for help): The partition table has been altered.
Syncing disks.

```
