Make the Mint 13 32-bit Live System Bootable from the ISO

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Make the Mint 13 32-bit Live System Bootable from the ISO

Postby karlchen on Thu Jul 19, 2012 6:52 pm

Abstract

This post will give you a step by step instruction on how to modify the original Mint 13 32-bit installation ISO file, released in May 2012, in such a way that you will be able to boot the Live System from the ISO file directly.
This is useful e.g. when using multiboot USB pendrives holding several different Linux distributions.
Having a corrected ISO image is useful when performing a Mint4win installation of Mint 13 32-bit, too.
By now, October 7th, 2012, the forum user breaker has posted 2 scripts, one for the Cinnamon edition and one for the Mate edition, which will perform all required steps automatically. Using these scripts will spare you the effort and time of following the instructions given here step by step. The scripts have been posted over there => breaker's scripts <=


Problem

Affected editions:
  • Linux Mint 13 "Maya" 32-bit, Cinnamon Desktop
  • Linux Mint 13 "Maya" 32-bit, MATE Desktop
  • Linux Mint 13 "Maya" 32-bit, Xfce Desktop
There have been reports that booting the Mint 13 32-bit download ISOs directly may fail. Cf. e.g. Linux Mint 13: Grub2 ISO Loopback Not Working?.
According to my own experience, it is most likely to happen in cases where there is at minimum one NTFS filesystem on the local harddisk of your machine.
Yet, it is not the NTFS filesystem which is to blame for the failure. Rather the source of trouble is the same which prevents you from successfully performing a Mint4win installation of Linux Mint 13 32-bit, too. Cf. e.g. Problem with Linux mint 13 Cinnamon 32-bit mint4win install.
An instruction on How to Perform a Mint4win Installation of Mint 13 32-bit nevertheless has been posted.


References



Fixing the Original Linux Mint 13 32-bit installation ISO file

By following that workaround the original installation ISO linuxmint-13-cinnamon-dvd-32bit.iso or linuxmint-13-mate-dvd-32bit.iso will not be corrected. Therefore that workaround alone will not enable you to boot from the ISO directly.

Here is how to fix the whole ISO:

Prerequisites
  • Either of the two original Linux Mint 13 32-bit installation ISOs, Mate Desktop or Cinnamon Dektop, whichever you want to repair.
    I repaired the Cinnamon edition.
  • A recent Linux Mint system, 32-bit or 64-bit, which will be used to perform the repair steps.
    As a matter of fact, I used my Linux Mint 13 32-bit which had been set up using Mint4win only a few days ago. cf. here :wink:
  • Sufficient free disk space, 5 GB should be fine. The disk space will be needed only during the repair work.
  • Make sure the command mkisofs or genisoimage is available.
    On a normal Mint 13 installation both commands should be available.
  • Make sure the packages p7zip and p7zip-full have been installed.
    Also make sure file-roller is present, unless you prefer to use p7zip from the commandline.

Steps
  • Launch a terminal session and execute
    Code: Select all
    mkdir -p /home/remastersys/ISOORG
    mkdir -p /home/remastersys/ISOTMP
    mkdir -p /home/remastersys/scripts

  • Copy the original ISO file linuxmint-13-cinnamon-dvd-32bit.iso (I will use it throughout the instruction, but the steps for linuxmint-13-mate-dvd-32bit.iso are the same) to /home/remastersys/ISOORG
  • Extract the file initrd.lz from the file linuxmint-13-cinnamon-dvd-32bit.iso, subfolder /casper, to the folder /home/remastersys/ISOORG
    I used file-roller to do so.
  • Fix this faulty initrd.lz by following the relevant subset of the steps given in this Howto, How to Perform a Mint4win Installation of Mint 13 32-bit, section "One time action: fixing the faulty initrd.lz file"

    • Execute these commands
      Code: Select all
      cd /home/remastersys/ISOORG
      mkdir x
      cd x
      zcat ../initrd.lz | cpio -i -d
      initrd.lz will be extracted to the current folder, preserving the folder structure packed inside initrd.lz.
    • Execute
      Code: Select all
      cd sbin
      ls -al mount.ntf*
      file mount.ntf*
      This will list two files and reveal that they are 64-bit ELF executables although in fact they should be 32-bit ELF executables.
    • Carry on by executing these commands
      Code: Select all
      ls -al ../bin/ntfs-3g
      file ../bin/ntfs-3g
      This will list a correct 32-bit version of the same file, only having a slightly different name.
    • Correct the error by executing
      Code: Select all
      cp ../bin/ntfs-3g ./mount.ntfs
      cp ../bin/ntfs-3g ./mount.ntfs-3g
    • Verify the files are correct 32-bit ELF files now by executing
      Code: Select all
      file mount.ntf*
    • Now we need to recreate a new initrd.lz file by repacking the whole sub-folder sturcture. Execute
      Code: Select all
      cd /home/remastersys/ISOORG/x
      find . | cpio -o -H newc | gzip -9 > ../initrd.lz
      This will generate a new initrd.lz file overwriting the faulty initrd.lz in the folder /home/remastersys/ISOORG
  • Extract the complete ISO file /home/remastersys/ISOORG/linuxmint-13-cinnamon-dvd-32bit.iso to the folder /home/remastersys/ISOTMP
    (I have done so using the file-roller GUI.)
  • The subfolder /home/remastersys/ISOTMP should have the following content now:
    Code: Select all
    md5sum.txt   1364   2012.7.18   23:43.36
    mint4win.exe   2379739   2012.5.21   0:18.24
    autorun.inf   185   2012.5.10   19:24.22
    .disk\   0   2012.7.18   23:13.48
    |- base_installable   0   2012.4.23   14:26.44
    |- mint4win   47   2012.5.7   16:1.2
    |- release_notes_url   38   2012.5.7   15:59.50
    |- casper-uuid-generic   37   2012.5.21   0:29.22
    |- live-uuid-generic   37   2012.5.21   0:29.22
    |- info   47   2012.5.7   16:2.44
    |- cd_type   15   2012.4.23   14:26.44
    preseed\   0   2012.7.18   23:14.14
    |- cli.seed   212   2012.4.23   14:26.44
    |- ltsp.seed   497   2012.4.23   14:26.44
    |- mint.seed   463   2012.5.7   15:46.34
    isolinux\   0   2012.7.18   23:14.14
    |- isolinux.bin   24576   2012.7.18   23:43.38
    |- vesamenu.c32   155664   2012.5.6   1:2.6
    |- splash.jpg   11452   2012.5.6   1:2.6
    |- boot.cat   2048   2012.5.21   0:31.54
    |- memtest   103260   2012.5.6   1:2.6
    |- isolinux.cfg   1544   2012.5.20   20:45.36
    [BOOT]\   0   2012.7.18   23:14.14
    |- Bootable_NoEmulation.img   2048   2012.5.26   13:52.8
    boot\   0   2012.7.18   23:13.48
    |- grub\   0   2012.7.18   23:13.48
    .....|- loopback.cfg   681   2012.5.7   15:50.22
    casper\   0   2012.7.18   23:18.26
    |- filesystem.manifest-desktop   47431   2012.5.21   0:31.52
    |- filesystem.manifest   47706   2012.5.21   0:29.32
    |- initrd.lz   20785999   2012.7.2   22:41.10
    |- filesystem.manifest-remove   1079   2012.4.23   13:43.28
    |- filesystem.squashfs   826019840   2012.5.21   0:31.52
    |- filesystem.size   11   2012.5.21   0:29.32
    |- vmlinuz   4864480   2012.5.21   0:29.14
    install\   0   2012.7.18   23:14.14
    |- mt86plus   176764   2011.11.27   12:0.54
    |- README.sbm   1865   2011.10.19   18:24.52
    |- sbm.bin   1474560   2011.10.19   18:24.52
  • Launch a terminal session and execute
    Code: Select all
    cp /home/remastersys/ISOORG/initrd.lz /home/remastersys/ISOTMP/casper/initrd.lz
    Now the repaired initrd.lz file is inside the folder /home/remastersys/ISOTMP/casper.
  • Change to the scripts sub-folder.
    Code: Select all
    cd /home/remastersys/scripts

  • Create the following script and name it remasteriso e.g.:
    Code: Select all
    #!/bin/bash
    #
    #  Created by Tony "Fragadelic" Brijeski
    #  Copyright 2007,2008 Under the GNU GPL2 License
    #  Originally Created February 12th, 2007
    #
    export WORKDIR=/home/remastersys
    export CUSTOMISO=linuxmint-13-cinnamon-dvd-32bit.iso
    export LIVECDLABEL="Linux Mint 13 Maya x86"

    if [ -f $WORKDIR/remastersys.log ]; then
        rm -f $WORKDIR/remastersys.log
        touch $WORKDIR/remastersys.log
    fi


    CREATEISO="`which mkisofs`"
    if [ "$CREATEISO" = "" ]; then
        CREATEISO="`which genisoimage`"
    fi

    #checking the size of the compressed filesystem to ensure it meets the iso9660 spec for a single file
    SQUASHFSSIZE=`ls -s $WORKDIR/ISOTMP/casper/filesystem.squashfs | awk -F " " '{print $1}'`
    if [ "$SQUASHFSSIZE" -gt "3999999" ]; then
        echo " The compressed filesystem is larger than the iso9660 specification allows for a single file. You must try to reduce the amount of data you are backing up and try again."
        echo " The compressed filesystem is larger than the iso9660 specification allows for a single file. You must try to reduce the amount of data you are backing up and try again.">>$WORKDIR/remastersys.log
        exit 1
    fi

    # Step 7 - Make md5sum.txt for the files on the livecd - this is used during the
    # checking function of the livecd
    echo "Creating md5sum.txt for the livecd/dvd"
    cd $WORKDIR/ISOTMP && find . -type f -print0 | xargs -0 md5sum > md5sum.txt

    # remove files that change and cause problems with checking the disk
    sed -e '/isolinux/d' md5sum.txt > md5sum.txt.new
    sed -e '/md5sum/d' md5sum.txt.new > md5sum.txt
    rm -f md5sum.txt.new

    sleep 1

    # Step 8 - Make the ISO file
    echo "Creating $CUSTOMISO in $WORKDIR"
    $CREATEISO    \
     -quiet \
     -r    \
     -V "$LIVECDLABEL"    \
     -cache-inodes    \
     -J    \
     -l    \
     -b isolinux/isolinux.bin    \
     -c isolinux/boot.cat    \
     -no-emul-boot    \
     -boot-load-size 4    \
     -boot-info-table    \
     -o $WORKDIR/$CUSTOMISO "$WORKDIR/ISOTMP" 2>>$WORKDIR/remastersys.log 1>>$WORKDIR/remastersys.log


    # create the md5 sum file so the user doesn't have to - this is good so the iso file can later be tested to ensure it hasn't become corrupted
    echo "Creating $CUSTOMISO.md5 in $WORKDIR"

    cd $WORKDIR
    md5sum $CUSTOMISO > $CUSTOMISO.md5

    sleep 1


    echo "$WORKDIR/$CUSTOMISO is ready to be burned or tested in a virtual machine."
    echo " "
    echo "Check the size and if it is larger than 700MB you will need to burn it to a dvd"
    echo " "
    ls -hs $WORKDIR/$CUSTOMISO
    echo " "

    exit 0

    Legal Note:
    The script has not been created by me. It is a drastically shortened version of the original ingenious Remastersys script, created and maintained by Tony "Fragadelic" Brijeski, version 2.0.18-1 for Ubuntu 9.10, downloaded here way back in 2010.
    So all credits for the script which will perform the most important steps of the repair procedure, rebuilding the ISO image, go to Tony "Fragadelic" Brijeski.

  • Before you launch the script remasteriso, make sure that you check and modify these 3 variables in the header of the script:
    Code: Select all
    export WORKDIR=/home/remastersys
    export CUSTOMISO=linuxmint-13-cinnamon-dvd-32bit.iso
    export LIVECDLABEL="Linux Mint 13 Maya x86"
    Provided you have created all folders as instructed, the variable WORKDIR has already been set correctly. So you only need to have a look at CUSTOMISO and at LIVECDLABEL.
  • Make the script executable.
    Code: Select all
    chmod +x /home/remastersys/scripts/remasteriso

  • Launch the script.
    Code: Select all
    /home/remastersys/scripts/remasteriso

  • Provided you have followed all steps carefully, remasteriso should announce successful completion only a few minutes later.
  • The new corrected ISO file will be here: /home/remastersys/linuxmint-13-cinnamon-dvd-32bit.iso - The script will also tell you so. - In case any error occurs the script will tell you so, too. Nonetheless, checking the logfile /home/remastersys/remastersys.log will not do any harm.
  • The file /home/remastersys/linuxmint-13-cinnamon-dvd-32bit.iso is the only file which you should definitely keep. Apart from the mentioned file, you may remove the content of /home/remastersys.
  • Provided you put it on a bootable pendrive you should be able to boot to the Linux Mint 13 Live system directly from the ISO.

Note:

There are quite a few programmes out there which can create bootable USB pendrives and allow you to boot directly from ISOs stored on the pendrives. The one that I used to create my bootable multiboot pendrive(s) is YUMI – Multiboot USB Creator (Windows). Beware, it runs on Windows only. Anyway, use what is most convenient for you.

Hope the above steps will help anybody.


Disclaimer

I have in fact remastered the Linux Mint 13 32-bit Cinnamon Desktop installation ISO following the steps given above. It worked perfectly. Nonetheless, I may have forgotten or incorrectly written down a detail or two. In case you should find any errors in the instruction, please, do not hesitate to let me know. So I can check and correct it.

Karl
User avatar
karlchen
Level 11
Level 11
 
Posts: 3776
Joined: Sat Dec 31, 2011 7:21 am

Linux Mint is funded by ads and donations.
 

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 6 guests