Solved How to best use gpart?

Pardon guys, this is a very newbie question. I converted a thumb drive into a bootable USB with the dd command. Now I would like to convert it back to a storage USB, however I don't know how to accomplish this with gpart. There's many Linux answers with fdisk and other tools, but I wasn't able to find an answer for FreeBSD gpart. I'm reading the man page gpart(8), but I'm uneasy taking any action. If someone can write an example on how best to do it, that would be appreciated. Thanks, and sorry for such a noob question.
 
There are plenty of examples in the gpart(8) man page. Just give it a try, I mean, what are you afraid of? Destroying the data? You're already going to do that. It doesn't matter how badly you use gpart(8), you can't destroy the disk itself. All that would happen is a bad partitioned disk, which can be wiped and you just start over. The only thing you need to watch out for, is using the correct disk and not accidentally wiping the wrong one.

Handbook: 17.2. Adding Disks
 
Okay, so I did:

# gpart destroy -F da1
# gpart create -s mbr da1
# gpart add -s 28G -t fat32 da1

Now I try to mount it:
# mount /dev/da1s1 /mnt

But it says: "mount: /dev/da1s1: No such file or directory"

How can I mount it? Thanks again.
 
You created the partition, but you haven't formatted it. So there's no filesystem on it yet.
 
You're right. Now I've done:

# newfs -U /dev/da1s1
# mount /dev/da1s1 /mnt

Now I can mount it, thanks!

I tried it on Windows but it didn't recognize fat32, so I redid everything using fat32lba. Now it also works there.
 
Back
Top