Why does Micro SD Card Reader display two directories?

Te
10

I recently ordered a Raspberry Pi set on the Internet, which included a 16GB Micro SD card that already had an OS installed on it. After this OS did not work, I wanted to play Raspbian on the SD card myself and pushed the SD card into a card reader, which I then connected to my laptop. Now I was once the drive F: displayed, where synonymous the files of the already installed OS were seen, and once the drive G, which I would have to format first. Now I have my own OS on the drive F: played and thus the Raspberry Pi worked well. But when I wanted to copy a separate folder for my own program (200MB size) in the drive F:, I was the message "too little space" displayed. Then I noticed that on the drive F: supposedly 20.9 MB of 40 MB were already used, and that after formatting the drive G: 14.5 GB of 14.5 GB were free there. Now to my question: How can it be that the actually 16MB Micro SD card is only 40 MB in size, but for me but a different drive is displayed, which would match the storage capacity? A Micro SD card can't be 2 drives. And when I put the card in the Pi, this worked well. So the drive F: is used with the OS during the boot process, which should be so, but the drive F: should actually be about 16GB in size, and instead I will see another drive. Why? And how can I solve the memory problem?

Ke

On the SD card are two partitions. One is the boot partition for the Pi, which is formatted with the file system FAT. You can see, read, write in Windows Explorer. The second partition is formatted with the file system ext4. The partition sees Windows but can't read or write to it. The file system is unknown, so Windows tells you to format it. Both partitions do not occupy the SD card completely. There's still unallocated space on the map. If you had left the original operating system on the SD card (I assume that was Raspbian), you could have expanded the partition with the raspi-config command and used all the space. Formatting the partition seems to allocate all space and write a file system.

To treat the memory card as a drive again, helps you

https://www.heise.de/...18228.html

or

https://www.gieseke-buch.de/raspberrypi/sd-karte-vom-raspberry-pi-windows-vollstaendig-nutzen

Te

Thank you first for your helpful answer. If I now buy a blank, new micro SD card and play with Etcher the Raspbian image on the SD card, then I have the same problem? The solution with diskpart I had already tried, but do not know that there are two partitions, I accidentally deleted both, and then the card was useless.

Te

Oh yes, after I played Raspbian on the Micro SD card myself, I did expand the space in the raspi config menu, but it did not change when I put the card in the card reader

Ke

What does "I have the same problem" then? It is normal and wanted that Raspbian works with two partitions. One of them is not readable by Windows. This is normal, but no problem.

Ke

Of course, nothing changes what you could see with Windows. The ext4 partition will be expanded. Windows can't read that no matter how big it is.

Te

I wanted to play my own folder on the card lately, but there was not enough space on the part with the readable partition. And when I extended the storage system in the raspi-config, there was still not enough space left for the folder. How can I solve this?

Ke

On the boot partition (the one that Windows can read) your folder has no business. You have to shovel it onto the ext4 partition.

Option 1: You move the folder to a USB stick. On the Pi, you install the driver to read NTFS and FAT media:

sudo apt install ntfs-3g

If you now plug in the USB stick, it may already be detected automatically and hooked into the file system. With

df -h

then you see a file system / dev / sda1. In the column "Depended on" you then see the path that probably starts with / mnt. Under this path you will find your folder, because then you can copy to / home / pi.

If the USB stick is not mounted automatically, you have to do it manually. First you have to create a so-called mountpoint:

sudo mkdir -p / media / usb

Then the USB stick is hung. If the stick is formatted with NTFS file system:

sudo mount -t ntfs -o utf8, uid = pi, gid = pi, noatime / dev / sda1 / media / usb

If the stick is formatted with the file system FAT:

sudo mount -t vfat -o utf8, uid = pi, gid = pi, noatime / dev / sda1 / media / usb

Now you can find your folder under / media / usb and copy it to / home / pi.

Option 2: You set up an FTP or SFTP server on the Pi and copy the files to the Pi with an FTP client installed on your Windows machine.

Option 3: You set up an FTP server on the Windows machine, install an FTP client on the Pi and bring the folder on the Pi.

Option 4: You move the folder to a (arbitrary) web server and get it for example. B. Per wget on the Pi. Wget you can on the Pi with

sudo apt install wget

to install.

Te

Thank you, you were really a huge help to me

Te

I plugged the USB stick into the Pi and it was recognized immediately, but when I plugged it back into my laptop, I could not access it, which is also logical, since he now has a partition. Do I have to delete them now with diskpart, to be able to access my stick again?

Ke

The Pi does not change the USB stick automatically. What exactly does it mean that you can no longer access the laptop on the stick? Do you get an error message?

Before you remove the stick from the Pi, you should unplug it again:

sudo umount / media / usb

Maybe peeling off the Pi has corrupted the file system. Put the stick again on the Pi and fix the file system:

sudo umount / media / usb
sudo fsck -a / dev / sda1

And then put it back on the laptop.