Detaching a single disk volume makes disk unusable

Status
Not open for further replies.

Sycobob

Dabbler
Joined
Jul 23, 2018
Messages
19
I'm setting up a new NAS and noticed something strange. It appears that any time I detach a volume it becomes unusable. Attempting to create a new volume results in Unable to GPT format the disk "ada1": gpart: geom 'ada1': File exists and wiping it from Storage > View Disks yields Failed to wipe ada1p1: dd: /dev/ada1p1: Operation not permitted

I've read that FreeNAS won't let you wipe a partitioned drive, which makes some sense. But there's no way to do that without command line chicanery. gpart show ada1 shows a freenas-swap and a freenas-zfs partition. I can use gpart delete -i 2 ada1 to kill the zfs partition, but attempting gpart delete -i 1 ada1 fails with gpart: Device busy. This happens repeatably whether or not I use the 'mark the disks as new' flag when detaching the volume.

So far the only way I've found to actually use the disk at this point is to
Code:
sysctl kern.geom.debugflags=0x10
dd if=/dev/zero of=/dev/ada1 bs=512 count=1000
dd if=/dev/zero of=/dev/ada1 bs=512 count=1000 oseek=7814036168

then I can reboot and wipe.

I'm currently reading the manual and learning to setup and administer the system, so luckily no data is at risk at the moment, but it has me confused and worried.

Is this some sort of known issue? Am I doing something wrong?
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
Is this some sort of known issue? Am I doing something wrong?
Not doing anything wrong as far as your description is stating.
This is just a Freenas "seatbelt" so you cannot easily overwrite a drive
by mistake. If Freenas detects a ZFS formatted drive, it's making it
more difficult to destroy that format on purpose.
 

Sycobob

Dabbler
Joined
Jul 23, 2018
Messages
19
It's more than just a seatbelt, it looks like a bug to me.

1) If I detach a volume and don't check the 'mark disks as new' box, I can't import the volume back in and recover my data.
2) If I detach a volume and check the 'mark disks as new' box, I can't wipe or use the drive.

It seems like something is broken when detaching. I recall a forum post where someone said detaching volumes with a single disk is broken, so maybe that's what is going on.
 
D

dlavigne

Guest
How often are you detaching the disk? FreeNAS assumes permanent storage and that you would only detach as a one-off to reuse the disk in a new pool.
 

Sycobob

Dabbler
Joined
Jul 23, 2018
Messages
19
It happens on the very first remove. I was testing with a brand new (temporary) vdev to learn how replacing a drive would work.
 
Status
Not open for further replies.
Top