Page 1 of 1

Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 10:04 am
by ontstudios
Hi, I inserted a 128gb sd card and when I installed the os, it shows that it has only 47 megabytes. Why's that? If I put it in the raspberry pi will it still have 128gb of storage? When I tried to format the card, it still showed as 47mb.

Can someone explain why it does that?

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 10:44 am
by wildfire
Different file systems, the first partition is FAT (which windows recognises) the rest would be EXT4 which windows does not, Linux recognises both (and the pi needs a fat partition to boot from) so yes when installed in your Pi after initial startup your card will show full capacity.

EDIT: Burn the OS image and even if windows suggests you format the card afterwards DO NOT DO SO.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:11 am
by fruitoftheloom
ontstudios wrote:
Wed Jun 17, 2020 10:04 am
Hi, I inserted a 128gb sd card and when I installed the os, it shows that it has only 47 megabytes. Why's that? If I put it in the raspberry pi will it still have 128gb of storage? When I tried to format the card, it still showed as 47mb.

Can someone explain why it does that?

Just ignore what Windows 10, as above stated, MS do not natively understand EXT formatted partitions.

Use the Pi-Imger to create a Bootable SD Card, put the SD Card in your RPi and boot, it will expand the partitions to make full use of the space.

https://www.raspberrypi.org/blog/raspbe ... g-utility/

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:13 am
by ontstudios
Thank you so much guys! Really means a lot, but that means the SD card is no longer usable on Windows?

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:14 am
by jahboater
When its all finished installing, use the command "df -h" to see what space you have.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:20 am
by wildfire
It can be read on windows (search for ext file extensions), writing is more problematic. However, if the two systems are networked then sharing the card is not too difficult as the underlying file system is irrelevant.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:25 am
by ontstudios
How can I restore the card so it is like newly bought? Means only one partition, which shows all of the 128gb.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:26 am
by ontstudios
wildfire wrote:
Wed Jun 17, 2020 10:44 am
if windows suggests you format the card afterwards DO NOT DO SO.
Why? I already formatted the card, thinking it would restore it to 128gb.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:32 am
by DougieLawson
ontstudios wrote:
Wed Jun 17, 2020 11:25 am
How can I restore the card so it is like newly bought? Means only one partition, which shows all of the 128gb.
If you're using the Raspberry Pi Imager to write your SDCard you don't need to worry about that. It will re-partition the SDCard. On first boot in your RPi it will expand the Linux filesystem to use the whole 128GB SDCard.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:32 am
by wildfire
ontstudios wrote:
Wed Jun 17, 2020 11:25 am
How can I restore the card so it is like newly bought? Means only one partition, which shows all of the 128gb.
Use SD Formatter (https://www.sdcard.org/downloads/formatter/) or a phone/camera.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:35 am
by GlowInTheDark
ontstudios wrote:
Wed Jun 17, 2020 11:13 am
Thank you so much guys! Really means a lot, but that means the SD card is no longer usable on Windows?
(Not being snarky; these are true, valid, non-rhetorical questions)
Why do/would you want to use it under Windows when it is being used to boot the Pi?

What is your actual use case? What problem are we actually trying to solve?

Anyway, the short answer to your question is, for all practical purposes: No.

Finally, I suppose the fact that the card is so large (128G) is what makes it seem weird that once you put it in the Pi, it feels like it has been "consumed". I think using large SD card with Pis is basically a waste. Most users use smaller cards (8-32 G). Myself, I still boot mostly from 8G cards (even though the CW here is that 8G is too small for the latest, greatest, all souped up versions of RPi OS).

Finally, finally, it would be possible, to use Gparted to shrink the ext4 partition down to, say, 60G or thereabouts, then create a new FAT32 partition after that and then access that from Windows (after shutting down the Pi, of course, and moving the card back to the Windows machine). There is a (potential) glitch here, that exists in earlier versions of Windows, that I have heard is fixed in W10 (not that any sane person would be using W10, of course), that would prevent Windows from accessing that newly created partition. But, again, it is, so I've heard, fixed in W10, so if you are using that, it might "just work".

Edit: I see that as I was composing this rather lengthy response, several other posters have weighed in. Let me add that you don't need to reformat it to get back all the space. The space is there and is accessible by Linux. It's just not (easily) accessible by Windows.

And, finally, finally, finally, it sounds like you've already reformatted it, so all this may now be moot.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 11:36 am
by wildfire
ontstudios wrote:
Wed Jun 17, 2020 11:26 am
wildfire wrote:
Wed Jun 17, 2020 10:44 am
if windows suggests you format the card afterwards DO NOT DO SO.
Why? I already formatted the card, thinking it would restore it to 128gb.
To add, you formatted the partition, not the card.

Re: Installing an OS clears the SD Card

Posted: Wed Jun 17, 2020 10:14 pm
by emma1997
GlowInTheDark wrote:
Wed Jun 17, 2020 11:35 am
Why do/would you want to use it under Windows when it is being used to boot the Pi?
Some people like me and a few friends use the SD to transfer big files instead of hunting down special readers and cables every time or when network is not available.

I solved this by making /root barely more than 4 gigabytes and /boot the rest of the card which is many times bigger. Violates the official Pi rule of law and truly heretical. But now it only takes a couple minutes to backup/restore instead of hours and me and sneakernetter pals finally achieve nirvana.

Re: Installing an OS clears the SD Card

Posted: Thu Jun 18, 2020 12:25 am
by W. H. Heydt
emma1997 wrote:
Wed Jun 17, 2020 10:14 pm
GlowInTheDark wrote:
Wed Jun 17, 2020 11:35 am
Why do/would you want to use it under Windows when it is being used to boot the Pi?
Some people like me and a few friends use the SD to transfer big files instead of hunting down special readers and cables every time or when network is not available.

I solved this by making /root barely more than 4 gigabytes and /boot the rest of the card which is many times bigger. Violates the official Pi rule of law and truly heretical. But now it only takes a couple minutes to backup/restore instead of hours and me and sneakernetter pals finally achieve nirvana.
USB sticks will work for sneakernet, so no need to make a weirdly formatted SD card. Also bear in mind that where you go over (IIRC) 64GB for a partition, it will be exFAT, which the Pi bootloader can't read.

Re: Installing an OS clears the SD Card

Posted: Thu Jun 18, 2020 1:57 am
by GlowInTheDark
Also bear in mind that where you go over (IIRC) 64GB for a partition, it will be exFAT, which the Pi bootloader can't read.
That is the Windows default, but better/smarter tools (the kind all us Kewl people use) can ensure that it is FAT32. I believe FAT32 is actually good up to 2T, even though Windows pretends that it maxes out at 32G.

Reference (from Wikipedia):
The FAT32 boot sector uses a 32-bit field for the sector count, limiting the maximum FAT32 volume size to 2 tebibytes (approximately 2.2 terabytes) with a sector size of 512 bytes. The maximum FAT32 volume size is 16 TiB (approximately 17.6 TB) with a sector size of 4,096 bytes.

Re: Installing an OS clears the SD Card

Posted: Thu Jun 18, 2020 11:21 am
by ontstudios
Also bear in mind that where you go over (IIRC) 64GB for a partition, it will be exFAT, which the Pi bootloader can't read.
I made an image with the official Raspberry Pi Imager, and it shows it as exFAT.

Re: Installing an OS clears the SD Card

Posted: Thu Jun 18, 2020 12:32 pm
by rpdom
ontstudios wrote:
Thu Jun 18, 2020 11:21 am
Also bear in mind that where you go over (IIRC) 64GB for a partition, it will be exFAT, which the Pi bootloader can't read.
I made an image with the official Raspberry Pi Imager, and it shows it as exFAT.
That sounds unlikely. Can you show evidence of this so it can be investigated?

Re: Installing an OS clears the SD Card

Posted: Thu Jun 18, 2020 1:09 pm
by ontstudios
rpdom wrote:
Thu Jun 18, 2020 12:32 pm
ontstudios wrote:
Thu Jun 18, 2020 11:21 am
Also bear in mind that where you go over (IIRC) 64GB for a partition, it will be exFAT, which the Pi bootloader can't read.
I made an image with the official Raspberry Pi Imager, and it shows it as exFAT.
That sounds unlikely. Can you show evidence of this so it can be investigated?
My mistake, sorry, it shows fat32. 😁