Totally newbie with FreeBSD 14-RELEASE. Added new hard disk with zfs, i can't able to mount it. Need actual help.

Hi.

Is the first time i am managing ZFS hard disks, no previous experience. This situation is on qemu (kvm).

Code:
# gpart show
=>          40    30719920    ada0    GPT  (15G)
               40            1024          1    freebsd-boot  (512K)
           1064              984                - free -  (492K)
           2048      4194304          2    freebsd-swap (2.0G)
     4196352    26521600          3    freebsd-zfs     (13G)
   30717952            2008                - free -  (1.0M)

=>         40     43999927   ada1     GPT  (21G)
              40             1024         1     freebsd-boot  (512K)
          1064               984                - free -  (492K)
          2048       4194304         2     freebsd-swap (2.0G)
   4196352      39801696         3     freebsd-zfs     (19G)
  43998048             1919                - free -  (960K)
#
Now, ada0 is the boot hard disk, and the only is mounted in the boot process. /dev/ada1p1, /dev/ada1p2 and /dev/ada1p3 are present on the fs tree but unmounted. As i said, i found manage ZFS looks quite different to the rest of previous file systems i knew, and i honestly don't know how to mount ada1p3, which is the partition i'm interested in, cos have data i need copy on ada0p3. I read various webs about pools and zpool, but i don´t understand these concepts.

Please, humbly i need some help. Why a mount /dev/ada1p3 /mnt/ can't be enough?. :(

Thank very much, in advance.
 
The freebsd-boot partition doesn't have a filesystem, it's basically raw data that's found and read 1-to-1 into memory by the code in the master boot record. That's why it's not mounted, there is no filesystem to mount here.

As for ZFS, look at the output of zpool status. If you haven't done anything yet, you will see that ada0p3 is part of the zroot pool. If you look at zfs list you'll see the various datasets that have been created on this zroot pool.

Assuming you want to use ada1p3 as a separate ZFS pool for data for example, you need to create a pool first. You can do this with zpool create zdata /dev/ada1p3 for example. This will create a pool with the name zdata from the ada1p3 partition.

Creating the zdata pool will automagically also create a /zdata mount point and mount the dataset there. You can then use zfs create zdata/some_storage to create a new dataset called some_storage on the zdata pool. It will inherit the mountpoint from the parent so this will get mounted on /zdata/some_storage. If you want to mount this somewhere else you can add -o mountpoint=/some/other/dir to the zfs-create(8) command. Or use zfs-set(8) to set/change the 'mountpoint' property after the dataset has been created.
 
Hi, SirDice.

# zpool create zdata /dev/ada1p3
invalid vded specification
use '-f' to override the following errors:
/dev/ada1p3 is part of active pool 'zroot'
#

I'm totally lost on this, SirDice. I used think of myself that i'm good understanding computing concepts, but this thing with the zfs and pools drive me crazy. If the partition is already on the active pool zroot, how can i access to the data?.

Thanks, again.
 
T-Daemon: Thanks, very much:

# zpool import -a
no pools available to import
#

can't understand why
/dev/ada1p3 is part of active pool 'zroot'
and at the same time
# ls -lh /zroot
total 0
#
#zpool status
pool: zroot
state: ONLINE
config:

NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
ada0p3 ONLINE 0 0 0

errors: No known data errors
#

What must be done?. Thanks.
 
How can i mount the pool named zroot in the directory /zroot?

Thanks in advance.
 
can't understand why
Code:
 /dev/ada1p3 is part of active pool 'zroot'
and at the same time
Code:
# ls -lh /zroot
total 0
There are two pools with the name "zroot", one on ada0p3, the second on ada1p3.

The mountpoint /zroot belongs to the pool on ada0p3, which is according to zpool status currently booted. And also, normally there is nothing beneath that directory. zfs get name,mountpoint will show you which datasets are mounted under which mountpoint.

But this is not important, concerning is
# zpool import -a
no pools available to import
Please use zpool import alone (without the -a flag) to list available pools first before importing them.

The command you've executed should have shown the other "zroot" pool available for import.

Please try zpool import again. And (just to make sure) show us fstype -u /dev/ada1p3 and zpool list.




Furthermore, use the -R /<mountpoint> flag when importing the pool. Otherwise, when the pools have identical datasets with identical mount points, those would be supra-mounted on top of the existing mount points of the booted system.

In addition, in case of same pool names, use the numeric number (id) instead of pool name (that pool id is show in zpool import) and the pool must be renamed to be importable. Example:
Code:
zpool import -R /mnt 12104546264779236209 zroot1

To access all dataset file systems of (now) zroot1 zfs mount zroot1/ROOT/default.


If you plan to use ZFS further on I suggest make yourself familiar with ZFS by reading Chapter 22. The Z File System (ZFS) in the handbook.
 
Back
Top