Showing posts with label upgrade. Show all posts
Showing posts with label upgrade. Show all posts

Saturday, August 8, 2015

Forcing a Windows 10 upgrade in an iSCSI environment

If you boot Windows machines from iSCSI, you should know that the Windows 10 Upgrade doesn't load iSCSI drivers and dumps you into a recovery environment. However, there is a way to get around that.

Once the Windows 10 recovery environment (Windows PE) boots, use the Advanced Options to obtain a command line.

To start the iSCSI initiator:
wpeutil initializenetwork
net start msiscsi
iscsicli qaddtargetportal portal.ip.address.here
iscsicli listtargets
iscsicli qlogintarget iqn.xxx.xxx
iscsicli PersistentLoginTarget T * * * * * * * * * * * * * * * 0 (that was fifteen * characters)
iscsicli ListPersistentTargets
iscsicli ReportTargetMappings
Once this is ready, you can manually install Windows 10:
 c:\$Windows.~WS\Sources\Windows\sources\setuperror.exe
For reference, here are the hidden upgrade folders and their meanings:
"Windows.WS = Windows Server Folder"
"Windows.BT = Windows Backup Files"
"Windows.Old = Windows backup files"

Have fun!

Saturday, January 17, 2015

PC-BSD: FreeBSD 10.0 -> 10.1 upgrade using freebsd-update

I was having problems getting pc-sysupdate to work properly. For some reason, purging the pkg cache and forcing updates through pkg update -f resulted in package size mismatches, so I decided to try to upgrade my PC-BSD system manually. It took a while, but I think I figured out how to get it going.

First, I created a boot environment for my new upgrade:

beadm create fbsd_10.1_update
beadm mount fbsd_10.1_update /.updateStage


Next, I performed the freebsd-update on this new boot environment:

freebsd-update -b /.updateStage fetch
freebsd-update -b /.updateStage install


Eventually, the script finished its business. I then switched to the new environment:

beadm umount fbsd_10.1_update
beadm activate fbsd_10.1_update


All done, right? Here's what happened next. I rebooted the machine, and was dropped to a grub> prompt. What? beadm didn't handle grub gracefully?

Ugh. After digging, I figured out how to manhandle grub to boot my ZFS partition. The first trick, to save time, is to set an environment variable to the root filesystem. This saves a LOT of typing. Use "tab" completion to figure out what filesystems are available to you:

set P=(hd0,msdos2)/ROOT/fbsd_10.1_update/@/


Now, we can tell grub to load all the things (tab completion works with the $P expansion! brilliant!):

kfreebsd $P/boot/kernel/kernel
kfreebsd_loadenv $P/boot/device.hints
kfreebsd_module_elf $P/boot/kernel/opensolaris.ko
kfreebsd_module_elf $P/boot/kernel/zfs.ko
kfreebsd_module $P/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
set kFreeBSD.vfs.root.mountfrom=zfs:tank/ROOT/fbsd_10.1_update


boot


Voila! System working again. But I still need to repair GRUB... after the system boots into the correct boot environment:

grub-mkconfig -o /boot/grub/grub.cfg

Unfortunately, that last step didn't actually fix my grub installation. I'm puzzled as to how to fix it. But for now, at least I can get the machine running.

Friday, February 7, 2014

Tips when upgrading PC-BSD 9.2 to PC-BSD 10


Here are some tips for you, if you decide to do a live upgrade from PC-BSD 9.2 to PC-BSD 10:
  • After your machine reboots for the first time, run pkg install -f to update all packages in order to match packages to the base system libraries.
  • Make sure that /etc/loader.conf contains the entries that you need for your hardware. In my case, nvidia_load="YES" is important.
     
  • After the aforementioned modifications, run grub-mkconfig -o /boot/grub/grub.cfg due to a known bug when upgrading grub.
  • In my case, pc-updatemanager didn't install the base overlay correctly. I was missing several important libraries; these omissions prevented both ssh and sshd from running. To fix:
    • Back up your /etc/ directory (and everything else -- I used a zfs snapshot -r tank)
    • Download the base system overlay from your favorite mirror into a nice place like /var/tmp/
    • cd /; tar xfym /var/tmp/base.txz
    • Check for missing / broken libraries by using libchk (I uninstalled many packages that were discontinued / no longer applicable)

Monday, December 9, 2013

Creating USB disk images from .iso images in order to update firmware on old devices

I recently needed to update the firmware on an older Seagate hard drive. Seagate only offered a .iso image for me; however, I don't have a CD-ROM available.

Upon examination of the contents of the files stored inside of the .iso disk image, I didn't find anything that looked like a DOS executable; however, I did find an .ima file -- several megabytes in size.

This .ima file turned out to be another disk image that Seagate loaded using a tool called "Bootable CD Wizard" (or BCDW). I deduced that the El Torito bootable image in the .iso was using BCDW to load the .ima file into memory and "chain-load" the .ima file.

In order to make my bootable flash disk, I downloaded a FreeDos 1.1 image, and copied it directly to my USB device using the Unix dd command (note that my USB flash device is /dev/sdb). Don't accidentally overwrite something important by making a typo!
dd if=FreeDOS-1.1-memstick-2-256M.img of=/dev/sdb bs=1M
I then unplugged and plugged in the USB disk, and extracted the contents of the .iso file into my USB stick's FreeDOS partition with the Gnome Archive Manager (aka file-roller). This left the .ima file on the root directory of my USB stick's filesystem.

The trick was to figure out how to "chain-load" the .ima file, and I accomplished that by editing FreeDOS' syslinux.cfg file. Here's a snippet from the configuration file with the apropos section highlighted:

say Press ENTER to boot FreeDOS, or choose from these alternatives:
say ---------------------------------------------------------------
say :    fdos :: FreeDOS 1.1
say :    odin :: Boot ODIN 0.6 floppy disk image (tiny FreeDOS)
say : memtest :: Run Memtest86+ 4.20
say :      di :: Upgrade
say ---------------------------------------------------------------
say Example: To boot Memtest86+, type "memtest" and hit Enter.



label di
    menu label di upgrade
    linux /img/memdisk
    initrd /HE-CC35.ima


label fdos
    menu label fdos - Load FreeDOS 1.1 from USB flash drive
    com32 /fdos/bin/chain.c32
    append freedos=/fdos/bin/kernel.sys
In the boldfaced "di" (short for disk image, you can choose any word as the label) entry above, I instructed syslinux to load memdisk, which is a utility for booting floppy images. The initrd command tells syslinux to load a disk image into RAM.

Saving my work, I plugged the flash drive into the system that needed the firmware upgrade, and typed in di at the syslinux prompt in order to execute the corresponding menu entry.

Hopefully this is enough to help those of us with Seagate drives to get things working!