@tom-elliott Thanks for your attention on my tickets!
The most cryptic one (count= issue) is not solved by sgdisk -z before dd but after. I’m going to add some infos.
Thanks again for FOG: I’ve been using it by 6-7 years. I can multicast deploy a 20 dual boot pc classroom in 30 minutes!
Best posts made by Enrico
-
RE: deploying "Other OS (99)" fails
Latest posts made by Enrico
-
RE: refind.conf for Osx + bootcamp (hint)
I confirm it is solved.
Notice:
timeout is -1, so it boot the first os if no esc key is pressed. -
RE: Error trying restore gpt partition tables
@tom-elliott Ok, I confirm it is working. Thanks!
-
RE: Error trying restore gpt partition tables
@sebastian-roth
My osx/windows environment does not use grub! I paused the original script and I can assure that saveGRUB creates d1.mbr and sgdisk overwrites it then.d1.mbr d1.original.uuids d1p1.img d1p2.img d1p3.img d1p4.img d1.partitions
However, my grub environment (linux/windows) does not create d1.grub.mbr, but touches d1.has_grub.
d1.has_grub d1.mbr d1p1.img d1p3.img d1.partitions
[[ -n $sgdisk && $hasGRUB -eq 1 ]] && mbr="$imagePath/d${disk_number}.grub.mbr" || mbr="$imagePath/d${disk_number}.mbr"
In grub/MBR environment (linux/windows) $sgdisk is null -> d1.mbr
In no grub/GPT environment (osx/windows) $hasGRUB is 0 -> d1.mbr -
RE: Error trying restore gpt partition tables
@sebastian-roth I totally agree! This is the reason why I don’t like to submit a patch…
I’m going to bore you with a few other details to help clarifying the issue.The problem begins in the capture phase in savePartitionTablesAndBootLoaders():
1) dots "Saving Partition Tables (GPT)" saveGRUB "$disk" "$disk_number" "$imagePath" "true" sgdisk -b "$imagePath/d${disk_number}.mbr" $disk >/dev/null 2>&1
the sgdisk command overwrites the just created saveGRUB file ($imagePath/d${disk_number}.mbr).
In the deploy phase, restorePartitionTablesAndBootLoaders():
restoreGRUB "$disk" "$disk_number" "$imagePath" "true" sgdisk -gl $tmpMBR $disk >/dev/null 2>&1
restoreGRUB is restoring the sgdisk’s file
One more thing: restoreGRUB is using dd on first sectors and does not restore the backup GPT that is at the end of disk.
So, when sgdisk is called to restore data, it says CRC mismatch between the main partition table (restored by restoreGRUB) and the backup one (not restored): error 2.
I think saveGRUB() and restoreGRUB() are saving and restoring MBR in effect: I can’t see the hasGRUB() usefullness in GPTSo, my last proposal (for today) is to forgot previous patches and comment out:
restorePartitionTablesAndBootLoaders() { ... if [[ $table_type == GPT ]]; then dots "Restoring Partition Tables (GPT)" # restoreGRUB "$disk" "$disk_number" "$imagePath" "true" sgdisk -gl $tmpMBR $disk >/dev/null 2>&1
and
savePartitionTablesAndBootLoaders() { ... case $hasgpt in 0) strdots="Saving Partition Tables (MBR)" ... dots "$strdots" # saveGRUB "$disk" "$disk_number" "$imagePath" sfdisk -d $disk 2>/dev/null > $sfdiskfilename
I tested capture/deploy of my windows/linux (MBR) and osx/windows (GPT) with no issues.
-
RE: deploying "Other OS (99)" fails
@tom-elliott Thanks for your attention on my tickets!
The most cryptic one (count= issue) is not solved by sgdisk -z before dd but after. I’m going to add some infos.
Thanks again for FOG: I’ve been using it by 6-7 years. I can multicast deploy a 20 dual boot pc classroom in 30 minutes! -
RE: Error trying restore gpt partition tables
Sorry for the misunderstanding! I’m not a developer. Thanks for pointing out my mistake. I’m going to edit the first snippets removing
sgdisk -z $disk
(my single patch)
I reported one solution but I’m not sure that it has no side effects because I’m not familiar with the code.
Do you think I had to push a request on git? I’m not familiar but I can learn.
About https://forums.fogproject.org/topic/10998/problem-of-deployment-of-an-old-image ticket:
I don’t think it is related. My image is captured using the same 1.4.4 as the one in the deploy phase.
In my case, the problem is like https://github.com/ceph/ceph-ansible/issues/759
My bootloader seems hybrid MBR and I don’t understand why $count parameter of dd is 40 (MBR is first 512 bytes, I think).
I debugged deeper and I see FOG makes andots "Erasing current MBR/GPT Tables"; sgdisk -Z $disk >/dev/null;
then
dd if=$tmpMBR of=$disk bs=512 count=$count >/dev/null 2>&1
with $count=40.
If I fire an gdisk -l $disk
the output saysMBR: hybrid ... GPT: damaged
Firing by hand instead
dd if=$tmpMBR of=$disk bs=512 count=1
gdisk -l $disk outputs:
MBR: hybrid ... GPT: not present
then I can send sgdisk -gl $tmpMBR $disk >/dev/null 2>&1 without errors.
So, a better patch could be setting $count=1 before dd?[[ $count -eq 8 ]] && count=1 # patch? [[ $count -eq 40 ]] && count=1 dd if=$tmpMBR of=$disk bs=512 count=$count >/dev/null 2>&1
It is beyond my FOG code knowdlege.
Let me know.
Thanks! -
RE: refind.conf for Osx + bootcamp (hint)
Those settings fit more situations, I think (but I can’t assure that) but you can tune them.
scanfor selects where it is going to search for boot loaders. In my case, “internal” does not find bootcamp boot loader, so I add “hdbios”.
scandelay 5 is needed because the default 0 is too quick to permit the bootcamp become available.
timeout 5 is needed because the default -1 goes straightforward to boot the default loader and does not show the two os options. So, this one is needed if you have a multiboot system only.
-
RE: deploying "Other OS (99)" fails
Because, in my mind, in a multiboot environment (osx + windows), if I select osx (for example) it could not fit the windows os or reverse. I selected “99” os type to image a windows+linux for years, but let me know if it is better to choose an other option.
Thanks for fog! -
refind.conf for Osx + bootcamp (hint)
To boot Mac with OSx and windows bootcamp, you have to select REFIND_EFI in Exit to Hard Drive Type(EFI) menu of FOG PXE Boot Menu Configuration.
Then modify /var/www/html/fog/service/ipxe/refind.conf parameters:timeout 5 scanfor internal,hdbios,external,biosexternal scan_delay 5
Hope this helps someone!
-
RE: "rEFInd - About" instead of booting properly
Hi,
try setting this parameter in /var/www/html/fog/service/ipxe/refind.conf:# Delay for the specified number of seconds before scanning disks. # This can help some users who find that some of their disks # (usually external or optical discs) aren't detected initially, # but are detected after pressing Esc. # The default is 0. # scan_delay 5
and, if you need, this:
# Timeout in seconds for the main menu screen. Setting the timeout to 0 # disables automatic booting (i.e., no timeout). Setting it to -1 causes # an immediate boot to the default OS *UNLESS* a keypress is in the buffer # when rEFInd launches, in which case that keypress is interpreted as a # shortcut key. If no matching shortcut is found, rEFInd displays its # menu with no timeout. # timeout 5