Solved ZFS - Mount second drive in fstab - no such file or directory.

I am trying to install FreeBSD on ZFS.
I did this with an manual ZFS installation by changing the freebsd-ufs to freebsd-zfs.

I have two disks. The capacity does not matter.
One is for the root partition, the other is for /home.

On boot, it throws up a console that cannot find the disk or directory.

When ZFS is set on the drive for root and the other UFS works normally.

However when I want to connect both drives to ZFS it does not work.

I tried installing it on a virtual machine. I attach the photos in the attachments.

1.jpg2.jpg3.jpg
 
Welcome to FreeBSD Forums.

If it helps: for OpenZFS in FreeBSD, mounts are scripted – without requiring fstab(5).

Code:
% sysrc zfs_enable
zfs_enable: YES
% file /etc/rc.d/zfs
/etc/rc.d/zfs: POSIX shell script, ASCII text executable
%

rc.conf(5), NB the link to sysrc(8)
 
...??? :-/ - I don't really get what you're trying to do.... a own physical partition for each root and home, okay. But why then using zfs if you easily could have done it with ufs? ...

I don't really get, what you've actually done by meaning with

by changing the freebsd-ufs to freebsd-zfs.
So I'm guessing.
You cannot just simply "switch" from ufs to zfs.
Even to use ZFS is not rocket science it's not just another "flavor like ufs, ext2, fat32 or ntfs".
Such as what grahamperrin posted about the /etc/rc.conf entry, the system needs to be told to handle zfs (kernel module needs to be loaded).
Also the system needs to be able to boot zfs, too.

Neither of your zfs partions seems to be part of a pool.
Besides pools are the main reason to use zfs anyway you cannot use a zfs partition per se.
With zfs you mount pools, not partitions. A zfs partition needs to be part of a pool or it's just a fresh generated filesystem (empty) that does not belong to anything (useless).

Well at least you get a shell...proves how tolerant/stable FreeBSD is :cool:
...and from there there are possibilities to make the system run (again)..

Maybe you need to read a bit about zfs to get the hang of
disks -> partitions -> pools -> filesystem (e.g. root)




 
Ok, thanks. I got it.
A "zpool" must be created. And in /etc/rc.conf zfs_enable="YES" Must be set.
Code:
zpool create example /dev/ada1

And this "example", should be mounted according to the diagram.

Too bad the automaker didn't do that... By the way, I have two disks. One SSD on / because it's fast. The other HDD for data.

PS. Maybe someone doesn't know, but there is a ZFS installer to choose from when installing. I simply changed the letters from UFS to ZFS. But it's working now. On Virtual Machine.
4.jpg5.jpg6.jpg
 
However when I want to connect both drives to ZFS it does not work.
I don't understand what you mean by this. As Profighost points out, ZFS is very, very different from most other file systems. Drives (or partitions) make up vdevs, zpools are made from one or more vdevs, and filesystems are made on zpools.

I like this graphic representation:
zfs-overview.png


The blog post it comes from is very enlightening, too.

My favourite thing about ZFS is that there's no need to slice and dice disks or volumes, etc., hoping to get it just right so that you don't run out of space, but also don't wind up with a bunch of mostly empty space. By default every filesystem can use all the free space on its zpool. Ran out of space on your zpool? No worries, just add a new vdev to it.
 
However:
Dig into ZFS is worth it anyway. It's the best filesystem I've ever worked with. (don't need to list all advantages, I guess that's why you decided for it in the first place, to check it out.):)

But it reveals its advantages in full first if there there are more than one disk/partition per pool are involved. (That's why I don't see much sense in using one-partion-pools for each home or root.)

Tip:
If you have a unused machine and a couple of HDDs/SSDs experiment a bit with it.
It's always good to have made some experiences on a "dummy-system" first, if/when the real desaster strikes ?
 
I've been reading for a while, but I have other things to do besides hobbies. :)
It would be nice if you could make a single workspace out of different drives.
 
Maybe someone doesn't know, but there is a ZFS installer to choose from when installing.
Of course. That's the very first, best and easiest choice to start with zfs.
You have different choices (stripe, mirror, raidz...) and get a functioning system on zfs.
But I didn't mentioned it, because neither I wanted you to look bad and still there was a chance that you're trying something feaky and I've made a fool of meself ?

However, the idea of using the fast SSD for / and the HDD for data ain't bad. But in my eyes it makes no sense to do this with zfs, since there is still only one partition per pool.
My advice would be to choose ufs for that or add more disks.
Otherwise you'll have less fun with zfs. :cool:

On my side of the ocean it's late. ?
Enjoy, and succeed!
 
Perhaps you could share a little bit more about what you would like to do with FreeBSD in the short term.
  1. Experimenting with and learning FreeBSD - less emphasis on the filesystem
  2. Experimenting with and learning FreeBSD but mostly interested in ZFS
  3. Learning FreeBSD but, less experimenting. Using FreeBSD for "normal" data.
  4. Something else
If you have one SSD and one conventional HD, it rather limits your possible setups for using ZFS. Those two disk are unequal in speed and, I presume, in size as well. Although you can install and work with ZFS installed on just one disk (either one), I would not advise that as your first ZFS experience; you have no redundancy. Without redundancy means that if there happens to be some (even minor) kind of data failure on that one ZFS disk, all your data is lost (only backups will be able to help you then). Unless you are experimenting and learning, and by that emphasis I mean that you do not mind losing all your data and starting afresh, I would not recommend that. A "sensible" (desktop) setup using ZFS would include a minimum of two equal disks.*

For learning and using FreeBSD (not really interested in ZFS as a filesystem in particular) UFS is a good choice; also after the beginners phase.

For ZFS, the following could give you a clearer picture of what ZFS is about and help you on your way:
  1. ZFS for Newbies by Dan Langille**
  2. Today's ZFS Michael W Lucas**
  3. Choosing the right ZFS pool layout (August 30, 2021); by Klara Systems
If you want other extensive FreeBSD resources, besides the FreeBSD Handbook, at your disposal, have a look at FreeBSD Development: Books, Papers, Slides: The general Absolutely FreeBSD (e)book and two ZFS (e)books. The first book absolutely works for learning and working with FreeBSD (with UFS and ZFS).

* Edit: Two equal disks being the same size and the equivalent in type: two SATA conventional HDs, two SATA SSDs, two NVME SSDs; each pair should have preferably the same speed properties.
** Edit: videos #1 & #2 are both for beginning ZFS users, both cover quite a lot (ZFS has a lot to offer). I mainly gave these two so you have a choice; I think that either one will give you a worthwhile introduction of the basics of ZFS.
 
I've been reading for a while, but I have other things to do besides hobbies.
Frankly spoken then you shall think if FreeBSD would be the right choice for you, or why you want to try it out.

I also have other hobbies ?️‍♂️ and things to do.
That's why I don't present the fastest progress in knowing FreeBSD ?
I started on FreeBSD app. in 2013 with my primary target to get rid off MS Windows - I am neither a programmer, nor developer, nor "experimenting OS enthusiast", just a pure user, only. (Even if FreeBSD would be very good choice for any porgrammer, especially systems developers! But that's offtopic here.)

I evaluated what operating systems there are, to chose right one for me before I dig into one.
I already knew there will be the need of digging into it. I wanted to, because one of my main purposes of getting rid off Windows was I wantetd to have control over my slave the machine. And that means learning.
So, I wanted to chose the system that's worth learning, and my decision felt for FreeBSD.
Right decision - if you're willing to dig into it ?

Learning is the price you pay if you really want to know and have control over your system instead of grab something turnkey from a silver tablet.?

Now I'm a bit further, having all my machines running on FreeBSD, no Windows at all anymore, currently setting up my second little "server" (because I tatterd my first one of pure stupidity ? [still running, no data loss at all - I LOVE FreeBSD!])...
...going on comes naturally with the OS?‍♀️ ?
I daresay:
With FreeBSD you enter a road that can bring you anywhere but will never end. ?
But I'm far away - way far away - even of thinking of me I would be an expert on FreeBSD.
In this forum are many experts, real geeks, freaks, system developers and programmers, hackers, professional server admins, specialists on many systems, not FreeBSD only... - Pros, real Pros (my nick has a complete other background and is ment sarcastically)
Mostly they read only, seldom post. But they are here, and they help if it can't be solved on "low level" (like this one ?) If there is a real nut to be cracked, or intervene if something is running completely wrong (this forum is actually actively moderated), they are here.

So once again:
MS Windows, Apple's OS (consisting of parts derived from FreeBSD), or famous Linux distributions all give you a predefined bundle of choices, predesigned look & feel, which desktop environment, which software, apps... - ahead thoughts of usage - predefined ideas and made decisions.
They are all ment to be primarily desktop-systems for single-users-don't-want-to-think-and-learn-about-computers.
There's nothing wrong with that, but you're stuffed in a one-size-fits-all-overall.
First decision you have to make:
Can you live with that or not?

Most people who decide they cannot, looking for another one-size-fits-all.
Some find one (mostly a Linux distri).
But too many trying one one-size-fits-all after the other, restless searching, not realizing there will be none that's indiviual tailored suiting exactly the very personal needs.
It can't be.
Those who realize this mostly end up with FreeBSD, or NetBSD, GhostBSD...
Because those are systems ment to be tailored individually.
Tailored means modular, and individually means by yourself.
Nobody can know what you want but you.
So if you really want to make it fit exactly your wishes and needs you have to do it yourself.

FreeBSD is a modular system, trying to make it fit in as many needs and on as many platforms as possible.
desktop, server, embedded,...single/multi-user,... cooperating network systems... what have you? What do you need/want?
You have something FreeBSD has not accounted yet? I'd bet developers will suddenly listen to you very closely with high interest! ?

The downside of individually self-tailored is, not much can be done automatically.
Because automation always requires decisions already made.
Many automated things in FreeBSD work exemplary! Even better than in all other systems I had.
Install via pkg or even ports is so smooth and easy. No verbiage window clkicking orgies.
And in app. 99% of all cases properly, if system and pkg database are consistent (updated to most recent version.)
Not like this Linux-crap I experienced: "sudo-this, sudo-that, sudo, sudo, sudo,....Warning, Warning, Warning, Error, Error, Error, Aborted! ?)

But at least in a modular system you have to make the decision, what to be installed - and why.
Nobody and Nothing can read minds.
Either somebody else is making the decisions for you, or you have to know what choices there are why are you decide for something.
Only YOU can know what you want.
But for that that you first need to know exactly what you want.
Nobody can help you there.

This means learning.

The most efficient way of learning is reading.
What you really want in 99% of all cases is the text, actually.
It doesn't matter if it's written or spoken, you want the text.
If one is not very slow - not to say stupid - reading is always way quicker than spoken words.
And instead of listenting to some youtube-stammering within a text you can skip the crap and jump to the point.

OK, for computer's stuff you need to learn reading again, namely computer stuff.
There's so many I also get pissed over and over again:
"XYZ-TF - on/off" - okaaayyy.... what does is do?!
"XYZ-TF - on/off sets the XYZ-TF on/off" - NO!! You must be kidding. REALLY?! - WTF IS XYZ-TF?!?!?!!!1eleven... ??
Since the dawn of computers the problem is:
Programmers are bad and damned lazy on documentation.
They think what's obvious to them has to be obvious for everybody - or the one is not worth it and first have to learn about it.
Yeah, of course. I want to. But where, when not here?! :-/

Short:
Getting involved in FreeBSD means reading.
Lots and lots of reading.
A forum is very willing to help you with the hooks. But it simply cannot substitute the reading for you.
The benefit is a reliable, stable system under your very control and lots of computer knowledge within a very friendly, very helpful, very understanding community of very cool guys worldwide.
And maybe more.

But - as I pointed out epically - that's your decision.?
 
It would be nice if you could make a single workspace out of different drives.
Sounds like a zpool to me. Consider this example. You have three drives, one 1TB drive, one 2TB drive, and one 3TB drive.

Create a single 1 TB partition on the 1 TB drive, two 1 TB partitions on the 2TB drive, and three 1TB partitions on the 3 TB drive.

Now you can create two vdevs:
  • One RAIDZ vdev using 1TB partition from each drive. Capacity will be 2TB.
  • One mirror vdev using the remaining 1TB partition from the 2TB drive and one more from the 3TB drive. Capacity will be 1TB.
A zpool created from these two vdevs will have a capacity of 3TB and will be able to tolerate one drive failure without losing data. You'll be left with an unused 1 TB partition. You could use UFS on it, or create a second zpool on it for further experimentation.

This setup has obvious performance problems. It's only meant as an example of how one might experiment with ZFS given a bunch of dissimilar drives that may be lying around unused.
 
[...]Now you can create two vdevs:
  • One RAIDZ vdev using 1TB partition from each drive. Capacity will be 2TB.
  • One mirror vdev using the remaining 1TB partition from the 2TB drive and one more from the 3TB drive. Capacity will be 1TB.
A zpool created from these two vdevs will have a capacity of 3TB [...]
This setup has obvious performance problems. It's only meant as an example of how one might experiment with ZFS given a bunch of dissimilar drives that may be lying around unused.
pool2.png

This is an overly complicated example. While possible*, I've never seen such a pool construction mentioned, even as an example (let alone advertised or recommended). Besides the mentioned performance problems, this example stresses the drives very unevenly. Perhaps you can estimate with confidence what will happen once one drive or perhaps (only data in) one partition fails and what needs to be done to recover a degraded pool. My guess would be that someone new to ZFS could have (big) problems with that, apart from a real possibility of confusion that may unintentionaly lead to the loss of the pool.

OP does not even have a stable FreeBSD set up (ZFS or UFS) to which "a bunch of dissimilar drives that may be lying around unused" could be added. Also, OP mentions elsewhere that a possible disk is currently in use for running torrents. And looking at earlier messages, it is not even really clear to me if ZFS—or any kind of ZFS "experimental" workplace—is what is required or wished for.

I think, for someone who clearly has never worked with ZFS (the OP or anyone else for that matter), not useful.

___
* ( if you must, for experimental use, I'd consider two mirrors, also resulting in 3 TB available in the pool )
 
Thanks for the diagram! That's super cool.

I've never seen such a pool construction mentioned, even as an example (let alone advertised or recommended).
Were you expecting me to plagiarize someone? FWIW, I did something similar* when I was trying to learn vinum back in the day.

Besides the mentioned performance problems, this example stresses the drives very unevenly.
Yes, the larger drives will get roughly twice the IOPS that the smaller drive gets. This is also why this is a performance lose. It might be somewhat mitigated by the fact that larger drives tend to be newer and faster.

Also, OP mentions elsewhere that a possible disk is currently in use for running torrents.
Torrents are by nature distributed, and therefore an ideal use case for an unreliable storage system. As long as the OP is not the only seeder, of course. I wouldn't use this for any data I could not stand to lose, however.

And looking at earlier messages, it is not even really clear to me if ZFS—or any kind of ZFS "experimental" workplace—is what is required or wished for.
I've been reading for a while, but I have other things to do besides hobbies. :)
It would be nice if you could make a single workspace out of different drives.
Hobbies and experimentation are directly related or at least adjacent. A "single workspace" sure sounds like a zpool to me, like I said above. I learn by doing. It sounds like the OP has had enough of reading for a spell, and is perhaps ready to try some stuff out.

If you must, for experimental use, I'd consider two mirrors, also resulting in 3 TB available in the pool
The disadvantage of this as an example is that it does not illustrate the fact that you can have dissimilar vdevs in a zpool. That was not immediately obvious to me, but perhaps you are smarter than me. It also precludes any experimentation with resilvering. It would be interesting to remove the 1TB drive, zap it, and add it back. Also, an exercise for the reader would be to consider why you would not want to create a third vdev with the remaining partition and add it to the zpool.



* The actual Frankenstein's monster of discarded ATA and SCSI drives I built with drives I scavenged from work was far more complicated. For a while I even had a full-height SCSI-1 20MB drive connected to it for the laughs.

I used it to keep a local news spool back in the days of dialup. I had my Freebsd server configured to dial up my ISP in the middle of the night and suck down the new articles from a few Usenet groups I cared about. In theory I would then enjoy lightning fast NNTP browsing without tying up my phone line the next morning. It worked, for some values of "worked", but not for long. Usenet is another great use case for unreliable storage. There's always a copy upstream somewhere.

I was older and richer (and hard drives were less expensive) by the time I tried ZFS, so I bought 4 new drives for the purpose. Not everyone can afford that luxury.
 
Back
Top