ZFS Gaining access to a two disk zfs mirror.

Hi All and thank you in advance for any help.

I have a Debian 11 install that consisted of two mirrored SSDs. One day there was a power cut and I cannot boot (I thought mirrored drives were quite robust, mine are quite young 1TB Samsung 870 EVO and 870 QVO ).

Booting with SmartOS usb I can see bpool and rpool. I cannot remember what is in the bpool but the root pool seems ok and holds / and /home which is all I really need. Unfortunately I cannot figure out how to do what I want with SmartOS

Can I make a freebsd bootable usb and mount the root pool / and /home and boot from there / ?

Sorry if this is a stupid question.

Best regards,
ozpos
 
Can I make a freebsd bootable usb and mount the root pool / and /home and boot from there ?
Probably. Make sure to use 13.2 or 14.0 so you have the latest OpenZFS. You can probably do this from the install media as they also have a shell option.
 
Hi SirDice, Thank you v much for your response.

If I do zpool status there are no errors but bpool shows that some features are not enabled. I am scared of using 'zpool upgrade' in case it makes the situation worse.

Do you know of a guide that may help me make a bootable usb that mounts rpool / and /home and boots from rpool / ?

Best regards,
Ozpos
 
Dear Ozpos,
I have a dual boot system running FreeBSD-13.2 and Debian Bookworm. I have created a ZFS pool using FreeBSD and access this pool from FreeBSD and Debian. The ZFS root pool for FreeBSD is a different pool. Debian root is on an EXT4 file system.

During the install of the ZFS tool chain on Debian I have been asked if I want to upgrade the pool or not. I have answered that with "no". This means that there might be ZFS options which are standard at the Linux version but not on the FreeBSD version. I also do not know if the question has been asked because there are differences or if the question is raised by default.

From my experience you should have a good chance to be able to proceed using a FreeBSD medium.
 
Dear Ozpos,
I have a dual boot system running FreeBSD-13.2 and Debian Bookworm. I have created a ZFS pool using FreeBSD and access this pool from FreeBSD and Debian. The ZFS root pool for FreeBSD is a different pool. Debian root is on an EXT4 file system.

During the install of the ZFS tool chain on Debian I have been asked if I want to upgrade the pool or not. I have answered that with "no". This means that there might be ZFS options which are standard at the Linux version but not on the FreeBSD version. I also do not know if the question has been asked because there are differences or if the question is raised by default.

From my experience you should have a good chance to be able to proceed using a FreeBSD medium.
Hi chrbr, thank you.
SmartOS is bsd based I think but there user base is quite small and getting help is difficult which is why I am here.

I have tried ZFSBootMenu but none of my attempts will boot and I posed the question on there forum 'would I be better off with btrfs and timeshift and one guy said probably.

Unfortunately I am a bit long in the tooth to switch my working environment from debian to freebsd which is why I am looking to use freebsd just as a bootstrap into debian if that all makes sense.

It feels like I amd just a few commands from booting into debian root but I do not know how to proceed.

Do you know of any guides that may help me understand the boot process and get this to work ?


Best regards,
Ozpos
 
Dear Ozpos,
I have a dual boot system running FreeBSD-13.2 and Debian Bookworm. I have created a ZFS pool using FreeBSD and access this pool from FreeBSD and Debian. The ZFS root pool for FreeBSD is a different pool. Debian root is on an EXT4 file system.

During the install of the ZFS tool chain on Debian I have been asked if I want to upgrade the pool or not. I have answered that with "no". This means that there might be ZFS options which are standard at the Linux version but not on the FreeBSD version. I also do not know if the question has been asked because there are differences or if the question is raised by default.

From my experience you should have a good chance to be able to proceed using a FreeBSD medium.
Sorry I forgot to ask if I do an updrade can it be safely downgraded back to its original state ?

My two pools bpool and rpool were created from a live session and resulted in debian 11 with zfs on root so my root fs is zfs and not the usual ext4.
 
Yeah. It really depends on what your ultimate goal for this pool is. If its going to be permanently attached to a FreeBSD system, then upgrade. If you require it to be interchanged between Linux, FreeBSD and maybe something else, then don't upgrade. Or at least be very, very careful doing so. Although we all use OpenZFS, certain features are only available on certain systems.

And if you just want to use the FreeBSD boot image to access the pool in order to salvage some files, then don't upgrade, don't even mount it read-write.
 
The command zpool upgrade will list the zpools that are "behind" the running OS.
As others point out, doing an upgrade on a zpool means you will not be able to use it on an older version.

Example:
zpool A created from FreeBSD-12
booted into FreeBSD-13, A "can be upgraded"
If on FreeBSD 13 you zpool upgrade A then you will probably have issues booting on FreeBSD12.

A "rule of thumb" is create the zpool on the least common denominator, and do not upgrade on higher versions.
 
My goal is to boot into debian 11 with root on zfs from my unbootable bpool and rpool mirrors and use apt-clone to create an install of all my apps on a fresh debian 12.1 ext4 partition.

So far I have been able to rsync my home directory to an ext4 ssd.

But what I cannot figure out is how to boot into the root pool to run apt-clone.

From there use apt-clone to to install all my aps from root on a new debian 12 ext4 root with all my installed aps and data.
 
The command zpool upgrade will list the zpools that are "behind" the running OS.
As others point out, doing an upgrade on a zpool means you will not be able to use it on an older version.

Example:
zpool A created from FreeBSD-12
booted into FreeBSD-13, A "can be upgraded"
If on FreeBSD 13 you zpool upgrade A then you will probably have issues booting on FreeBSD12.

A "rule of thumb" is create the zpool on the least common denominator, and do not upgrade on higher versions.
Thank you.
What if I choose a version of freeBSD that matches the version of zfs that is already there so an upgrade is not a problem.

Will I then be able to mount rpool at / and boot from it ?
 
What I still do not understand is that both bpool and rpool have no errors and yet they fail to boot.
Just in case it helps the boot process fails with zfs modules not loaded but when I try /sbin/modprobe zfs it fails and says do it as root but when I try and login as root none of my passwords are accepted.
 
Make a new temporary directory to mount your pool under from the rescue shell.
Code:
/bin/mkdir /mnt/<pool-name>

Mount tmpfs to that mountpoint.
Code:
/sbin/mount -t tmpfs tmpfs /mnt/<pool-name>

If the partition is encrypted, decrypt it now.
Code:
/sbin/geli attach /dev/gpt/<partition-label>
<enter geli passphrase>

Import that pool to the alternative root directory we created above.
Code:
/sbin/zpool import -R /mnt/<pool-name> <pool-name>

Mount the default dataset so the whole filesystem can be accessed.
Code:
/sbin/zfs mount -o mountpoint=/mnt/<pool-name> <pool-name>/ROOT/default

/mnt/<pool-name> should now look be accessible from the rescue shell.
 
Make a new temporary directory to mount your pool under from the rescue shell.
Code:
/bin/mkdir /mnt/<pool-name>

Mount tmpfs to that mountpoint.
Code:
/sbin/mount -t tmpfs tmpfs /mnt/<pool-name>

If the partition is encrypted, decrypt it now.
Code:
/sbin/geli attach /dev/gpt/<partition-label>
<enter geli passphrase>

Import that pool to the alternative root directory we created above.
Code:
/sbin/zpool import -R /mnt/<pool-name> <pool-name>

Mount the default dataset so the whole filesystem can be accessed.
Code:
/sbin/zfs mount -o mountpoint=/mnt/<pool-name> <pool-name>/ROOT/default

/mnt/<pool-name> should now look be accessible from the rescue shell.
From there I can presumably rsync my debian root / ?
 
My goal is to boot into debian 11 with root on zfs from my unbootable bpool and rpool mirrors and use apt-clone to create an install of all my apps on a fresh debian 12.1 ext4 partition.
Then seek advice on a Debian forum. We're not here to support Linux.

If you wanted to dual boot or use FreeBSD to recover some files, i.e. make a backup of them, we can help with that. But we can't help you restore a Debian system.
 
What are the symptoms or error messages of the failed boot?

How did you get ZFS into Debian, it isn't standard and I don't know who manages a boot-from-zfs capability.
 
My goal is to boot into debian 11 with root on zfs from my unbootable bpool and rpool mirrors and use apt-clone to create an install of all my apps on a fresh debian 12.1 ext4 partition.

So far I have been able to rsync my home directory to an ext4 ssd.

But what I cannot figure out is how to boot into the root pool to run apt-clone.

From there use apt-clone to to install all my aps from root on a new debian 12 ext4 root with all my installed aps and data.
From that perspective the simpler path should be to backup /etc and so on similar to your home directory, do a fresh install of Debian with its default EXT4 file system, restore some configuration and install the desired software.

Going the step from Debian 11 to Debian 12.X should require an upgrade of the software as well - if I am not totally wrong. Therefore I see almost no benefit from re-creating the Debian 11 ZFS setup since the goal is root on EXT4.
 
Why not get two USB sticks, one for the install image and another to install FreeBSD on? Make sure to disconnect any other disks because mistakes are easily made during the installer, it's not very forgiving, it could end up destroying something you didn't want to destroy. Once you have FreeBSD installed on the stick, play around with it. You can probably import the existing zpool, you could even mount its /home on FreeBSD's /home. If you keep the UIDs the same you should be fine. Then try FreeBSD booted from that stick for a while. You may end up liking it and decide to 'upgrade' your Debian 11 to FreeBSD 14 ?
 
Regarding the UIDs I like to add a remark. One of FreeBSD or Debian starts providing UIDs from 1000, one from 1001 when assigned by the tools. Therefore it is safe to use an UID of at least 1001 for the common users. It is possible to change that later, but then it is a hassle to adapt the change of the UID to all files and directories of the user.
 
Back
Top