Post by William UnruhPost by David W. HodginsPost by William UnruhI tried to create an install usb stick for Mga9. I did it both using dd
and using isodumper (too bad that there is no man page for the latter--
there really should be).
The resultant usb was weird. It had apparently two partition, as
evidenced by the /dev/sda{,1,2} listings. If I ran gparted on it I
simply got a blank as if there was nothing on the usb stick. No
partitions, or anything. If I mounted /dev/sda1, I got a mounted
partition with lots in it. If I ran fdisk on it, I got that there were
two partitions, which gparted never saw. I also got a warning from fdisk
that it had detected and iso format and a write would overwrite it. (Ie,
and incomprehensible to me warning. I finally used fdisk to create a
third partion of Linux type to take up the extra 25GB or soon the usb
stick.
Now gparted suddenly saw three partitions, and empty one of about 4GB, a
small one of about 4 MiB fat16 MGAISO-ESP name and a 25GB unknown type.
Is it a bug in gparted that it saw nothing in the first instance?
Is it a bug that it sees the 4GB partition as unallocated when it
clearly is allocated.
Did my putting on a third partition to use the excess space on the USB
ruin it as a boot install usb stick?
It's due to the install images being iso hybrid images that can be burnt to
an optical disk, or copied to a usb stick.
For example with the netinstall iso ...
$ file Mageia-9-netinstall-nonfree-x86_64.iso
Mageia-9-netinstall-nonfree-x86_64.iso: ISO 9660 CD-ROM filesystem data (DOS/MBR boot sector) 'Mageia-9-x86_64-netinstall' (bootable)
Regular partitioning software does not handle iso 9660 images, whether in a
file on disk, or after having been copied/burnt to a usb stick or optical disk.
When it boots, the mbr partition table entry is used to select the iso9660 image,
or to select the esp which is then used to select the iso9660 image in uefi mode.
Once that starts, the partition table inside of the iso9660 gets used to boot
the installer.
I recommend using isodumper. Select the Write image option, the actual iso
image to be copied, and the Create partition option, using the dropdown for the
type to select Persistent partition. Then select the Execute button.
I did use isodumper but then also used fdisk to make the rest of theUSB
into an ext partition. gparted then saw the three partitions, but it
hung toward the end of the boot process.
So I tried your suggestion and gparted now saw the three partitions, and
it booted. and started the installation procedure, so adding the extra
partition with fdisk seems to have damaged it.
The iso images are created to make them suitable for burning to an optical
disk that can be booted in either bios or uefi firmware mode. They are then
modified to make them bootable from a usb drive (hybrid iso images).
Altering the partition table using fdisk makes changes in a way that the
boot loader can not be found. Using fdisk works for standard partition
tables, but doesn't work when the boot loader is inside of an iso 9660 image.
Post by William UnruhMy next question is that I had two partitions that I had created
earlier, and I copied the Mga8 root partition onto the spare, hoping to
use it for upgrading, so my working mga8 was presered as a spare in case
the Mga9 update had problems. However I could not boot into it, since
its /boot/grub2/grub.cfg still pointed at the other's root partition.
Will the updating of that partition work and mga9 installation now
allowing both partitions to be booted from?
Having multiple Mageia installs on the same hard drive was supported before
support for uefi was added, but is no longer supported by the installer.
It can be done but is extremely difficult.
The copying of the mga8 system to a new location, altering it to make it
bootable, and then upgrading that to mga9 can be done.
Extreme care must the taken when copying the mga8 system to a new location.
Do NOT use dd or similar low level tools to copy the install.
Using dd or similar tools would mean having a duplicate "Universally Unique
Identifier" that is no longer UNIQUE.
Having a duplicate uuid values means that which partition gets mounted can not
be controlled. Sometimes it will be one, sometimes it will be the other, and
not necessarily the one that is selected from the bios or uefi boot menu.
Similarly it will create duplicate disk signature's for mbr style partition
tables and duplicate ids in gpt partition tables.
The steps involved to do it properly involve:
- create the new partitions using standard partitioning software, taking
care not to create duplicate labels, etc.
- copy the contents of the existing partitions being sure to preserve things
like symlinks, and extended attributes, typically by careful use of rsync or
similar system level file copy utilities. Use a live iso or yet another install
when doing the copying so that no files being copied are open for writing.
- alter all occurrences of partition identifying strings in the copy. This
includes places such as /etc/default/grub, and fstab, but may include other
places depending on what software is being used.
- Either add the boot entries to the existing boot loader, or use a chroot
to install the copies' boot loader onto a new drive, and use the system boot
menu to select which drive to use to load the boot loader.
It's much simpler and safer to just do a new install, and then copy the data
files (and only the data files) from the old install. Copying config files
must be done with extreme care as the format of the config files may have
changed. It's safer to alter the contents of config files to reflect what
was present in the old ones, being careful not to alter the layout.
Regards, Dave Hodgins