RRC|BIOSTATISTICS

Raspberry Pi: Reformat SD Card

Hooray for you, getting started with that awesome Raspberry Pi.
You’ve probably started your fun with gparted to get NOOBS on your SD.

Gparted – First Steps

Get gparted with sudo apt-get gparted Run sudo fdisk -l Then mount your SD card and run sudo fdisk -l again
Even though its technically in your “media” file, you’re going to do your work from within the /dev/ folder
Some suggest to use cfdisk. If you get “FATAL ERROR” don’t panic, its just because your SD card is not the only thing mounted.

Gparted – Errors!

Did you get errors like these while trying to delete previous partitions?

1
2
partition ends after end-of-disk
no-free-sectors-available

The massive omission from alot of NOOBS for raspberry pi tutorial is this step:

After you delete your partitions, then write the change after selecting which partition to delete with Command: w

Gparted – Wait do this first!

But first, erase everything on that SD card

1
2
3
4
5
6
7
sudo shred -v /dev/sdb1
dd if=/dev/zero of=/dev/sdb1
sudo dd if=/dev/zero of=/dev/sdb1 bs=8192
dd: writing `/dev/sdb1': No space left on device
9033+0 records in
9032+0 records out
73995264 bytes (74 MB) copied, 0.0352761 s, 2.1 GB/s

Oh shoot.

Gparted – Stop making things harder for yourself

Alternatively, you could do the smart thing and not bother with Linux for reformatting your SD card. Seriously, just stop making yourself crazy and download the SD Formatter 4.0, and reformat your SD card. It will save you an entire world of banging your head against the desk.

You notice from the output above the command had only 74MB copied. The disk is 8GB. No matter what I did, how much I shredded it, it was only showing 72ish MB of space. Other developers said that the card was bad and I should not worry about it anymore.

This made no sense. I purchased the SD card and its adapter for exclusive use of the Beaglebone Black. The Beaglebone had so little use (alas, such is the case for many embedded linux systems) and then lay protected and dormant in a altoid box for almost a year.

I was not going to spend $10 some-odd bucks to get NOOBS on an SD card. Its called NOOBS for a reason! I had to do it. I had to make it bend to my will.

Well, the SD Formatter reformatted my “72 MG” card and voila! 7.51 GB. Magic.

Comments