Fromatting SD card

Post your general questions or comments about GhostBSD here!
Post Reply
gbar
Posts: 40
Joined: Wed Apr 05, 2017 12:30 pm

Fromatting SD card

Post by gbar »

Hi,

I'm struglling to format a 16 GB SD card previously used in a raspberry pi.

$ geom disk list
Geom name: da0
Providers:
1. Name: da0
Mediasize: 15931539456 (15G)
Sectorsize: 512
Mode: r1w1e3
descr: Mass Storage Device

$ gpart destroy -F da0
gpart: Device busy

It returns to the command prompt and doesn't do anything?

what am i doing wrong?
ta
aschiebe
Posts: 30
Joined: Sat Mar 14, 2020 4:04 pm

Re: Fromatting SD card

Post by aschiebe »

have you checked if the device has been auto mounted?
gbar
Posts: 40
Joined: Wed Apr 05, 2017 12:30 pm

Re: Fromatting SD card

Post by gbar »

Hi,

No i don't think so, see screen shot
Attachments
Screenshot at 2020-03-24 19-03-50.png
Screenshot at 2020-03-24 19-03-50.png (13.46 KiB) Viewed 10419 times
aschiebe
Posts: 30
Joined: Sat Mar 14, 2020 4:04 pm

Re: Fromatting SD card

Post by aschiebe »

man gpart destroy shows me this, so try first gpart delete afterwards try gpart destroy

Deleting Partitions and Destroying the Partitioning Scheme
If a Device busy error is shown when trying to destroy a partition table,
remember that all of the partitions must be deleted first with the delete
action. In this example, da0 has three partitions:

/sbin/gpart delete -i 3 da0
/sbin/gpart delete -i 2 da0
/sbin/gpart delete -i 1 da0
/sbin/gpart destroy da0

Rather than deleting each partition and then destroying the partitioning
scheme, the -F option can be given with destroy to delete all of the
partitions before destroying the partitioning scheme. This is equivalent
to the previous example:

/sbin/gpart destroy -F da0
gbar
Posts: 40
Joined: Wed Apr 05, 2017 12:30 pm

Re: Fromatting SD card

Post by gbar »

Thanks for your help.

So, i'm getting this -
fdisk /dev/da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=1936 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1936 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
start 8192, size 114688 (56 Meg), flag 0
beg: cyl 0/ head 130/ sector 3;
end: cyl 7/ head 165/ sector 30
The data for partition 2 is:
sysid 131 (0x83),(Linux native)
start 122880, size 30993408 (15133 Meg), flag 0
beg: cyl 896/ head 0/ sector 1;
end: cyl 815/ head 3/ sector 16
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>

I can delete as follows -

/sbin/gpart delete -i 2 da0
da0s2 deleted

but not partition 1-

/sbin/gpart delete -i 1 da0
gpart: Device busy

gpart show da0
=> 63 31116225 da0 MBR (15G)
63 8129 - free - (4.0M)
8192 114688 1 fat32lba (56M)
122880 30993408 - free - (15G)
aschiebe
Posts: 30
Joined: Sat Mar 14, 2020 4:04 pm

Re: Fromatting SD card

Post by aschiebe »

stupid question, the sd card is not physical locked?
Vermilion
Posts: 86
Joined: Sat Jan 18, 2020 5:52 am

Re: Fromatting SD card

Post by Vermilion »

it must be:

gpart destroy -F /dev/da0

did you type it exactly like this?
gbar
Posts: 40
Joined: Wed Apr 05, 2017 12:30 pm

Re: Fromatting SD card

Post by gbar »

Hi,
There is no physical lock, it's a microSD card, haven't seen that on anything other than full size SD but thanks.
Nope, no luck with gpart destroy -F /dev/da0. Even tried copy and past -
gpart destroy -F /dev/da0
gpart: Device busy
gbar
Posts: 40
Joined: Wed Apr 05, 2017 12:30 pm

Re: Fromatting SD card

Post by gbar »

So........i gave up and formatted it on a Macbook like the quitter i am

Next daft question........ Why can't i compile C++ code?

trying the very simple-
g++ Hello.cpp
brings up all manner of ###?
Post Reply