Page 1 of 1

Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 4:50 pm
by Nyanical
I'm currently on Crunchbang, and I would like to install PiBang on my RPi so I can use it similar to my Laptop (which uses Crunchbang), I got my RPi in a Pimoroni starter kit, and it has an SD card with the Micro SD inside, I installed raspbian to it a few weeks ago, but I would like to erase that and use PiBang. Does anyone know how to do this? (I'm on Linux, not Windows).

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 5:16 pm
by fruitoftheloom
Nyanical wrote:I'm currently on Crunchbang, and I would like to install PiBang on my RPi so I can use it similar to my Laptop (which uses Crunchbang), I got my RPi in a Pimoroni starter kit, and it has an SD card with the Micro SD inside, I installed raspbian to it a few weeks ago, but I would like to erase that and use PiBang. Does anyone know how to do this? (I'm on Linux, not Windows).
GParted can erase the partitions and format the SDCard to FAT32, in Debian:

Code: Select all

apt-get update
apt-get install gparted

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 5:35 pm
by beta-tester
for hardcore or sado-maso users... :lol:
1. download the image you want to install.
2. in case the image is zipped, unzip the image
3. insert the SD card, you want as destination to wipe out and transfere the new image.
4. in case your linux auto-mount the existing partitions of the SD card after you plugged the SD card, open a terminal window and unmount those partitions.

Code: Select all

sudo umount /media/boot
sudo umount /media/System
(depending on what is on the SD card)
do not use the eject icon of the file manager, because then the SD card is maybe inaccessable to the following process.
5. dmesg | tail or cat /proc/partitions or to see, that device name your SD card got from the OS.

Code: Select all

user@linux~$ dmesg | tail
[159528.121925] sd 0:0:0:0: [sda] No Caching mode page found
[159528.121966] sd 0:0:0:0: [sda] Assuming drive cache: write through
[159528.135077] sd 0:0:0:0: [sda] No Caching mode page found
[159528.135119] sd 0:0:0:0: [sda] Assuming drive cache: write through
[159528.138606]  sda: sda1 sda2
[159528.149564] sd 0:0:0:0: [sda] No Caching mode page found
[159528.149606] sd 0:0:0:0: [sda] Assuming drive cache: write through
[159528.149631] sd 0:0:0:0: [sda] Attached SCSI removable disk
[159529.437749] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[159529.770046] EXT4-fs (sda2): mounted filesystem with ordered data mode. Opts: (null)
tells that your sd card is accessable under device name "/dev/sda"

Code: Select all

user@linux~$ cat /proc/partitions
major minor  #blocks  name
   8        0   15793152 sda
   8        1      57344 sda1
   8        2   15731712 sda2
6. use dd to wipeout the SD with the content of the image data

Code: Select all

sudo dd if=your_favorite.img of=/dev/sdX bs=1M && sudo sync
(where /dev/sdX has to be the device name of the SD card. becarefully to take the right destination :!: not that you wipe out your HDD :shock: )
7. wait until dd wrote all data and sync flushed all pending data from cache
8. unplug SD card.

now your SD card is wiped out with the data of the new image and you can now plug in the SD card to your RPi and boot into the new image


EDIT: here the official link to that process
http://www.raspberrypi.org/documentatio ... s/linux.md

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 5:50 pm
by Nyanical
fruitoftheloom wrote:
Nyanical wrote:I'm currently on Crunchbang, and I would like to install PiBang on my RPi so I can use it similar to my Laptop (which uses Crunchbang), I got my RPi in a Pimoroni starter kit, and it has an SD card with the Micro SD inside, I installed raspbian to it a few weeks ago, but I would like to erase that and use PiBang. Does anyone know how to do this? (I'm on Linux, not Windows).
GParted can erase the partitions and format the SDCard to FAT32, in Debian:

Code: Select all

apt-get update
apt-get install gparted
I have already tried gParted, the only partition that even allows you to delete/format is /dev/sdb1

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 8:30 pm
by Nyanical
I've still not erased this :cry:

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 8:38 pm
by beta-tester
Nyanical wrote:I've still not erased this :cry:
and by using dd... even then no luck?
if your SD card has the device name /dev/sdb (sdb1) take that device name /dev/sdb (not /dev/sdb1, that is only the first partition, but you have to take the whole device for using dd) to wipe out and transfer...

Re: Wiping Raspbian SD card?

Posted: Sun Nov 09, 2014 10:31 pm
by B.Goode
Nyanical wrote:I've still not erased this
Using dd to write the content of a .img file to the SD card is equivalent to erasing the previous content.

Just dd the PiBang image onto the card and your Raspbian installation will be gone!

Re: Wiping Raspbian SD card?

Posted: Mon Nov 10, 2014 6:13 pm
by Nyanical
Uh, I just did the terminal one. Now whenever I plug the SD card in or not, it says "No device found" or something along the lines of that on my tv when I select HDMI (Yes, I replaced the cable).

Re: Wiping Raspbian SD card?

Posted: Tue Nov 11, 2014 7:23 am
by beta-tester
here the official link to the process with DD
http://www.raspberrypi.org/documentatio ... s/linux.md