ZFS How to un-ZFS-ify a drive?

I put ZFS on a microSD card to try s.th. out (keylocation file to prompt). Worked as hoped for.

How does one remove ZFS from the drive again? So that gpart shows the device and I can dd an OS image onto it?

Actually, I find it confusing that a ZFS drive goes under the radar of gpart.
 
I find it confusing that a ZFS drive goes under the radar of gpart.
It doesn't. But it will if you use the whole disk for ZFS, but that's not "under the radar". There's simply no partition table at all.
 
Are you doing this from a FreeBSD system?
Exactly what gpart command are you running, gpart list?
What does "geom disk list" show?
How about just "ls -ltr /dev/da*"

If geom disk list shows da0 and ls -ltr /dev/da* also shows something, does "mount" or "zfs list" show anything related to da0?
Related to SirDice how did you initially set up zfs on da0?

In theory, as long as nothing is mounted /using da0 you should be able to do gpart commands to create a partition table.
 
Are you doing this from a FreeBSD system?
Exactly what gpart command are you running, gpart list?
What does "geom disk list" show?
How about just "ls -ltr /dev/da*"

If geom disk list shows da0 and ls -ltr /dev/da* also shows something, does "mount" or "zfs list" show anything related to da0?
yes, 15.0-RELEASE-p1

Geom name: da0
Providers:
1. Name: da0
Mediasize: 31927042048 (30G)

zfs list
no datasets available

ls /dev/da0
/dev/da0
 
Still, it could show s.th. like

34 500118125 ada0 GPT (238G)
- zfs - (238G)
Not if you created the zpool on the "whole device". That would have wiped out any existing partition table.

So based #7, you should be able to do "gpart create -s GPT /dev/da0" If you do that, it will probably show up under gpart list
 
Why would it show partition information if there's no partition table on the disk?
I think this confuses some people because a brand new USB drive you get from Walmart "shows up" simply because it has a partition table of some sort because it's been formatted to some kind of Windows thing.
"Why does a brand new one show up but one I mucked with doesn't".
 
Not if you created the zpool on the "whole device". That would have wiped out any existing partition table.

So based #7, you should be able to do "gpart create -s GPT /dev/da0" If you do that, it will probably show up under gpart list
That did the trick. Thank you.

Bash:
# gpart create -s GPT /dev/da0
da0 created
# gpart show
..
=>      40  62357424  da0  GPT  (30G)
        40  62357424       - free -  (30G)
 
Now you can add partitions :
gpart add -t freebsd-zfs -s mysize -l mylabel /dev/da0
gpart add -t freebsd-ufs -s mysize -l mylabel /dev/da0
gpart add -t linux-data ada0 (for ext4)
gpart add -t ms-basic-data (for ntfs)
gpart add -t \!12 (for msdos)
 
Using CoW filesystems on devices like USB pendrives and SD cards with no wear leveling is a bad idea due to the write amplification. Someone should tell the NomadBSD guys to add this warning.
 
Back
Top