?
Solved

How do I create an ISO image of an entire hard drive operating under Linux (CENTOS)?

Posted on 2006-05-09
12
Medium Priority
?
14,936 Views
Last Modified: 2013-12-06
Hello.  I'm relatively new to Linux and know enough to be dangerous.  I'm trying to create an ISO image of an entire volume on a Linux (CentOS Linux 4.3) box such that I can then transfer that ISO image to a CD which will then be used to create an identical configuration on another box (with the exact same hardware config).   The hard drive I'm backing up has a capacity of 80gb and only has about 10gb being used.    

As I understand it (and I could be wrong) there are two processes here.  First is creating the ISO file.  Second is transferring that ISO file to a CD in such a way as to allow for restoring it to another hard drive to give me an identical setup on the second machine.    How do I do this?

With regard to creating the ISO image file of the entire volume, my limited understanding says I should be using the "mkisofs" command but I have been unable to get it to work.    The full command I'm issuing is:  

mkisofs -o image.iso -b boot/intrd-2.6.9-34.EL.img -c boot.cat -R -J -T

When I issue this command I get an error stating the .img file I specified "has not an allowable size".  Candidly I don't even know if the .img file I'm specifying is correct but it's the only .img file in the /BOOT/ directory.

With regard to the seond step in the process ... well, let's just say I haven't gotten that far yet.  

Thank you in advance for your assistance.

Brad .....
 
0
Comment
Question by:habcoservices
  • 4
  • 3
  • 3
  • +1
12 Comments
 
LVL 15

Expert Comment

by:DonConsolio
ID: 16643595
iso files are not the optimal way to transfer a complete system
- file name length
- max. directory depth
- permissions
- owners/groups
- device files (and other special files like named pipes)
- links/symlinks
- creation/access/modification dates
 etc.
can't be fuly represented in ISO images

so you better create a .tar or .cpio archive and restore that file on your target machine
or you might use a tool like partimage to create a "portable" image.
0
 

Author Comment

by:habcoservices
ID: 16644269
Thanks for your response.  How might I go about creating a portable image? I will need to send this CD portable image to our other offices.   I'm trying to make the process as idiot proof as possible for those receiving the CD image. Is partimage a utility like Ghost?
0
 
LVL 14

Expert Comment

by:cjl7
ID: 16646011
Hi,

I would create a bootable cd (dvd) and put a kickstart file on there...

That way you could send your customized version (with all your settings) to all of your offices and all they would have to do is to insert the cd/dvd and have a cup of coffee...

//jonas
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:DonConsolio
ID: 16646864
partimage (http://www.partimage.org/Main_Page)

Description: Partition Image is a Linux/UNIX utility which saves partitions in many formats (see below) to an image file. The image file can be compressed in the GZIP/BZIP2 formats to save disk space, and split into multiple files to be copied on removable floppies (ZIP for example)

Kind of "Ghost for Linux"
0
 

Author Comment

by:habcoservices
ID: 16647193
Thanks.  Perhaps this is a stupid question but what is a "kickstart file" and how do I add it?  It sounds liike this option is what we need since the installation is automatic.

0
 
LVL 88

Expert Comment

by:rindi
ID: 16647594
Get yourself a copy of knoppix, it has partimage on it already and is easy to use. The partition you want to create an image of shouldn't be mounted, and by using knoppix that would be ensured. If you have a CD or DVD writer and a CD or DVD drive inside the PC, you can write the files to an optical device using knoppix too.

http://knoppix.net
0
 

Author Comment

by:habcoservices
ID: 16647620
Thanks.  Ok ... let me make sure I have this correct ....

1.  I download a copy of Knoppix which includes partimage.
2.  I create a bootable CD Rom (with partimage on it?) that allows me to boot the Linux box without mounting the volume I want to copy (which is the only hard drive in the pc).
3.  I run partimage to copy the unmounted volume.

Is this correct?  And if so, where do I store the partimage copy if the only volume I have available isn't mounted?  Plus, what is the process for restoring?

Brad ....
0
 
LVL 88

Accepted Solution

by:
rindi earned 500 total points
ID: 16648308
No, you download knoppix and burn it to CD, it is already a bootable CD-Rom with a complete and running linux distro on it which amongst many other apps includes partimage. It is a liveCD so there is no need to install anything to HD.

Since your CD Drive is now used by the knoppix CD, you need an extra CD writer attached to the system, and then you can write the images that partimage creates directly to a CD, but you can also save those image files to a network share or another connected HD or empty partition.
0
 
LVL 14

Assisted Solution

by:cjl7
cjl7 earned 500 total points
ID: 16648786
Kickstart is the auto-response file to Red Hat (Fedora/CenOS) installer...

look in /root a file called anaconda-ks.cfg is your kickstart file for that system... (and a good starting point)

This is the original kickstart howto from Red Hat, it is a bit out-dated but still works... http://wwwcache.ja.net/dev/kickstart/KickStart-HOWTO.html

It will allow you to anwer all your questions that you would normally do in a GUI install.
It also allows you to run scripts in a %post section.

I have created an Oracle10g Express / CentOS DVD (bootable that installs CentOS + Oracle in one swoop)

I have an old howto I wrote when I worked at Red Hat, have a look at it. This might be a good solution for you...
(besides knowing howto use kickstart is a good career move... )

--- cut cut cut ---
##############################################################
#
# MiniHOWTO Creating custom RHEL3 bootable kickstart cd (dvd)
#
# Jonas Larson
#
# This is an "as is" document, use it if you want...
# (don't blame me if it doesn't work...
##############################################################

Step by step

1 get all the RPMS you want to use. (install a new system and copy the RPM
list and anaconda-ks.cfg from there)

2 create a build tree on your local filesystem (mkdir /var/tmp/i386)

3 cp the RHEL3 cd's (howto included in README on cd's, don't forget the .discinfo file, you'll need it!)

4 remove any RPM's you don't want from /var/tmp/i386/RedHat/RPMS

5 edit the anaconda-ks.cfg to fit your needs and put in on the isolinux
filesystem
      5.1 cp /var/tmp/i386/isolinux/initrd.img /var/tmp
      5.2 mv initrd.img initrd.img.gz; gunzip initrd.img.gz
      5.3 mount -o loop initrd.img /mnt/tmp
      5.4 cp anaconda-ks.cfg /mnt/tmp/ks.cfg
      5.5 umount /mnt/tmp; gzip /var/tmp/initrd.img
      5.6 mv /var/tmp/initrd.img /var/tmp/i386/isolinux
      5.7 edit the /var/tmp/i386/isolinux/isolinux.cfg and add
ks=file:/ks.cfg

6 run this script to generate new hdlist and order the RPM's (this assumes you have used /var/tmp/i386 as your base dir!)

---cut---
#!/bin/bash
export PYTHONPATH=/usr/lib/anaconda
export PATH=$PATH:/usr/lib/anaconda-runtime

# generate hdlist and order the RPMS
genhdlist --withnumbers /var/tmp/i386
pkgorder /var/tmp/i386 i386 > /var/tmp/pkgorder.txt
genhdlist --withnumbers --fileorder /var/tmp/pkgorder.txt /var/tmp/i386

# make iso (this makes only 1 cd/dvd)
cd /var/tmp/i386
mkisofs  -A "RHEL/3 i386 3AS" -V "RHEL/3 i386 3AS" -J -R -v -T -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /var/tmp/rhel3-custom.iso .
---end cut---

7 burn your new iso (/var/tmp/rhel3-custom.iso)
--- end cut --

//jonas
0
 

Author Comment

by:habcoservices
ID: 16649492
Thanks to both of you for your assistance.  I can see this is over-my-head for the time being given my rather narrow knowledge of Linux (limited mostly to Asterisk installations, DHCP and DNS servers). I need to spend more time getting a better understanding of Linux basics like I did a long time ago with DOS, Netware, OS2 and Windows.   I'll split the points between the two of you on this question.  In the meantime I have downloaded Knoppix 3.8 (yes, I see it it bootable) and am experimenting with it now to see if I can figure out how to clone hda1 and hda2 to one of my network computers.  One way or another I'll figure out.  Thanks again for your time and assistance.  Much appreciated.
0
 
LVL 88

Expert Comment

by:rindi
ID: 16649882
your welcome
0
 
LVL 14

Expert Comment

by:cjl7
ID: 16655690
dito.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Cron is one of the most popular and basic utilities found on Unix systems. Combined with other tools, cron makes it exceptionally easy to automate a broad range of tasks on your server.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses
Course of the Month7 days, 19 hours left to enroll

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question