Cannot detach ufs volume in 9.2.1.5

Status
Not open for further replies.

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Using Freenas 9.2.1.5. I want to replace a UFS single disk volume with a ZFS Volume, but I cannot detach the UFS volume. When I view active volumes and click on the one I want to detach, the detach button shows just as it should. I click on the detach volume button, and select Yes to detach volume - the system looks like it is doing something but the volume does not detach. No error messages or anything, but the volume just doesn't detach. I have tried rebooting but the volume is still there.

I stopped the services accessing the volume (Plex) and removed the CIFS shares. Am I missing something?

Is there a way to do this from the command line?

Thanks.
 
D

dlavigne

Guest
You should just be able to format the existing disk with ZFS Volume Manager. I'm assuming you want to overwrite the data on the disk?
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
You should just be able to format the existing disk with ZFS Volume Manager. I'm assuming you want to overwrite the data on the disk?


Yes, I'm prepared to overwrite the data. However, because I am not able to detach the drive, it does not show up in the list of available drives with ZFS Volume Manager. I'm wondering if there is a problem with the GUI because the drive is still mounted and looks perfectly normal (with all data intact.)
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
I was finally able to capture the error message when trying to detach the drive: "Failed to unmount because device is busy." I turned off all the services that might access this drive and tried again - same error. I'm not a FreeNAS guru, so it is possible that I might have missed something, but for the life of me I could not figure out what it might be.

So, I shut down the system, disconnected the drive, then restarted the system. Obviously, it would not be able to mount the drive and if there was a service that accessed the drive then I would likely see some kind of error. I let the system run for 24 hours - no problems. Volume Manager reported that the volume was not mounted, so I took the opportunity to delete it. I then powered down the system again, reconnected the drive, then brought everything back up. Volume manager saw the drive and allowed me configure it as part of a ZFS mirror, which was my objective in the first place. Problem solved.

So why the problem? I have a guess: This drive was the first drive I used when I built my current system. There was a .system folder on it, created when I installed 9.2.1.5. Although I had subsequently added other drives and reset the location of the system dataset pool to a new volume, I think the GUI saw the .system folder on the old volume and therefore would not let me unmount.
 

alchuk

Cadet
Joined
Jul 1, 2014
Messages
4
Not pretending to give the only right answer, I'd presume there were some processes with opened files on your UFS volume left. Sometimes those processes do not even need to open files, but just 'chdir' somewhere down the mountpoint of given UFS vol. Next time try to find it out with 'fstat' utility running it within shell.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
alchuk,

It wasn't really necessary. But now, I'm certain there were open files in the .system directory. The UFS drive was the first drive I installed after building the system, and the only files on it - except for those I copied myself - were files related to the system dataset pool in the .system directory.

I have since made a few other adjustments to my volumes and noticed that when I reset the dataset pool location to a new location, the system still reports diskspace on the old pool location - so something must opening those files, even though the system is not actually using them anymore. For the record, when I attempt to delete the old .system directory files, I get a "system busy" error. They are trivial in size, so it's no big deal. Now that I understand what is going on, it doesn't bother me.
 
Status
Not open for further replies.
Top