Adding normal wipe to PXE boot menu
-
Re: Remote wipe
Does this work in the current version of FOG? I have looked at several threads on remote wiping machines, but none of them seem to be conclusive for the current version. Can I have an option on my PXE boot menu that allows me to select normal wipe, or do I need to use DBAN? The native wipe in Fog works fine and I have been using that, but currently my process is
- PXE boot the machine and select Quick Registration and Inventory
- Find that new machine in the hosts menu and assign the normal wipe task
- Reboot machine for PXE to pick it up again and perform the task
Is there any way that I can just add normal wipe to the menu and if so how? Does the post I referenced at the beginning work on the1.5.5 version?
I have looked at:
https://forums.fogproject.org/topic/10786/dban-fog-boot-menu
https://forums.fogproject.org/topic/11742/add-wipe-disk-to-the-pxe-menu
https://forums.fogproject.org/topic/9211/add-wipe-option-to-fog-boot-menu
and https://forums.fogproject.org/topic/4791/fast-wipe-in-advanced-menubut I not sure any of them cover what I am after.
Thanks
-
It should be possible to do, I’ve knitted together an idea that might work. Note: there may be a smarter way to go about this, but this might get you going until I can get my hands on a fog server console.
Go in and create a new FOG iPXE menu item and have it displayed for all hosts.
Menu Item: fog.fastwipe
Description: FOG’s Fast Disk Wipe
Parameters:
kernel bzImage
initrd init.xz
imgargs loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=${fog-ip}/fog consoleblank=0 loglevel=4 capone=1 mode=wipe wipemode=fast mac=00:00:00:00:00:00
boot || goto MENU -
@george1421 said in Adding normal wipe to PXE boot menu:
imgargs loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 keymap= web=${fog-ip}/fog consoleblank=0 loglevel=4 capone=1 mode=wipe wipemode=fast mac=00:00:00:00:00:00
boot || goto MENUAll seems to be going well until we get the below
-
@ayoward So what the error is saying it can’t connect to the virtual hard drive (init.xz). Would you post exactly what you have listed in the parameters section of the iPXE menu for this wipe command?
Since the kernel is loading I thinking the kernel line is OK, but initrd line may be suspect.
-
@george1421 I just copied what you put and made the change to the IP address details. The rest is verbatim.
-
@ayoward said in Adding normal wipe to PXE boot menu:
I just copied what you put and made the change to the IP address details. The rest is verbatim.
lol that may have been your first mistake.
OK I just connected to my fog server and pulled the iPXE menu. This is the current structure of the auto registration option.
kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=270000 web=http://192.168.30.53/fog/ consoleblank=0 rootfstype=ext4 mdraid=true storage=192.168.30.53:/images/ storageip=192.168.30.53 loglevel=4 mode=autoreg imgfetch init.xz boot || goto MENU
So lets switch it around to do the wipe command.
kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=270000 web=${fog-ip}/fog/ consoleblank=0 rootfstype=ext4 capone=1 mode=wipe wipemode=fast mac=00:00:00:00:00:00 imgfetch init.xz boot || goto MENU
As you can see they are now putting all of the kernel options on the kernel lines and not in a separate imgarg line.
-
@george1421 That has sorted it. Genius!!
Thanks so much
-
@george1421 said in Adding normal wipe to PXE boot menu:
kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=270000 web=${fog-ip}/fog/ consoleblank=0 rootfstype=ext4 capone=1 mode=wipe wipemode=fast mac=00:00:00:00:00:00
imgfetch init.xz
boot || goto MENUWould it be possible to add a wild card to see any disk in the host computer and wipe them all?
-
@londonfog I don’t specifically know the wipe function, but I might guess it would only wipe the target (defined) hard drive in the host configuration.
If you were ok with scripting it wouldn’t be that difficult to update the fog.wipe module to just loop through the disks instead of the one pointed to by
getHardDisk
function.ref: https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/bin/fog.wipe
patching FOS is pretty simple to do too without needing to unpack and pack the inits.