how to remove non existent volume from freenas

Status
Not open for further replies.

850cc

Cadet
Joined
Sep 21, 2011
Messages
6
Using freeness 801 RC1
I have a vol1 of 4 disks in raidz and its working fine.
For testing i added a sata disk and created a second volume vol2 with that disk
After some time i removed the drive without removing it first via the web interface
Now i have a yellow dot flashing on the webpage stating an error on vol2
Nowhere else in the webpage there is any mention of vol2 so i cannot remove it.
I think maybe via command line ?
I want to see a green dot instead of a yellow. I think he has to stop checking the state vol2 since it does not exist anymore.
Please help
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
So you only see "vol1" and you don't see "vol2" listed in Storage -> View All Volumes?

Are you able to add back the SATA disk so that vol2 is no longer failed, then delete it via the GUI?

I would advise holding off on using the command line for the time being until all other options have been exhausted since the command line can cause the GUI to become even more out of sync with reality (and there is no way to easily resync the GUI after you have performed command line operations).
 

850cc

Cadet
Joined
Sep 21, 2011
Messages
6
vol1 is ok
vol2 is gone in the gui and i don't need it anymore. The sata disk is used for something else. So i cannot put it back.
But i still get a yellow dot in right top of the gui.
 

meshsmith

Cadet
Joined
Sep 11, 2011
Messages
8
Hi there.

I've got a similar problem - I've got a multi-HD raid volume ("Vol1") which is working perfectly. I wanted to share an additional USB drive on the network, so I plugged it in and made both a volume ("Vol2") and a share.

Later on I unplugged the drive. Switching the NAS back on and going into the GUI showed a yellow alert light indicating that Vol1 is healthy, but that Vol2 has an error - to be expected, because the drive was no longer plugged in.

However, at that point I didn't need the USB drive shared anymore, so deleted the volume in the GUI (in the Volumes tab).

Upon reboot, however, I notice the yellow alert light still on, still insisting that Vol2 is unhealthy... Despite having removed both the volume and the drive. The Volumes tab doesn't show Vol2.

I tried plugging in the USB drive again and reboot - and lo and behold the green light is on, insisting that Vol2 is healthy.

But the problem is, it still isn't shown in the Volumes tab, and the USB drive isn't showing up as a disk when I want to create a new volume.

So I have this useless USB drive plugged in catering to a non-existent volume.



I want to delete the Vol2 volume so that the Freenas GUI will let me create it again, selecting the USB drive as an available disk again.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Try doing these 2 commands from the command line and post the results here if you can:

sqlite3 /data/freenas-v1.db "select * from storage_disk;"

sqlite3 /data/freenas-v1.db "select * from storage_diskgroup;"
 

eustonr

Cadet
Joined
Dec 1, 2011
Messages
2
I have a similar problem. I tried creating a new ZFS volume "archive". It tried for a bit, then returned to the normal web page, but the new volume was missing. Wasnt in the GUI at all, not in the command line either with zfs/zpool list, but the disks from the gui were missing so i couldnt try to recreate it.

Its VERY frustrating, as the database is now out of sync, and there's seemingly no way to fix it.

How do I manually fix the database?

Using the above SQL I get :

# sqlite3 /data/freenas-v1.db "select * from storage_volume;"
1|iscsivol|ZFS
2|archive|ZFS


# sqlite3 /data/freenas-v1.db "select * from storage_disk;"
Minimum|10|{uuid}64d11d3d-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||1|ada0p2
Minimum|10|{uuid}6539b2d3-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||2|ada1p2
Minimum|10|{uuid}657e0f21-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||3|ada3p2
Minimum|10|{uuid}65e21cd7-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||4|ada5p2
Minimum|10|{uuid}661bbaa2-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||5|ada6p2
Minimum|10|{uuid}664f0597-c725-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of iscsivol raidz|1||6|ada7p2
Minimum|10|{uuid}aa86d576-c726-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of archive stripe|2||7|ada2p2
Minimum|10|{uuid}aade7932-c726-11e0-b6f2-0023545fbfa7|1|1|Auto|Member of archive stripe|2||8|ada4p2
Disabled|Always On|{uuid}d2d195eb-1c17-11e1-a534-001b21a1f09b|1|Disabled|Auto|Member of archive raidz|3||9|ada2
Disabled|Always On|{uuid}d327e81c-1c17-11e1-a534-001b21a1f09b|1|Disabled|Auto|Member of archive raidz|3||10|ada3
Disabled|Always On|{uuid}d37d6a61-1c17-11e1-a534-001b21a1f09b|1|Disabled|Auto|Member of archive raidz|3||11|ada4
Disabled|Always On|{uuid}d3f77d9e-1c17-11e1-a534-001b21a1f09b|1|Disabled|Auto|Member of archive raidz|3||12|ada5
 

eustonr

Cadet
Joined
Dec 1, 2011
Messages
2
Solved this myself. My SQL is a bit rusty, but this was the trick :

(mount the boot USB read-write)
mount -uw /

(backup the database)
cp /data/freenas-v1.db /data/freenas-v1.db.bak

(start sqllite)
sqlite3 /data/freenas-v1.db
(delete the bad entries)
delete from storage_disk where disk_group_id=3;
delete from storage_disk where disk_group_id=2;
delete from storage_volume where id=2;

.exit
and reboot

My problem stemmed from the fact I had a ZFS volume a few weeks back, which I'd deleted. The disks were still defined in a disk_group (id 2 above) in the database, so FreeNAS barfed when I tried creating a new volume with the same name.

I got the names of the keys (to do the remove) with the .schema command

.schema storage_disk
.schema storage_volume​

Other useful sqlite3 commands :

.help
.tables (which lists all the tables defined)​

Robert
 
Status
Not open for further replies.
Top