Find the answer to your Linux question:
Results 1 to 10 of 10
Hi guys, Just started a new job where I test installation scripts and then wipe the system with a fresh install of Redhat each time before testing updated versions. I'm ...
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    1

    Create a custom RedHat ISO

    Hi guys,

    Just started a new job where I test installation scripts and then wipe the system with a fresh install of Redhat each time before testing updated versions. I'm wondering is there a way to create an image of the system I want with the customized packages required rather than having to manually select and deselect a huge amount of packages every time. This would really help make my work much more efficient.

    Thanks,

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,097
    I would recommend to use either https://fedorahosted.org/cobbler/ (small) or Spacewalk: Free & Open Source Linux Systems Management (big) to provision your systems.
    aka:
    - pxe boot
    - netinstall via kickstart

    In the kickstartconfig , you can define the packages you want (or not)
    You must always face the curtain with a bow.

  3. #3
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Irithori's advice is viable, and you'll find a /root/anaconda-ks.cfg file after your base installation that you can use to repeat the install. Easiest way to use one in my opinion is to drop it onto a web server and use "linux ks=http://server/path-to-ks-file".

    But imaging is also a good way to do what you want, and is really good if there are tweaks you do after the install that you want replicated. You can do them with a ks post-install script, but it's a bit of a pain.

    I use the Sourceforge project "g4l" for imaging. It basically just does a dd across the network to an ftp server. Michael, the maintainer, is very active and responsive and will respond to questions fairly promptly. Pay particular attention to the doc on zeroing out the free space on your drive before imaging it. It will make a huge difference in the space requirement for the image, and the time for making the image. Doesn't really speed up the restore since the zeroes have to be written back to the drive, no matter how compressed they are in the image.

    I've even done a hack to be able to put my images on a Fedora bootable USB hard drive and run the g4l script from that using localhost as the ftp server. Portable and works great, although USB is a little bit of a bottleneck compared to a gig network and a fast ftp server.

  4. #4
    Just Joined!
    Join Date
    Aug 2005
    Location
    India
    Posts
    6
    i have been working on redhat 6.2 server running licor imager the system had crashed. i recovered it imaged it and reinstalled the image on a defferent hard disk and machine successfully resumed work.
    it is essential to know:
    1.version of red hat linux
    2.file system ext2 / ext3
    3.tools- software tools
    4.hardware and computers systems available
    5.what install scripts you want to use

  5. #5
    Just Joined!
    Join Date
    Aug 2006
    Posts
    14
    In my last job, we prepared a linux system, than took an image of the system using partimage, running from a knoppix CD, to a USB stick.

    We then prepared a bootable USB stick - there are many articles on doing this - then copied the system image to the bootable stick. Booting off the stick, you can then restore the image to the host machine. With a small linux distribution, loading the image takes about a minute.

    If you load to a virgin hard disk, you will have to prepare one or more partitions and copy over the master boot record. These can easily be automated - google for detailed instructions. Good places to look are the arch linux, knoppix and SystemRescueCD sites.

  6. #6
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    If you use an OS agnostic imaging technique like g4l, you won't have to know any particulars of the installation, nor have to do any prep of the hard drive. As long as the drive is at least as big as the one the image was made from, you'll be fine. Because it's an image of the entire drive, you'll get back your MBR, partition table, filesystems, and contents.

    A disadvantage against the image programs that are OS aware is that some of those can produce a smaller image and/or faster image creation/recovery.

  7. #7
    Just Joined!
    Join Date
    Aug 2006
    Posts
    14
    I mentioned partimage because I've used it and it works reliably - it also makes small compressed images, so you can store them on a reasonable sized usb stick.

    I've not tried g4l, but its documentation mentions optional compression, so nomadicon has a choice.

    With partimage, the target partition must be at least as big as the source was - if bigger, then space is wasted, though tools exist to grow the restored partition to fit space available.

    I tried fsarchiver, but it only worked for me when the hard disks were identical.

  8. #8
    Just Joined!
    Join Date
    Aug 2005
    Location
    India
    Posts
    6

    imaging linux system

    the basic technique involves copying the system partition to an image file and restoring it back with full control over the process.

    method A

    requirement {a live cd} {hard disk space that will hold the live image}

    1.boot the system using a live cd with e2fsprogs supported by the system to be imaged
    2.mount the partion/partions holding the system
    mkdir /mnt/root
    mount -t ext2 /dev/hda1 /mnt/root
    mkdir /mnt/usr
    mount -t ext2 /dev/hda5 /mnt/usr (if applicable)
    mkdir /mnt/home
    mount -t ext2 /dev/hda5 /mnt/home (if applicable)
    mkdir /mnt/var
    mount -t ext2 /dev/hda5 /mnt/var (if applicable)
    mkdir /mnt/tmp
    mount -t ext2 /dev/hda5 /mnt/tmp (if applicable)

    3. make a rough estimate of the total spece occupied by the system on the partition suppose it is 1.6 GB this will keep the size of image to minimum possible size
    4. using dd command produce an image image file of 2GB approx. on the hard disk space other than the partitions holding the system to be imaged
    dd if=/dev/zero of=/path/to/the/imagefile/system.img bs=1024 count=210000
    this will produce image file of 2GB named system.img
    5 formatting the image with option yes
    mke2fs /path/to/the/imagefile/system.img
    6. run e2fsck with -f options
    e2fsck -f /path/to/the/imagefile/system.img
    7. mkdir /mnt/system
    8.mount the image file on /mnt/system
    mount -t ext2 -o loop /path/to/the/imagefile/system.img /mnt/system
    9.copy root file system which is on hda1 to /mnt/system
    cp -af /mnt/root/* /mnt/system
    10. copy other file systems
    cp -af /mnt/usr/* /mnt/system/usr (if applicable)
    cp -af /mnt/home/* /mnt/system/home (if applicable)
    cp -af /mnt/var/* /mnt/system/var (if applicable)
    cp -af /mnt/tmp/* /mnt/system/tmp (if applicable)
    11. unmount the image file
    umount /mnt/system
    12.run e2fsck on the image file
    e2fsck -f /path/to/the/imagefile/system.img

    the image could be copied back to the respective partitions when required manually or using the scripts

    this image could be used to produce a live cd /usb and installed back

    Method B
    instead of live cd a linux system with the e2fsprogs supported by the system
    thanks

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    There are tools and scripts on the Scientific Linux web site to help you create custom installation ISO images (called 'sites' in SL lingo), such as you are interested in. Since SL is a Red Hat Enterprise Linux clone, it should work with RHEL components as well. Anyway, it may be worth looking into.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #10
    Just Joined!
    Join Date
    Aug 2005
    Location
    India
    Posts
    6
    My thanks to all those who have posted on the subject. There are of course variety of tools available for this type of task. here in my earlier posts i have shared one of the basic ways to create an image of customised redhat linux from simple linux commands which could be scripted to make process faster. Coincidentally I have been working on creating a installable livecd lmage of fully updated and functional redhat 6.2 server. Soon I shall come up with an detailed article on the subject to share my experience with linux community
    in disasterous situations we fallback to command line.
    thanks once again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...