JJL1
Posts: 15
Joined: Mon Jun 11, 2018 2:17 pm

Format SD card with pi

Tue Jun 12, 2018 7:17 pm

I tried to format in command line. Get warning that card is in use. Does it need to be unmounted first or, is it not possible for a noob? I just want a fresh copy. Did some hard shutoffs messing with Firefox, (pi froze probably from me having 2 browsers running at once or, video issues)
My friend has a Android that can put image on a formatted card. Android formatters tend to format the Android SD card not the one on the usb. I realize pi may not be capable. Just looking for a workaround with limited resources. Thanks

User avatar
thagrol
Posts: 3521
Joined: Fri Jan 13, 2012 4:41 pm
Location: Darkest Somerset, UK
Contact: Website

Re: Format SD card with pi

Tue Jun 12, 2018 9:55 pm

Were you trying to format the SD card the pi was running from? If so, that ain't gonna work easily, if at all.

If you were trying to format an SD card in a USB card reader, make sure that it hasn't been mounted anywhere and that you're trying to format the correct device.

Hint: the one callled /dev/sd<something> not the one callled /dev/mmcblk0
Hint 2: if you're logged into the GUI and using a terminal window the filemanager has probably automatically mounted the USB drive to /media/<username>/<something>. You'll need to unmount it.
Arguing with strangers on the internet since 1993.

JJL1
Posts: 15
Joined: Mon Jun 11, 2018 2:17 pm

Re: Format SD card with pi

Tue Jun 12, 2018 10:33 pm

thagrol wrote:
Tue Jun 12, 2018 9:55 pm
Were you trying to format the SD card the pi was running from? If so, that ain't gonna work easily, if at all.

If you were trying to format an SD card in a USB card reader, make sure that it hasn't been mounted anywhere and that you're trying to format the correct device.

Hint: the one callled /dev/sd<something> not the one callled /dev/mmcblk0
Hint 2: if you're logged into the GUI and using a terminal window the filemanager has probably automatically mounted the USB drive to /media/<username>/<something>. You'll need to unmount it.
Nope it's in a reader. Followed basic format instructions. When identifying I even ran ls again with it unplugged. It was mounted, so I'm sure that's it. Mounted must=in use . I'll try again.
THANK YOU!

JJL1
Posts: 15
Joined: Mon Jun 11, 2018 2:17 pm

Re: Format SD card with pi

Tue Jun 12, 2018 11:25 pm

SUCCESS! Thanks again! Here are the format directions for other noobs
Eject drive on taskbar
lsblk to identify I unplugged it and ran it again to make sure Mine was sba1 sba2
sudo parted /dev/sda (replace sda with your drive ignoring any numbers. mine was sda1 sda2)
(parted) mklabel msdos (parted is not part of command)
(parted) mkpart primary fat32 1MiB 100%
(parted) set 1 boot on
(parted) quit
lsblk to check it
sudo mkfs.vfat /dev/sda1 (replace sda1 with your drive)
Done! SWEEET!!!! PI can make it's own SD card!

JJL1
Posts: 15
Joined: Mon Jun 11, 2018 2:17 pm

Re: Format SD card with pi

Tue Jun 12, 2018 11:50 pm

This is the article I used, SD must be unmounted to format. Sorry about the extra post. Got to give credit. https://www.pcworld.com/article/3176712 ... linux.html

Return to “Beginners”