Tag Archives: fix

Update FreeBSD to 14.0, Update zpool, and can’t boot…how to fix?

As FreeBSD 13.2 is EOF and FreeBSD 14.0 is released, so I think it’s time to update my server to FreeBSD 14.

So I updated the server as what I did before.

freebsd-update -r 14.0-RELEASE upgrade
freebsd-update install
shutdown -r now
freebsd-update install

And when I also noticed that FreeBSD 14 updated zpool verson and introduce some new features, so I also updated zpool as well.

zpool upgrade zroot

And also updated bootcode on all disks, this is very important.

gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da0
...
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 da7

And the final step is to reboot the server to finish upgrade.

Then, server can’t boot. I got below error.

And gpart can find all disks and partition.

What’s happening? I updated bootcode why I still get this error?

And then I did some research, and found that in FreeBSD 14 release note, it’s mentioned

There have been a number of improvements in the boot loaders, and upgrading the boot loader on the boot partition is recommended in most cases, in particular if the system boots via EFI. If the root is on a ZFS file system, updating the boot loader is mandatory if the pool is to be upgraded, and the boot loader update must be done first. Note that ZFS pool upgrades are not recommended for root file systems in most cases, but updating the boot loader can avoid making the system unbootable if the pool is upgraded in the future. The bootstrap update procedure depends on the boot method (EFI or BIOS), and also on the disk partitioning scheme. The next several sections address each in turn.

Well, this is something new in FreeBSD 14, and I didn’t update EFI boot file and that’s why I’m facing this issue.

So, spend some time to fix the boot issue.

First, I tried to change bios from BIOS to UEFI, to see if I can boot the server via BIOS. But unfortunately, it’s not working, and got below error.

So, the only choice is to boot the server with liveCD and fix it.

Select 1, boot installer here. Do not select 2 single mode as single mode is readonly.

Select liveCD

Type root to login, no password is needed.

And then you can mount your zpool via below command (Actually this is not needed if you only need to fix the boot issue)

zpool import -f -R /tmp/zroot zroot

Keep in mind here the only writable folder is /tmp, so you must mount your zpool here.

Determined the location of the boot loader via below command:

efibootmgr -v.

The one with + is the one in use, in below screen shot as I boot from virtual CD so it’s marked as USB.

The one on local disk is mfisyspd0p1

Mount the ESP partition via below command:

mount_msdosfs /dev/mfisyspd0p1 /boot/efi

And then run below files to copy the EFI boot loaders from CD to local disk.


cp /boot/loader.efi /mnt/efi/freebsd/loader.efi
cp /boot/loader.efi /mnt/efi/boot/bootx86.efi

Then reboot,

Then I got an error complaint UEFI is broken.

Then tried to boot into livecd and copy the files again, then reboot.

This time no error, just complaint not able to boot.

So what’s happening?

I remember when I copied the EFI loader, there are some errors from the HBA card.

Then I checked the sha256 of the loader.efi on CD and on local disk, looks like the loader on local disk is corrupted.

This is a known issue for several years. The default drive in FreeBSD is not working properly with mfi driver (I’m using dell h330). So the fix is

Option 1, when you use livecd to boot, select 3 and enter below command to load the right mrsas driver:

set hw.mfi.mrsas_enable="1"

boot

 

Option 2, keeps copy the file to hard disk, and then use command sync to force OS to write data to disk.  And then check the sha256 of the file. Due to the default driver is not stable, I tried about 10 times, finally got the loader.efi copied to the right position.

Then reboot. This time server can boot successfully, but it booted into single mode.

That’s because we replace the file via livecd, so just run fsck to fix it

fsck /dev/da0p1

Then reboot, all good now.

 

fix “[Error28] No space left on device” when upgrade ESXi to 6.7 U2

To upgrade ESXi to 6.7U2, usually use below command is enough:

esxcli software profile update -p ESXi-6.7.0-20190402001-standard -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml

But this time I got error “[Error28] No space left on device”.

Someone said to enable the swap on SSD can fix the issue, but I tried, it doesn’t work.

The fix is to manually update a vib first

[root@host:~] cd /tmp
[root@host:/tmp] wget http://hostupdate.vmware.com/software/VUM/PRODUCTION/main/esx/vmw/vib20/tools-light/VMware_locker_tools-light_10.3.5.10430147-12986307.vib
[root@host:/tmp] esxcli software vib install -f -v /tmp/VMware_locker_tools-light_10.3.5.10430147-12986307.vib
Installation Result
   Message: Operation finished successfully.
   Reboot Required: false
   VIBs Installed: VMware_locker_tools-light_10.3.5.10430147-12986307
   VIBs Removed: VMware_locker_tools-light_10.3.2.9925305-10176879
   VIBs Skipped:

Then run the update again, you should be able to update your ESXi host now.

fix new iphone can’t sync with outlook.com issue

It seems Microsoft is encourage people to use the app outlook. The app is good, but I still need to sync the contact between my iphone and outlook to get my contacts number.
Spent some time to check this issue, here is the fix:


    Login to outlook.live.com
    In the browser, click on Settings icon (gear at top right) ; scroll down the Quick Settings panel and click on 'View all Outlook settings'
    In the pop-up window, select 'General'; 'Mobile Devices'
    Select the iPhone, note if you have more than one iPhone (e.g. an older device), select the 'Edit' icon (pencil) to check the details including the version, 'OK' to exit details
    Click on the 'Delete' icon (bin) to remove the device
    Power off the iPhone
    Power on the iPhone - device should attempt to re-register with Microsoft
    Open the iPhone Mail app and look for email with subject: "ACTION REQUIRED TO SYNC EMAIL" (note, this email won't appear in the online version of Outlook, only in the iPhone Mail app)
    Scroll down the message and click on: "Continue using this email app".

Do not rename the only domain controller… And how to fix it if you have already done so..

Even though MS provide the document about how to rename domain controller, the thing is, if you only have one domain controller, the “rename” will break the AD service and you are not able to roll back.

The issue you will get is that after you rename domain controller, the AD DS services are still using the old hostname because you didn’t transfer the FSMO roles from the old name to the new name. And if you want to start any domain management tools you’ll get error said that domain is unavailable. And if you want to change domain controller name back you will get the same error because dc is not available and your renaming will failed too. And this issue won’t happen if your domain get two or more domain controllers.

Ok, how to fix this issue if you have already done so? What we can do now is to update registry and change the computer name back to the old one. Below are the four registry keys you need to update:

HKLM\System\CCS\Control\Computername "Computername"
HKLM\System\CCS\Control\Computername "ActiveComputername"
HKLM\System\CCS\Services\Tcpip\Parameters "Hostname"
HKLM\System\CCS\Services\Tcpip\Parameters "NVHostname"