Boot of DVD iso Image from HD using Grub 1 (Katya)

Write tutorials and howtos in 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

Boot of DVD iso Image from HD using Grub 1 (Katya)

Postby Tejas_0 on Fri Jul 01, 2011 6:28 pm

PROLOG

  • Rationale
    Possible answer to keeping up with releases, and also thereby keeping a tight rein on what ends up on the hard disk, by keeping a couple of different distributions and just running their Live Versions.
  • Requirements
    Lots of disk space and a fairly fast CPU.
Code given as is, substitute in line to fit required configuration.

METHOD

LIVE MINT

  1. Place Downloaded Image in a Partition (Any one of ext2, ext3, reiserfs)
  2. Copy from the Iso Image the Files: 'vmlinuz' and 'initrd.lz'. Place them in a reiserfs Partition (not ext2fs, other fs types might be O.K.). There are numerous descriptions for the next steps wherever one looks, but anyway will supply the code used. In the following code block the downloaded DVD Iso Image is in /dev/sda6 in the directory /lm and files are copied to the directory /lm/vd in /dev/sda5.
    Code: Select all
    $ mkdir p5
    $ mkdir p6
    $ sudo mount /dev/sda5 p5
    $ sudo mount /dev/sda6 p6
    $ mkdir im
    $ sudo mount -t iso9660 -o loop p6/lm/linuxmint-11-gnome-dvd-32bit.iso im
    $ cp -p im/casper/vmlinuz    p5/lm/vd
    $ cp -p im/casper/initrd.lz    p5/lm/vd

  3. Grub Control Statements in 'menu.lst',
    Edit file '/boot/grub/menu.lst'
    1. Assume directory /lm/vd in Partition /dev/sda1 contains files 'vmlinuz' and 'initrd.lz'. Directory /lm in Partition /dev/sda6 contains the DVD iso Image.
      Code: Select all
         title Linux Mint Live DVD Iso Image Katya
         root (hd0,0)
         kernel /lm/vd/vmlinuz live-media=/dev/sda6 iso-scan/filename=/lm/linuxmint-11-gnome-dvd-32bit.iso file=/cdrom/preseed/mint.seed boot=casper noprompt
         initrd /lm/vd/initrd.lz

    2. Assume directory /lm/vd in Partition /dev/sda1 contains files 'vmlinuz' and 'initrd.lz'. Directory /lm in Partition /dev/sda1 contains the DVD iso Image.
      Code: Select all
         title Linux Mint Live DVD Iso Image Katya
         root (hd0,0)
         kernel /lm/vd/vmlinuz [live-media=/dev/sda1] iso-scan/filename=/lm/linuxmint-11-gnome-dvd-32bit.iso file=/cdrom/preseed/mint.seed boot=casper noprompt
         initrd /lm/vd/initrd.lz
    LIVE PERSISTENT MINT
    (Using Disk File to Store Persistent Data)

    Persistent Data File has to be in 'vfat' (fat32) Partition.
    In this instance 'vfat' Partition is /dev/sda8.


  4. Create an Empty Image, reserving Space of 1 GB in this instance.
    Code: Select all
    # mount /dev/sda8 p8
    # dd if=/dev/null of=p8/casper-rw bs=1M seek=1024
    0+0 records in
    0+0 records out
    0 bytes (0 B) copied, 5.7415e-05 s, 0.0 kB/s

  5. Make it an ext3 Mountable File System
    Code: Select all
    # mkfs.ext3 -F p8/casper-rw
    mke2fs 1.41.12 (17-May-2010)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    Stride=0 blocks, Stripe width=0 blocks
    65536 inodes, 262144 blocks
    13107 blocks (5.00%) reserved for the super user
    First data block=0
    Maximum filesystem blocks=268435456
    8 block groups
    32768 blocks per group, 32768 fragments per group
    8192 inodes per group
    Superblock backups stored on blocks:
     32768, 98304, 163840, 229376

    Writing inode tables: done
    Creating journal (8192 blocks): done
    Writing superblocks and filesystem accounting information: done
    This filesystem will be automatically checked every 27 mounts or
    180 days, whichever comes first. Use tune2fs -c or -i to override.

  6. Grub Control Statements in 'menu.lst',
    Edit file '/boot/grub/menu.lst'
    1. Assume directory /lm/vd in Partition /dev/sda1 contains files 'vmlinuz' and 'initrd.lz'. Directory /lm in Partition /dev/sda6 contains the DVD iso Image. Directory /lm/vd in 'vfat' Partition contains the persistent data file 'casper-rw'.
      Code: Select all
      title Linux Mint Live DVD Iso Image Katya Persistent
      root (hd0,0)
      kernel /lm/vd/vmlinuz live-media=/dev/sda6 iso-scan/filename=/lm/linuxmint-11-gnome-dvd-32bit.iso file=/cdrom/preseed/mint.seed boot=casper noprompt persistent persistent-path=/lm/vd
      initrd /lm/vd/initrd.lz

    2. Assume directory /lm/vd in Partition /dev/sda1 contains files 'vmlinuz' and 'initrd.lz'. Directory /lm in Partition /dev/sda1 contains the DVD iso Image. Root directory of 'vfat' Partition contains the persistent data file 'casper-rw'.
      Code: Select all
      title Linux Mint Live DVD Iso Image Katya Persistent
      root (hd0,0)
      kernel /lm/vd/vmlinuz live-media=/dev/sda6 iso-scan/filename=/lm/linuxmint-11-gnome-dvd-32bit.iso file=/cdrom/preseed/mint.seed boot=casper noprompt persistent [persistent-path=/]
      initrd /lm/vd/initrd.lz
EPILOG

  • Partition File Systems

    1. Storing Persistent Data in a Partition.
      Label the partition file system 'casper-rw'. This will result in dedicating said partition to persistent data, with the whole partition file system being used to store persistent data. i.e. persistent data will be distributed(scattered) over the whole file system.
    2. Storing Persistent Data in a File.
      Ensure partition file system is not labelled 'casper-rw', but that the persistent data file is named 'casper-rw'. If the partition file system is labelled 'casper-rw', the search stops there, and the file 'casper-rw' remains unused. Also the file 'casper-rw' will not be found if it is on a partition of type 'ext2fs', 'ext3fs', 'reiserfs'. Partition file system of type 'vfat'(fat32) does the trick.
  • Conclusion

    1. Loading Limitations
      1. Grub refuses to load the files 'vmlinuz' and 'initrd.lz' from partitions of type ext2 but reiserfs works OK. Other file systems not tried.
      2. DVD iso image has loaded OK from partitions of type 'ext2fs, ext3fs, reiserfs'.
    2. Persistent File System Usage.
      The code shows a persistent data file with 1 GB of reserved space. Starting with an initial 20%, usage has relatively quickly shot up to 40% despite frugal demand. Persistent file on system of 1 GB memory with 512 MiB swap space.
      Code: Select all
      mint@mint ~ $ sudo swapon -s
      Filename            Type      Size   Used   Priority
      /dev/sda7                               partition   530108   1552   -1
      mint@mint ~ $ df -h .
      Filesystem            Size  Used Avail Use% Mounted on
      aufs                 1008M  391M  567M  41% /

    3. Enlargement of Persistent File System without Deleting Customizations.

      1. Create empty temporary file.
        Code: Select all
        dd if=/dev/null of=/tmp/tempfile bs=1M seek=256

      2. Tack file on to end of casper-rw persistent file
        Code: Select all
        cat /tmp/tempfile >> /path_to/casper-rw

      3. Enlarge file system to encompass added disk space:
        Code: Select all
        e2fsck -f /path_to/casper-rw
        resize2fs /path_to/casper-rw
Release: Linux Mint 16 "petra"
Edition: Cinnamon 32-bit
Linux mint 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:12:00 UTC 2013 i686 athlon i686 GNU/Linux
Tejas_0
Level 3
Level 3
 
Posts: 187
Joined: Tue May 17, 2011 6:06 pm

Linux Mint is funded by ads and donations.
 

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 3 guests