ZFS How to create a graphical menu,like the grub one,where one can choose which zfs snapshot choose to boot FreeBSD.

good advice.

Code:
root@marietto:/mnt/zroot/.zfs/snapshot/2022-12-27-16:07:33-0 # zfs list -o space -r zroot

NAME                                                                AVAIL   USED  USEDSNAP  USEDDS  USEDREFRESERV  USEDCHILD

zroot                                                               20.5M   446G        0B     96K             0B       446G
zroot/ROOT                                                          20.5M   419G        0B     96K             0B       419G
zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731                        20.5M   419G      280G    139G             0B         0B
zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731@2022-12-27-16:07:33-0      -  16.7G         -       -              -          -
zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731@2023-01-12-23:57:31-0      -  77.3G         -       -              -          -
zroot/tmp                                                           20.5M  32.2M        0B   32.2M             0B         0B
zroot/usr                                                           20.5M  23.7G        0B    120K             0B      23.7G
zroot/usr/home                                                      20.5M  14.4G        0B   14.4G             0B         0B
zroot/usr/ports                                                     20.5M  9.29G        0B   9.29G             0B         0B
zroot/usr/src                                                       20.5M    96K        0B     96K             0B         0B
zroot/var                                                           20.5M  2.46G        0B    136K             0B      2.46G
zroot/var/audit                                                     20.5M    96K        0B     96K             0B         0B
zroot/var/crash                                                     20.5M  1.11G        0B   1.11G             0B         0B
zroot/var/log                                                       20.5M  4.16M        0B   4.16M             0B         0B
zroot/var/mail                                                      20.5M  1.33G        0B   1.33G             0B         0B
zroot/var/tmp                                                       20.5M  18.1M        0B   18.1M             0B         0B

now I know that zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731 takes all the space. Now I would like to go more deeply,to understand what can I remove inside of it and how can I remove the unuseful data without moving the informations else where.
 
Code:
root@marietto:/mnt/zroot/.zfs/snapshot/2022-12-27-16:07:33-0 # zfs get copies zroot

NAME   PROPERTY  VALUE   SOURCE
zroot  copies    1       default
 
I've removed the two snapshots. Now this is the situation :

Code:
root@marietto:/mnt/zroot/.zfs/snapshot/2022-12-27-16:07:33-0 # zfs list

NAME                                           USED  AVAIL     REFER  MOUNTPOINT
zroot                                          166G   280G       96K  /mnt/zroot/zroot
zroot/ROOT                                     139G   280G       96K  none
zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731   139G   280G      139G  /mnt/zroot
zroot/tmp                                     32.2M   280G     32.2M  /mnt/zroot/tmp
zroot/usr                                     23.7G   280G      120K  /mnt/zroot/usr
zroot/usr/home                                14.4G   280G     14.4G  /mnt/zroot/usr/home
zroot/usr/ports                               9.29G   280G     9.29G  /mnt/zroot/usr/ports
zroot/usr/src                                   96K   280G       96K  /mnt/zroot/usr/src
zroot/var                                     2.46G   280G      136K  /mnt/zroot/var
zroot/var/audit                                 96K   280G       96K  /mnt/zroot/var/audit
zroot/var/crash                               1.11G   280G     1.11G  /mnt/zroot/var/crash
zroot/var/log                                 4.16M   280G     4.16M  /mnt/zroot/var/log
zroot/var/mail                                1.33G   280G     1.33G  /mnt/zroot/var/mail
zroot/var/tmp                                 18.1M   280G     18.1M  /mnt/zroot/var/tmp
zroot2                                         700G   199G      700G  /mnt/zroot2/zroot2
zroot2/ROOT                                    280K   199G       96K  none
zroot2/ROOT/default                            184K   199G      184K  /mnt/zroot2
zroot2/tmp                                      96K   199G       96K  /mnt/zroot2/tmp
zroot2/usr                                     384K   199G       96K  /mnt/zroot2/usr
zroot2/usr/home                                 96K   199G       96K  /mnt/zroot2/usr/home
zroot2/usr/ports                                96K   199G       96K  /mnt/zroot2/usr/ports
zroot2/usr/src                                  96K   199G       96K  /mnt/zroot2/usr/src
zroot2/var                                     576K   199G       96K  /mnt/zroot2/var
zroot2/var/audit                                96K   199G       96K  /mnt/zroot2/var/audit
zroot2/var/crash                                96K   199G       96K  /mnt/zroot2/var/crash
zroot2/var/log                                  96K   199G       96K  /mnt/zroot2/var/log
zroot2/var/mail                                 96K   199G       96K  /mnt/zroot2/var/mail
zroot2/var/tmp                                  96K   199G       96K  /mnt/zroot2/var/tmp

I would like that zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731 will boot automatically without adding :

Code:
currdev="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"
vfs.root.mountfrom="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"

on the /boot/loader.conf of the UFS disk.
 
I would like also to disable the automatic generation of the snapshots when I give the command "freebsd-update fetch". I want to make the snapshots only manually,when I want to do it.
 
Thanks. I would like also that zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731 will boot automatically without adding :

Code:
currdev="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"
vfs.root.mountfrom="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"

to the /boot/loader.conf file which belongs to the UFS disk. Yes,because the ZFS disk can't boot directly. To boot it I should use the UFS disk,adding those lines on the /boot/loader.conf file.
 
You know,I'm learning by doing. It's normal to encounter unexpected behavior when you try to fix a problem without a deep understanding of the implications. The zfs bootloader does not work. I don't know why. Is there a way to reinstall it manually ?
 
I can't give a "bectl list". I'm on the UFS disk

I'm confused as to what your system has.
Is your "boot device"/system disk USF and you have a data disk that is ZFS?

I have more FreeBSD installations. One of them is on the ZFS disk,the second on a UFS system. Now I'm using the UFS disk and I'm trying to remove the unuseful data located on the ZFS disk.

This sounds like a frankensetup. How did you do this? The zfs boot loader should take care of this.

It's hard to follow this thread because there are multiple questions for different situations, at the end everybody's confused.
ziomario you should keep it simple with only one question per thread for a better understanding, it's way cleaner and less confusing for the readers and eventually helpers.
 
No. it is not confusing. I have more FreeBSD installations. One of them is on the ZFS disk,the second on a UFS disk. I can boot the first or the second FreeBSD installation to fix my problem. The problem is how to boot directly FreeBSD installed on the ZFS disk,because actually when I choose to boot from this disk from the BIOS,it is skipped. The disk that makes the boot is the disk that's below the ZFS disk on the boot list. Despite this,I can boot anyway FreeBSD from the ZFS disk. How ? using FreeBSD installed on the UFS disk,because I have added these lines in the /boot/loader.conf :

currdev="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"
vfs.root.mountfrom="zfs:zroot/ROOT/13.1-RELEASE-p5_2023-01-12_235731"


I'm sure that you understand that's not the better solution because If i want to boot the UFS disk I should comment those lines. I would like to reinstall / fix the bootloader of FreeBSD installed on the ZFS disk,because for some reason,it does not work.
 
less confusing for the readers
No. it is not confusing
Dear Mario, this is how i look when reading your posts.
get-smart-huh.gif

There is a chance that gotnull got it right.
 
No. it is not confusing

I am sorry to repeat myself but there is too much questions (only 2 pages):
_ How to create a graphical menu
_ How to identify the right snapshot and delete it
_ How to disable the automatic generation of the snapshots
_ How to boot a specific snapshot

Note that I do not say that what you are asking is not interesting, but they don't need to be in one giant thread.
It looks like every response leads to another question, mixing subjects all together won't help the readers.
I won't argue more than that, it's just an advice if you want people to help you, it's your own thread do what you want with it :)
 
An operating system to fix your operating system. Sounds like a plan.

Maybe you could install a third operating system for the menu system.
misc/pdmenu

It is a plan because it works. It's not perfect,but it will works until I will be able to fix it. 😝
You can call that attitude "the art of getting by".
 
I am sorry to repeat myself but there is too much questions (only 2 pages):
_ How to create a graphical menu
_ How to identify the right snapshot and delete it
_ How to disable the automatic generation of the snapshots
_ How to boot a specific snapshot

Note that I do not say that what you are asking is not interesting, but they don't need to be in one giant thread.
It looks like every response leads to another question, mixing subjects all together won't help the readers.
I won't argue more than that, it's just an advice if you want people to help you, it's your own thread do what you want with it :)

so,what you suggest to me to do with this post,since it got too confusing ? should I mark it as resolved,even if it is not ? or should I keep it open without replying anymore ? I do what you think it's the best option.
 
Well hopefully at this point you realize that selecting a disk to boot from happens before an operating system loads.
Thusly your titles question can not be achieved.
A graphical menu pre-boot is not possible with FreeBSD. Loader screen is all you have to use in FreeBSD.
 
I will give you credit. Your questions make my make brain churn and other ideas pop out.

A highly minimized FreeBSD for bhyve hypervisor. Similar to Alpine.
I reduced FreeBSD down to 125MB for Wireless Access Point with NanoBSD.
I wonder what I could do with a minimized bhyve server running off DOM. Mirrored NVMe for VM's.
A hypervisor shouldn't ordinarily need disk writes. Only VM's.

A FreeBSD hypervisor on 128MB SPI flash. That would be dreamy.
 
---> Well hopefully at this point you realize that selecting a disk to boot from happens before an operating system loads.

I know this since I was a little boy

---> A highly minimized FreeBSD for bhyve hypervisor. Similar to Alpine.
I reduced FreeBSD down to 125MB for Wireless Access Point with NanoBSD.
I wonder what I could do with a minimized bhyve server running off DOM. Mirrored NVMe for VM's.
A hypervisor shouldn't ordinarily need disk writes. Only VM's.
A FreeBSD hypervisor on 128MB SPI flash. That would be dreamy.

My idea was to use the linuxulator to run this : https://docs.zfsbootmenu.org/en/latest/

but thinking to it deeply,I think that it's not useful at all. FreeBSD has its own zfs boot menu. What it could need is to gain some elegance in the graphic style. So,it does not need all the code behind the zfsbootmenu because it is for Linux. But maybe only some minor code from it,the code related to the graphic style.
 
How often do you reboot your server to be that concerned about a pretty graphic for a split second? Have you ever considered that maybe you’re not cut out for this? Because every time I read your posts I think that Windows perfectly matches your use case.
 
The user who wants a nice graphic does not mean automatically that he/she is tailored for Windows. I like to please my eyes. That's all. It seems to me that you have produced a rudimentary thought. And I'm sure you have read only a little number of my threads.
 
Mario, that's not nice. He's trying to help. But thanks for the good laugh.

View attachment 15433

I have modified my comment before your reply because I didn't want to be so rude. Reload the page and you will see. Anyway,it does not seem to me that he is trying to help. He is speculating and almost offending. I can't be tailored for Windows only because I like to please my eyes. The association of ideas that he made is very fragile and tending to offend..
 
That's right. That's because I want to try with my own abilities and resources before to "surrend" to the current best practices. Otherwise there is no fun for me if I didn't put my own and I could not reinvent the wheel :D
 
Back
Top