Creating volumes from the CLI

Status
Not open for further replies.

HeloJunkie

Patron
Joined
Oct 15, 2014
Messages
300
I am attempting to create volumes from the command line and I am not having any success. I suspect I am missing something simple but I cannot figure it out. Creating them from the GUI works fantastic, but I want to learn to do everything from the command line.

Looking at the docs shows me that I am using the correct command(s) but still no luck. Any guidance would be helpful.

Running 9.2.1.8

Thanks

[root@freenas01] ~# camcontrol devlist
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus0 target 0 lun 0 (pass0,ada0)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus1 target 0 lun 0 (pass1,ada1)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus2 target 0 lun 0 (pass2,ada2)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus3 target 0 lun 0 (pass3,ada3)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus4 target 0 lun 0 (pass4,ada4)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus5 target 0 lun 0 (pass5,ada5)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus6 target 0 lun 0 (pass6,ada6)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus7 target 0 lun 0 (pass7,ada7)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus8 target 0 lun 0 (pass8,ada8)
<WDC WD40EFRX-68WT0N0 80.00A80> at scbus9 target 0 lun 0 (pass9,ada9)
< USB DISK 2.0 PMAP> at scbus11 target 0 lun 0 (pass10,da0)


[root@freenas01] ~# zpool status -v
no pools available

[root@freenas01] ~# df
Filesystem 1K-blocks Used Avail Capacity Mounted on
/dev/ufs/FreeNASs2a 948903 721303 151687 83% /
devfs 1 1 0 100% /dev
/dev/md0 4663 3388 902 79% /etc
/dev/md1 823 1 756 0% /mnt
/dev/md2 152791 47212 93356 34% /var
/dev/ufs/FreeNASs4 20263 2481 16161 13% /data

root@freenas01] ~# zpool create vol1 raidz2 ada0 ada1 ada2 ada3
cannot create 'vol1': no such pool or dataset
 

enemy85

Guru
Joined
Jun 10, 2011
Messages
757
In Freenas lots of things are not supposed to be done from CLI if you want the system to behave properly...and creating a volume is one of that....
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Do yourself a favour and forget about FreeNAS because it is embedded system and makes things much harder. Get a copy of TrueOS. Install on the same system and read

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/zfs.html

You seem rather intent on drawing people away from FreeNAS for no real reason.

I am attempting to create volumes from the command line and I am not having any success. I suspect I am missing something simple but I cannot figure it out. Creating them from the GUI works fantastic, but I want to learn to do everything from the command line.

Looking at the docs shows me that I am using the correct command(s) but still no luck. Any guidance would be helpful.

Running 9.2.1.8

Thanks

The answer is that you don't use the CLI. Using it will screw up the back end that keeps FreeNAS running coherently. You must use the GUI whenever possible.
There is an API, but few around here have experience with it.
 

Oko

Contributor
Joined
Nov 30, 2013
Messages
132
You seem rather intent on drawing people away from FreeNAS for no real reason.
Why do you think that? Just because I answered three threads in a raw where FreeNAS was not the right tool for the job.

The answer is that you don't use the CLI. Using it will screw up the back end that keeps FreeNAS running coherently. You must use the GUI whenever possible.
There is an API, but few around here have experience with it.
It seems that we at least agree that using CLI is in most cases wrong thing to do with FreeNAS. Now he stated explicitly that he wants to learn how to use CLI. Thus my advise which you didn't like. Now check two other threads and see if my advises were not reasonable.

FreeNAS has been downloaded close to 6.5 million times. If you think that my comments can shrink its user base you have to drop that keyboard for couple of days and go for a long walk in the forest.
 

mjws00

Guru
Joined
Jul 25, 2014
Messages
798
@HeloJunkie

I'm pretty sure you are still in test mode and learning. So no reason not to learn the ZFS CLI. FreeNAS can get out of sync with GUI and the actual system if you do things behind its back. It also expects to see two partitions, one swap, one data mapped to gptid... so manual creation is a general no-no. But if you dig, one of the devs wrote a nice little walkthrough and I think we may even have a section in the manual ( sorry not looking right now. ) You can sync your pool to the GUI with an export, and auto import. But for production you are much better off giving FN EXACTLY what it expects to see. So creation via GUI is best.

Interestingly your command syntax is correct. So there must have been something else going on. Maybe something exists already as vol1? Not sure. Just for fun I threw a log of messing around with those commands so you can see for your self. Only 3 disks so sorry this log was just a stripe, the z1 pool I just did on the shell to test both for ya. This is a disposable 9.3 beta testing box.

Code:
Welcome to FreeNAS
[root@freenas2] ~# camcontrol devlist

<NECVMWar VMware IDE CDR10 1.00>   at scbus1 target 0 lun 0 (cd0,pass0)
<VMware Virtual disk 1.0>          at scbus2 target 0 lun 0 (pass1,da0)
<VMware Virtual disk 1.0>          at scbus2 target 1 lun 0 (pass2,da1)
<VMware Virtual disk 1.0>          at scbus2 target 2 lun 0 (pass3,da2)
<VMware Virtual disk 1.0>          at scbus2 target 3 lun 0 (pass4,da3)
[root@freenas2] ~# zpool create tank da1 da2 da3

[root@freenas2] ~# zpool status

  pool: freenas-boot
state: ONLINE
status: The pool is formatted using a legacy on-disk format.  The pool can
still be used, but some features are unavailable.
action: Upgrade the pool using 'zpool upgrade'.  Once this is done, the
pool will no longer be accessible on software that does not support feature
flags.
  scan: none requested
config:

NAME        STATE     READ WRITE CKSUM
freenas-boot  ONLINE       0     0     0
  da0p2     ONLINE       0     0     0

errors: No known data errors

  pool: tank
state: ONLINE
  scan: none requested
config:

NAME        STATE     READ WRITE CKSUM
tank        ONLINE       0     0     0
  da1       ONLINE       0     0     0
  da2       ONLINE       0     0     0
  da3       ONLINE       0     0     0

errors: No known data errors
[root@freenas2] ~# 


So not sure what's up. Something was up with your sys, clear the pools in the gui reboot and try again? Or just play more. Lots of us use the CLI where it is safe, just steer clear of things that might confuse FN. It's pretty trivial to create a jail and have a full freebsd install at your disposal with no chance of screwing the main sys up. Good luck.
 
Last edited:
Status
Not open for further replies.
Top