01:51:58 Trying to make FreeBSD 14.1 always boot from this new BE. After `bectl activate from-nagios02` and a restart, `bectl list` indicates the next boot will be from `default`. What's up with that? Is UEFI different in this regard? First time booting from that. 12:18:24 Hi, I was wondering if anyone could shed some insight on what I'm seeing. I have a VNET jail with v4 and v6 IPs. After starting the jail, v6 is not reachable. From the jail, I can also not ping6 out. 12:18:32 Once I disable pf in the jail, I can ping6 out. 12:18:48 Once that is done, and I enable pf again... I can ping6 out. And I'm reachable over v6. 12:19:43 Did I screw up my pf to interfere with ARP resolution or something? 12:23:14 Hm, doesn't appear that pf can even do that. 12:39:02 Okay, it's actually different. The ICMP is irrelevant. 12:40:47 It seems I was wrong. `bectl activate from-nagios02` does not change the next BE. It's still set to `default`. However, on reboot, we're in the `from-nagios02` BE. Interesting. 12:54:23 according to the man page that should only be the case if you use the -t flag 13:16:28 ... aha, I guess it's because of how the ipv6 subnet is being routed. Bugger. 14:10:02 v6 has prefixes, not subnets. 14:30:51 dvl, have a look at the -t flag. it controls whether it is only for the next reboot or permanently 14:31:17 nimaje: I agree 14:31:53 ah, that was already mentioned, sorry. 14:32:31 jbo: I've not been using -t, so it should be permanent. I suspect this is related to my boot drive being UEFI: https://dpaste.org/89ggV 14:33:59 why would that matter? the BE is on the same drive/volume/zvol, just a different dataset that the bootloader picks up, no? 14:37:00 dvl zpool list and zpool get bootfs 14:39:27 tsoome: Good idea: https://dpaste.org/iXKot 14:40:08 jbo: There are issues with setting `activate -t` on a UEFI boot drive, from what I read earlier. I'll see if I can find that. 14:41:14 interesting 14:41:41 I would imagine that +95% of everybody is having an UEFI boot drive these days. 14:42:11 well, activate -t by itself is temporary setting and should get reset back [to bootfs value] on boot. 14:42:42 if the UEFI boot is affected or not really depends on what you have for boot loader on your ESP 14:43:17 that is, if it is freebsd loader.efi, or something else. 14:44:42 now, if you got bootfs set to new value, you should reboot and see if it is used; that is, esc to loader ok prompt, and check with commands: show currdev and lsdev -v 14:45:08 and then enter boot to boot your system and verify the rootfs. 14:45:21 verify, what is your rootfs:) 14:46:10 and yes, thats assuming you are using freebsd loader.efi 14:47:04 I've given up searching for that post. 14:47:52 if there is problem with -t, please file the bug and you can drop me note;) 14:49:56 tsoome: This new snippet has the output of those commands. 14:51:47 the https://dpaste.org/iXKot ? 14:58:11 tsoome: Sorry, bad paste, here it is: https://dpaste.org/2T4a5 14:59:26 tsoome: This is a Microsoft Azure VM created with the FreeBSD Foundation 14.1 x64 gen 2 14:59:33 *image 15:00:07 ok, so, boot loader did pick up the bootfs setup (the value in currdev and value from lsdev -v match) 15:00:39 now, if you start the OS, does it use the correct BE? 15:06:14 tsoome: Yes, it does. 15:06:35 tsoome: It still lists `default` as N 15:07:01 So it seems to be doing the right thing, but not reporting what it will do on next boot 15:08:00 what does df -h / report ? 15:08:04 Or, put another way, it's reporting that it will boot `default` next, but it boots `from-nagios02` (which is my goal). 15:08:31 tsoome: 30% capacity (is that what you wanted?) 15:08:37 no, the device name 15:08:52 zroot/ROOT/default 21G 6.3G 15G 30% / 15:09:22 so, something did reset it to use zroot/ROOT/default 15:10:04 tsoome: remember that after `bectl activate from-nagios02`, `bectl list` still reports `default` as N 15:10:37 yes, because activate only does set bootfs, it does not remount your rootfs 15:10:50 bootfs property, that is. 15:11:53 and we know that bootfs is set to zroot/ROOT/from-nagios02 15:12:36 so, you have rootfs from default (the N means active now), and as your bootfs is changed, it has 'R' in bectl 15:13:00 do you have default in /etc/fstab by chance? 15:13:05 tsoome: There's my error, I was thinking N was next. 15:13:24 There is one difference about this filesystem: zroot/ROOT/from-nagios02 did not originate on this host (via bectl create) - it was copied over from another host. 15:13:28 [dvl@nagios03:~] $ cat /etc/fstab 15:13:28 # Custom /etc/fstab for FreeBSD VM images 15:13:28 /dev/gpt/efiesp /boot/efi msdosfs rw 2 2 15:14:05 the origin does not really matter. the contents does (in sense that it should have usable OS image in it) 15:14:20 good. 15:14:58 um, you can mount your from-nagios02 with bectl mount and check the etc/vfstab from it. 15:16:44 because, if loader did pass the currdev to kernel, then starting system is reading etc/fstab from it and if fstab redirects / to zroot/ROOT/default, it will mount it... 15:17:42 tsoome: https://dpaste.org/vLPWj 15:18:39 Note, I showed etc/fstab figuring vfstab was a typo and there is no such file anyway 15:21:37 ok, so apparently fstab is not to blame. 15:22:51 can you see full console history - the kernel should tell about the fact that it is mounting rootfs and what name is used there? 15:25:39 of course, it may be possible that your boot setup does pass zroot/ROOT/default to kernel -- can you do something like grep -r default /mnt/from-nagios/boot ? 15:27:56 basically, since active boot loader is using correct BE, you can end up in wrong BE because bootloader itself is passing zroot/ROOT/default to kernel, or kernel does start with correct BE, but is instructed to use zroot/ROOT/default at some point during OS startup. 15:30:11 checking the console screen. I'd love to copy/paste, but that does not seem possible. 15:30:29 I see : Trying to mount root from zfs:zroot/ROOT/default []... 15:31:19 hm, and no mentioning of zfs before that line? 15:31:58 no other mention, and I found I can search the console, just not copy from it. 15:32:51 ok, does grep in that boot directory find anything? 15:33:11 which fbsd version is it? 15:34:23 Oh, there is ZFS filesystem version: 5 and ZFS ... above t 15:34:32 This is FreeBSD 14.1 - the grep; https://dpaste.org/of0HT 15:35:12 ZFS storage pool version: features support (5000) <-- found out how I can paste. 15:36:11 the console scrollback: https://dpaste.org/j5UUs 15:38:55 you have 2 disks there, da0 and da1 15:39:27 yes, da1 has no boot partitions. 15:39:47 yea, and it has ufs 15:41:15 It has a most interesting file: /mnt/resource/DATALOSS_WARNING_README.tx 15:43:37 and after boot, zpool get bootfs zroot does list nagios? 15:45:07 the weird fact is that your 'default' dataset was created 1970-01-01 00:00, but that is not affecting boot;) 15:45:21 [dvl@nagios03:~] $ zpool get bootfs zroot 15:45:21 NAME PROPERTY VALUE SOURCE 15:45:21 zroot bootfs zroot/ROOT/from-nagios02 local 15:46:12 tsoome: Idea: I can create another VM, from the same template and see if it has the same problem with BE. 15:46:37 zfs list would also be nice 15:47:04 ^ https://dpaste.org/nr4ue 15:49:24 ok does your kenv | grep vfs report anything? 15:51:44 [dvl@nagios03:~] $ kenv | grep vfs 15:51:44 vfs.root.mountfrom="zfs:zroot/ROOT/default" 15:51:44 vfs.zfs.arc_max="128M" 15:51:44 vfs.zfs.vdev.cache.size="5M" 15:52:10 well, thats why your rootfs is zfs:zroot/ROOT/default 15:52:36 I agree, but I don't know how that is being set. 15:53:38 /mnt/from-nagios/boot/loader.conf.local:vfs.root.mountfrom="zfs:zroot/ROOT/default" 15:54:08 loader.conf.local file. sorry, missed it while looking grep output:) 15:54:24 hello 15:54:28 you can just remove that line. 15:54:40 That seems to be an image-supplied file 15:55:20 ok, commented out, let's reboot. 15:55:51 of course, I may get wild results now... 15:56:06 yea, whoever put it there, did not consider BE's ;) 15:56:47 if the OS startup fails, you can just set currdev=zfs:zroot/ROOT/default: and then enter boot. 15:56:54 Well, it rebooted, but I can't ssh in. ;) 15:57:18 Now we have: from-nagios02 NR / 6.44G 2024-07-04 22:34 15:57:32 Greetings. Can I adjust the volume level of the running apps? On OpenBSD it is doable by sndioctl(1), but seems I cannot do it with mixer(1). 15:57:35 So, success, but not running the BE I want. seems I set everything up in default. 15:57:36 Any help? 15:57:43 now it is working as intended;) 15:57:49 tsoome: Agreed. 15:58:13 I was never testing with the right BE 15:58:30 However, I configured the wrong BE with the right stuff. 15:59:13 pr-asadi: Sorry, I don't use sound. forums.freebsd.org is where I'd look next. 16:00:40 tsoome: Next goal, file a bug against that template. 16:00:46 dvl, do you store texts on dpaste via some script of yours? 16:01:00 ant-x: No, I copy/paste. 16:01:21 ant-x: Did you think, wow, he's so fast, must be a script? ;) 16:01:33 dvl: Thank you. 16:01:59 dvl, I thought wow, he is tech-savvy, must have everything automated :-) 16:02:10 ant-x: ;) 16:06:01 tsoome: Thank you. Very patient and helpful of you. 16:59:59 2 services of mine were off, "killed", is there some log I can check to see what happened? 17:00:03 maybe OOM etc? 17:25:19 yourfate, Anything listed in /var/log/messages about it? 17:26:37 dvl yw:) 17:27:53 rwp: ye, that's it, found it 17:28:05 `Jul 5 12:50:58 cabal kernel: pid 85109 (Thread Pool Wor), jid 0, uid 1003, was killed: failed to reclaim memory` 17:28:19 after `Jul 5 12:50:53 cabal kernel: swap_pager: out of swap space` 17:30:30 Let me go on record as saying that I do not like memory overcommit when it comes to production servers. It's a problem there. 17:30:50 I need to learn more about the FreeBSD memory model. I know it very well on the Linux kernel. But not for FreeBSD. 17:31:32 One problem is that programs no longer know they are out of memory and can't deal with it themselves. 17:31:53 I think something is leaking memory, I never had problems on that machine before 17:32:02 In the old days Apache might be driven into an out of memory condition and it would log this and it would behave accordingly. 17:32:05 but I'm running a shoddily made gameserver in linux compat 17:32:09 that might be the culprit 17:32:15 it got killed, and took weechat with it 17:32:47 But with memory overcommit and the OOM Killer any program is fair game for being killed and it can't log this itself. It just stops running. And it can't clean up any temporary files so it leaves lint behind. 17:33:16 the machine has 16gb of ram, 2gb of swap 17:33:59 To deal with this I am a big user of "monit" which can monitor things like web servers and such and if they need it then with rules it can automatically restart it. 17:35:04 16GB of RAM and 2GB of swap feels very typical for a normal machine anyone might set up right now. (Though I am old-school and I would set up more swap because I can.) 17:35:30 But as to whether it is enough for any particular computing task that depends upon the computing task. It all depends. 17:35:34 I might too, IDK how this swap got set up 17:35:42 I also don't know where it is 17:35:47 That feels like the bsdinstaller default amount. 17:36:08 Try: swapinfo 17:36:20 oh its partition 17:36:25 that's unfortunate 17:36:31 kinda messy to resize 17:36:38 /dev/da0p2 17:36:55 oh I can just install lsblk 17:36:57 Because zfs uses dynamic memory itself there is a deadlock potential for using swap from a zfs dataset. 17:37:07 Try: geom -t 17:37:08 hm right 17:37:33 ye, it sbetween boot and the ZFS pool, damn 17:37:41 So swap really needs to be on a different provider than a zfs dataset. That's just one of the limitations of the design of things. 17:38:16 resizing a zfs pool that has the roof fs in it seems daunting 17:38:38 let's be idiots about this: swap on SSHFS 17:39:05 In the old days we always wanted swap on the "inside" of the spinning disk which is the faster part of the disk. To make actually swapping blocks faster. But these days I just want swap available but not used so I want to put it at the "outside" of the spinning disk which is the slower part of the disk and keep the faster part to the file system. 17:39:40 ooooh interesting 17:39:59 tho I guess surely these days nobody has the roof FS of anything on spinning disks 17:40:28 I have resized zfs configurations and it's more work than anyone really wants to go through. I would just live with your current configuration. It's not a bad one. 17:40:39 yes, I will 17:40:48 doing nothing was my plan all along 17:41:31 As to whether it is spinning or solid state that depends upon the size you are dealing with. If small like a 1TB size then certainly go SSD. But if it is larger like 8x 8TB then spinning is the only cost effective way! 17:41:47 sure, but why would the root fs be that big? 17:41:51 I can see home being on those 17:42:35 But even though NAND Flash has advantages it also has disadvantages too. Stripe sizes are at least 4K and probably 8K and so block sizes should be bigger and such. Bad tuning can cause read/write-amplification problems. It's not without issue. 17:43:02 I don't actually know what kind of store that vps uses 17:43:04 afaik it is flash 17:43:12 uhm... with zfs all of the datasets are pooled. So there it is not allocated all to root or all to home. It is pooled and shared among all of it. That's a huge advantage of zfs. 17:43:42 wait, across drives? 17:43:53 Yes. Across drives. 17:43:59 wouldn't you put one pool onto the flash drive for the root fs 17:44:05 and another pool onto the spinning rust 17:44:09 and put home onto that pool? 17:44:10 But hold-up because I am nto sure we rae talking about the smae thing here. We might be out of sync. 17:44:47 You might organize data that way. Sure. 17:44:55 kk 17:45:33 But I would hazard to guess that most people have installed on just either one device or onto two devices mirrored and therefore have everything all in one zroot pool. 17:45:52 ye maybe 17:47:08 But sure a large shop like Netflix running FreeBSD is probably booting the root from a NAND Flash root and then having large data arrays on dual-port storage trays. 17:47:17 That's maybe more than I can afford for my house. :-) 17:47:31 well, my freeBSD setup is running on a hetzner VPS 17:47:38 with 160gb of flash storage included 17:47:52 What's the fs type? ZFS or UFS? 17:47:53 it does some network stuff for me, like IRC 17:47:56 zfs 17:48:05 and runs the occasional gameserver 17:48:27 So... All good! :-) 17:48:40 for storage I have a synology NAS. I'd prefer zfs, but I like the low/no maintenance life 17:48:50 and their apps are good nowadays 17:48:55 for personal cloud stuff 17:49:54 Synology is always ranked well in reviews. For me I am running FreeBSD with a raidz2 storage array of spinning disks. Times two so that I also have a backup. 17:50:21 And my desktop is a 2x 3TB disk mirror too. 17:51:26 On a single disk system even with backup it's just very annoying when a disk dies off. I raid everything that I possibly can these days. Then when a storage device dies nothing breaks as such and it is just a time to replace the failed disk/ssd. 17:57:25 the synology is mirrored 17:57:30 and backed up 17:57:43 to some cloud storage 17:58:27 I might buy a 2nd one soon-ish 17:59:06 rn I have it at my parents place, and here I have an rpi with an external drive, running freeBSD, as a local media nas 18:01:11 nice! 18:03:16 but I want a 2nd one so they can back up to each other etc 18:04:58 I was operating mine without a backup and last year had a power connector problem that took me a while to figure out. Screwed up my disks! But zfs pulled me through it in the end. Fixed the power connector problem and recovered 100%. But that motivated me to set up a 2nd one so I would have backup. 18:05:30 the local rpi has no data on it that I care about, its just tv shows and movies to watch on the various devices 18:05:41 the nas is backed up to a hetzner storage box 18:05:57 It must be one of the newer pi's if it has the cpu power to do that for video. 18:06:01 right now using the synology proprietary backup solution, but I might switch it over to restic backup, which I use for everything else 18:06:12 +1 for restic 18:06:13 rwp: it only serves it as SMB shares 18:06:21 the media players are on devices that play from that 18:06:26 oh, okay, data moving only. gotcha 18:06:37 the players are mostly an apple TV and an ipad 18:06:49 they can play from SMB shares just fine using infuse player 18:07:23 it is an rpi4b with 4gb of ram 18:07:56 I can also access it remotely using wireguard vpn, then play the media from abroad 18:08:14 if the internet where I am is fast enough 18:08:34 Regarding your out-of-memory situation on your hetzner vps, 16GB RAM is a pretty large size VPS. I guess you just need to monitor the size of the gameserver and make decisions about it as you go. 18:08:48 * rwp must run off... TTFN 18:08:51 cya! 19:59:29 cracauer trying hard :D 21:09:16 jbo: never surrender :D 21:11:25 Question: On a booted and running FreeBSD system how can I determine if the system booted using UEFI versus Legacy BIOS? 21:13:16 On a Linux kernel system /sys/firmware/efi/ will exist containing UEFI stuff. Therefore I am guessing on FreeBSD there will be a sysctl that would indicate this. 21:21:27 rwp, how about sysctl -a | grep bootmethod 21:22:55 cracauer, :D 21:25:32 scoobybejesus, Aha! That looks very promising. It says "machdep.bootmethod: BIOS" correctly on a BIOS booting system. Thank you! I'll use it to inventory. 22:30:29 I am reading the handbook about connecting to a wireless network: . Whence comes the `wlan0' interface name? It is not listed in `ifconfig -a', nor mentioned in `man ifconfig'... 22:35:27 ant-x: when you do ifconfig -a what do you see? 22:40:58 voy4g3r2, What looks like two interfaces, both Ethernet. My wireless driver (visible via pciconf -lv) is not shown. 22:41:36 I think ifconfig -a shows one IPv4 and one IPv6 ehternet interfaces. 22:42:14 The Handbook introduces `wlan0' out of thin air. 22:48:27 My ifconfig -a shows re0 and lo0 . 22:50:58 Whoops and hooops! In `ifconfig wlan0 create...', wlan0 is probably the (arbitrary) name of the /new/ interface being crated. 22:57:20 Wrong: it is the name of the "cloner". A full list of cloners is available from `ifconfig -C'. 23:03:32 I had assumed that if the driver for a device was not available that the device would not be available either. No? 23:03:50 What wifi device is your device? 23:08:03 rwp, I have figured it out. The driver /is/ available and installed, according to pciconf. In order to connect an interface to that driver, I invoke `ifconfig wlan create wlandev '. I have succeeded now, all is well. I am now trying to congigure wpa_supplicant. 23:12:06 rwp, My original question was, what is 'wlan0' -- the first argument to ifconfig. It is the name of the interface, and must start with one of the available cloner names. A list of cloner names is printed by ifconfig -C . 23:30:26 My /etc/rc.d already contains a script called wpa_supplicant, which accepts the wireless interface name as its second argument ($2). How does the rc system determine and pass that specific argument to that script? 23:35:10 I need to get back to working on FreeBSD on a laptop. I have something installed from 13 days. But I never got it into a useful state. 23:35:28 But I do not remember needing to clone up a wlan0 device. I recall it appearing immediately after boot time. 23:35:55 No, you clone wlan, and name the result wlan0. I have just done it. 23:36:03 I believe you. 23:36:23 yeah regular config is often enough 23:36:27 for all that 23:36:29 But I do not remember needing to do it. 23:37:08 Now I am confused about wpa_supplicant. It is meant to be used as a daemon, and has an "nostart" entry in /etc/rc.d . What do I do with daemon marked nostart? 23:38:03 I look at "man rc.conf" and search for wpa and find interesting information there. 23:38:35 Probably I had set ifconfig_wlan0="DHCP WPA" for my laptop and that allowed the network script to create the device automatically. 23:39:00 rwp, I have done so, it is about supplying information for that service, but not about causing it to start at boot... 23:39:52 it's not supposed to be started as boot 23:40:17 rather when wlan0 as sta comes up 23:40:19 rwp, No, that is a futher configuration for an already created device. You create deviice via the wlans_ variable in rc.conf . 23:40:42 The other setting I know I had set was wlans_iwn0="wlan0" for my Centrino-N 6200 in my Thinkpad x201. 23:40:50 Yes. 23:41:01 so what's not working eh? 23:41:02 ant-x: 23:41:03 ketas, so I have to UP my wlan before expecing the wpa_supplicant to be running, right? 23:41:38 can't remember if it needed actual up 23:41:39 ketas, For now, wpa_cli can see no supplicant. I will UP my interface and test again. 23:41:58 but does it run? 23:42:04 it also logs stuff 23:43:53 ketas, ps -a will not show it due a sysclt security setting (haven't removed it). I can successfully scan the nearby wireless networks, so I guess my wireless interface /is/ up. 23:44:34 Yet, wpa_cli says: Could not connect to wpa_supplicant: (nil) - re-typing 23:44:49 ...and there is nothing new in dmesg. 23:44:54 what about ps x 23:45:34 ketas, that shows a lot more, but `| grep suppl' does not find anything. 23:45:44 ps wwaux is my favorite 23:45:57 so run it? 23:46:08 wlan0 is there right? 23:46:18 Could wpa_supplicant fail to start because I did not fill its config yet? 23:46:29 ketas, Yes, wlan0 is there and woking via ifconfig. 23:47:10 well, if you didn't 23:47:13 then 23:47:24 logs show that too :) 23:47:48 my machine has all.log configured so 23:48:13 ketas, I have not studied centralised logging yet. 23:48:27 new to fbsd? 23:48:39 Very new. 23:48:55 service wpa_supplicant start wlan0 23:49:21 Oh! That looks more like it. Waity-minty 23:49:28 maybe it went to messages too 23:49:39 tail -F /var/log/messages 23:49:47 or tail -40F /var/log/messages 23:49:49 my fab 23:49:52 fav 23:50:03 That makes sense, not it complains about a missing config. 23:50:13 (in the stderr) 23:50:55 :) 23:51:06 It started successfully with an empty config. Thank you. 23:51:43 manpage has minimal config 23:51:49 Shall I configure it staring upon some ACPI or another kind of event of activation of WLAN? 23:51:53 as well as handbook 23:52:29 it will start automatically if configured 23:52:59 ketas, Yes, I know. Perhaps I need something in that config, because wpa_cli still fails to connect to supplicant, althogh ps -x shows it running. 23:53:27 https://docs.freebsd.org/en/books/handbook/network/#wireless-authentication 23:53:31 did that? 23:54:41 unsure what wpa_cli needed 23:55:08 ketas, almost. I have not written down the parameters of my networks, because I thought wpa_cli or wpa_gui would take care of scanning them and prompting the user. The suppliant's example config has nothing but network-specific information. 23:55:11 ctrl_* or so 23:55:15 in conf 23:55:43 cntrl_* -- what is that about? 23:56:20 ketas, To explain -- I am preparing this laptop for a colleague, and have no idea what his local WiFi networks are... 23:56:23 those 23:56:26 ctrl_interface=/var/run/wpa_supplicant 23:56:26 ctrl_interface_group=wheel 23:56:32 in cfg 23:56:42 rc.conf? 23:56:58 no, wpa_supplicant.conf 23:57:28 iirc it's by default off 23:57:32 Is that for debugging? 23:57:50 Or for interaction with wpa_cli? 23:58:00 no it's for controlling from wpa_cli 23:58:45 Anyway, I already have this directory, and a file wlan0.pid inside it. No i/o file, though. Should there be one? 23:59:46 needs restart for that