tech:note_iso_cd_dvd_iso9660

Note ISO CD DVD ISO9660

Voir :

  • isosize

Voir aussi :

genisoimage / xorriso

Voir https://wiki.debian.org/RepackBootableISO

Exemples :

#Linux
mkisofs -q -V VOLUME_NAME -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -T -o /LinuxISO.iso .
 
#Solaris
mkisofs -b boot/grub/stage2_eltorito -c .catalog -no-emul-boot -boot-load-size 4 -boot-info-table -relaxed-filenames -l -ldots -r -N -d -D -V VOLUME_NAME -o /SolarisISO.iso .
 
Windows
# The Bootable_NoEmulation.img normally lives in the [BOOT] folder. I tend to move it.
mkisofs -q -b Bootable_NoEmulation.img -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -joliet-long -l -D -relaxed-filenames -N -V VOLUME_NAME -o /WindowsISO.iso .

Source : https://www.romant.net/2010/05/creating-bootable-iso-linux-solaris-windows/

Création d'ISO de démarrage personnalisées

Source : RedHat - Création d'image de démarrage personnalisées

genisoimage -U -r -v -T -J -joliet-long -V "RHEL-9 Server.x86_64" -volset \N- "Serveur RHEL-9.x86_64" (en anglais) -A "Serveur RHEL-9.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o ../NEWISO.iso .

Dans l'exemple ci-dessus :

Assurez-vous que les valeurs des options -V, -volset, et -A correspondent à la configuration du chargeur de démarrage de l'image, si vous utilisez la directive LABEL= pour les options qui nécessitent un emplacement pour charger un fichier sur le même disque. Si la configuration de votre chargeur de démarrage (isolinux/isolinux.cfg pour le BIOS et EFI/BOOT/grub.cfg pour l'UEFI) utilise la directive inst.stage2=LABEL=disk_label pour charger la deuxième étape du programme d'installation à partir du même disque, les étiquettes des disques doivent correspondre.

Important Dans les fichiers de configuration du chargeur de démarrage, remplacez tous les espaces dans les étiquettes de disque par \x20. Par exemple, si vous créez une image ISO avec un label RHEL 9.0, la configuration du chargeur de démarrage doit utiliser RHEL\x209.0.

Remplacez la valeur de l'option -o (-o ../NEWISO.iso) par le nom de fichier de votre nouvelle image. La valeur indiquée dans l'exemple crée le fichier NEWISO.iso dans le répertoire above, le répertoire actuel.

Pour plus d'informations sur cette commande, voir la page de manuel genisoimage(1).

Implanter une somme de contrôle MD5 dans l'image. Notez que sans somme de contrôle MD5, la vérification de l'image peut échouer (option rd.live.check dans la configuration du chargeur de démarrage) et l'installation peut se bloquer.

  1. implantisomd5 ../NEWISO.iso

Dans l'exemple ci-dessus, remplacez ../NEWISO.iso par le nom de fichier et l'emplacement de l'image ISO que vous avez créée à l'étape précédente.

Vous pouvez maintenant écrire la nouvelle image ISO sur un support physique ou un serveur réseau pour la démarrer sur du matériel physique, ou vous pouvez l'utiliser pour commencer l'installation d'une machine virtuelle.

Hack Utilisation de xorriso pour remplacer genisoimage

Erreur genisoimage: option '-e' is ambiguous sous Debian 8

Voir :

-eltorito-alt-boot -e EFI/images/efiboot.img ou pour RedHat -eltorito-alt-boot -e images/efiboot.img

#genisoimage -quiet -o "$ISO_OUTPUT" -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b syslinux/isolinux.bin -c syslinux/boot.cat ./iso
xorriso -as mkisofs -quiet -o "$ISO_OUTPUT" -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -b syslinux/isolinux.bin -c syslinux/boot.cat -eltorito-alt-boot -e EFI/images/efiboot.img -no-emul-boot  ./iso
mv /usr/bin/genisoimage /usr/bin/genisoimage.dist

/usr/bin/genisoimage

#!/bin/bash
 
options=() # the buffer array for the parameters
 
while [[ $1 ]]
do
  case "$1" in
   -e)
     options+=("--eltorito-boot")
     shift
     ;;
   *)
     options+=("$1")
     shift
     ;;
  esac
done
 
echo Calling genisoimage.dist "${options[@]}"
eval exec /usr/bin/genisoimage.dist "${options[@]}"
chmod +x /usr/bin/genisoimage

Clef USB

Voir https://etcher.io, l'outil qui marche sur tous les systèmes (de façon on ne peut plus simple) et qui, à la fin, vérifie ce qu'il a écrit sur la clé

Voir Ventoy

Utilisation partition FAT et syslinux

Source: http://www.system-rescue-cd.org/Installing-SystemRescueCd-on-a-USB-stick/

Select type LBA FAT32 may be 0B or 0C, to make it bootable.

cfdisk /dev/sdf
mkfs.vfat -F 32 -n SYSRESC /dev/sdf1

The following dd command will overwrite the first 404 bytes of the MBR of your stick. It will erase the previous boot instructions with the default ones to make sure that it will work. It does not change anything in the partition table since the partition table starts at offset 446 in the MBR.

dd if=/usr/share/syslinux/mbr.bin of=/dev/sdf
sync
cp -af /mnt/cdrom/* /mnt/usbstick/
rm -rf /mnt/usbstick/syslinux
mv /mnt/usbstick/isolinux/isolinux.cfg /mnt/usbstick/isolinux/syslinux.cfg
sed -i -e 's/scandelay=1/scandelay=5/g' /mnt/usbstick/isolinux/syslinux.cfg
mv /mnt/usbstick/isolinux /mnt/usbstick/syslinux
umount /mnt/usbstick
syslinux /dev/sdf1
sync

isohybrid

Rendre l'iso bootable aussi pour une clef USB avec isohybrid

isohybrid plop.iso
isohybrid --uefi plop.iso

Alternative à isohybrid :
Utiliser l'option -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -isohybrid-gpt-basdat à xorriso

sudo apt-get install isolinux
#xorriso -as mkisofs -quiet -o "$ISO_NEWFILE_OUTPUT" -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -V "$ISO_LABEL_NAME" -volset "$ISO_LABEL_NAME" -A "$ISO_LABEL_NAME" -b isolinux/isolinux.bin -c isolinux/boot.cat -eltorito-alt-boot -e EFI/BOOT/BOOTX64.EFI -no-emul-boot .
 
xorriso -as mkisofs -quiet -o "$ISO_NEWFILE_OUTPUT" -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -isohybrid-gpt-basdat -r -J -no-emul-boot -boot-load-size 4 -boot-info-table -V "$ISO_LABEL_NAME" -volset "$ISO_LABEL_NAME" -A "$ISO_LABEL_NAME" -b isolinux/isolinux.bin -c isolinux/boot.cat -eltorito-alt-boot -e EFI/BOOT/BOOTX64.EFI -no-emul-boot .

Vérifier une iso

dumpet -i plop.iso
isoinfo -d -i plop.iso
file plop.iso
fdisk -l plop.iso

Autres

Convertion format iso avec iat.

Voir

apt-get install iat
iat input-image-file output-iso-file
 
iat image.nrg image.iso
iat image.bin > image.iso

Créer une clef bootable à partir d'un ISO

Source : Ultimate Boot CD

ubcd538\ubcd\tools\linux\ubcd2usb\readme.txt

PREREQUISITE: Extract UBCD ISO image to your hard disk, or mount the ISO image using loopback.
You cannot run syslinux from the USB thumb drive because files cannot be marked as executable
on a FAT32 partition.

To put UBCD on a USB thumb drive, your thumb drive needs to be partitioned in FAT16 or FAT32.

First we need to know on which device your USB thumb drive is listed in /dev/.
Afterwards we can format it and copy the necessary files.

1. Remove your USB thumb drive from your USB port if you already attached it.

2. Run one of the following command:
      A) fdisk -l
            It will list all drives. Look at the size to determine which one is your
            USB thumb drive. It can be that you need root rights to see the drives.

  	  B) dmesg | tail
            This will display something like the following, if you have just put in the
            USB thumb drive.
              [38350.743408] sd 9:0:0:0: [sdb] 4028416 512-byte hardware sectors (2063 MB)
              [38350.744272] sd 9:0:0:0: [sdb] Write Protect is off
              [38350.744284] sd 9:0:0:0: [sdb] Mode Sense: 23 00 00 00
              [38350.744291] sd 9:0:0:0: [sdb] Assuming drive cache: write through
              [38350.747289] sd 9:0:0:0: [sdb] 4028416 512-byte hardware sectors (2063 MB)
              [38350.748267] sd 9:0:0:0: [sdb] Write Protect is off
              [38350.748284] sd 9:0:0:0: [sdb] Mode Sense: 23 00 00 00
              [38350.748289] sd 9:0:0:0: [sdb] Assuming drive cache: write through
              [38350.748305]  sdb: sdb1
              [38350.749432] sd 9:0:0:0: [sdb] Attached SCSI removable disk

            In this case, my USB thumb drive is /dev/sdc.

      C) df -h
            You can use this only when the USB thumb drive is automounted by your
            distribution or when you mount it yourself.
            It will list all mounted filesystems. You have to find and know the size
            of the partitions which are already on the USB thumb drive.

               /dev/sdb1             2,0G  1,9G   87M  96% /media/NANO

            In my case, my USB thumb drive is /dev/sdb (discard the number on the end).

3. If you have found on which device in /dev/, your USB thumb drive is, you can partition it.

   WARNING: backup all files that you want to preserve to another drive.
   WARNING: This process will delete any information that is currently stored on the USB key.
            Proceed with caution!

      A) First, we delete all old partitions that remain on the USB key.

         1. Open a terminal and type sudo su
         2. Type umount /dev/sdX to unmount your USB thumb drive
            (replace X with the right letter for your device. BE CAREFUL)
         3. Type fdisk /dev/sdX (replacing X with your drive letter)
         4. Type d to proceed to delete a partition
         5. Type 1 to select the 1st partition and press enter
         6. Type d to proceed to delete another partition
            (fdisk should automatically select the second partition)

      B) Next, we need to create the new partition.

         1. Type n to make a new partition
         2. Type p to make this partition primary and press enter
         3. Type 1 to make this the first partition and then press enter
         4. Type a, then 1, to make the first primary partition active or bootable.
         5. Press enter to accept the default first cylinder
         6. Press enter again to accept the default last cylinder
         7. Press t to change the partition ID:
              If you want to format your USB thumb drive with FAT16, use:
                 'W95 FAT16 (LBA)' ==> press e
              If you want to format your USB thumb drive with FAT32
              (needed for partitions, larger than 2 GB, use:
                 'W95 FAT32 (LBA)'  ==> press c
         8. Type w to write the new partition information to the USB key


      C) Now, we need to create the fat filesystem.

         1. If you have chosen to format your USB thumb drive in FAT16
            ('W95 FAT16 (LBA)' in previous step), use:

               mkfs.vfat -F 16 /dev/sdX1 (replacing X with your USB key drive letter)

         2. If you have chosen to format your USB thumb drive in FAT32
            ('W95 FAT32 (LBA)' in previous step), use:

               mkfs.vfat -F 32 /dev/sdX1 (replacing X with your USB key drive letter)

4. Now, we write the syslinux mbr to the USB drive.
   The mbr.bin file is located in ./ubcd/tools/linux/ubcd2usb/ of the extracted UBCD iso.

     dd if=mbr.bin of=/dev/sdX (replacing X with your USB key drive letter)

5. Mount the partition of your USB drive
   You can use the GUI mounting utility of your distribution.
   If your distribution mounts USB drives automatically, you can remove and replug your USB thumb drive.

6. Copy all files of the extracted UBCD iso to your USB thumb drive.

7. Install syslinux to the partition of your USB thumb drive.

   Unmount the target device.

   Make sure that ./ubcd/tools/linux/ubcd2usb/syslinux is executable, if not, run:

     chmod a+x ./ubcd/tools/linux/ubcd2usb/syslinux (adapt the path if necessary)
	 
   If it is executable, run:

     sudo ./ubcd/tools/linux/ubcd2usb/syslinux --install -s -d /boot/syslinux /dev/sdX1
	 (replacing X with your USB key drive letter)
	 
   NOTE: If you are running x64 kernel instead of x86, you will need to use syslinux64
   instead of syslinux. Alternatively, install syslinux using the package manager supported
   by your distribution. The last resort is to download the syslinux tarball and compile
   from scratch.

8. Now you can boot UBCD from your USB drive, if your BIOS supports it of course.

Additional resources:

- http://nlug.ml1.co.uk/2012/04/installing-the-ultimate-boot-cd-to-usb-memory-stick/2512

Le fichier mbr.bin est fourni avec. Il peut être crée en faisant.

dd if=/dev/sdX of=mbr.bin bs=440 count=1

mount fuse - userland

sudo apt-get install fuseiso9660
 
mkdir -p ~/mnt/iso/plop
fuseiso9660 plop.iso ~/mnt/iso/plop
 
fusermount -u ~/mnt/iso/plop

Autres

#sudo mount plop/images/efiboot.img ~/mnt/tmp
udisksctl loop-setup --no-user-interaction --file plop/images/efiboot.img
TMP_DEV=$(/sbin/losetup -l |grep images/efiboot.img |awk '{print $1}')
TMP_MOUNTP=$(lsblk "$TMP_DEV" |tail -1 |awk '{print $7}')
#fusermount -u ~/mnt/tmp
#sudo umount ~/mnt/tmp
udisksctl unmount --no-user-interaction -b "$TMP_DEV"

Exemple de commande xorriso / mkisofs générée par CloneZilla

xorriso -as mkisofs -R -r -J -joliet-long -l -cache-inodes -iso-level 3 -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16 -A "Debian Live" -p "live-build 1:20200314.drbl1; https://salsa.debian.org/live-team/live-build" -publisher "Debian Live project; https://wiki.debian.org/DebianLive; debian-live@lists.debian.org" -V "Debian sid 20200428-22:24" --modification-date=2020042814042600 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot  -e boot/grub/efi.img -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus -o live-image-amd64.hybrid.iso binary
tech/note_iso_cd_dvd_iso9660.txt · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki