Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-30-2004, 12:25 PM   #1
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Rep: Reputation: 30
Create an .iso image

How do I create an .iso image or any image from the OS I have. I have just installed a FreeBSD server and complied all the software from source, and as one can imagine, compling everything takes a long time. I want to create a snapshot image for the server because I want to install this exact same configuration on my other server. The reason I ask this here is because I have a Linux server I want to do the same thing for and I'd assume the procedures will be very similar. This way I can stick in the CD and have it install all the software configured the way I have it now on any other server I want to without having to go through the long process of comling everything from source again. Thanks in advance.
Old 06-30-2004, 01:24 PM   #2
Senior Member
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
Are you planning on creating a bootable cd, or just an archive of your compiled programs?

My suggestion would be to do a normal install fromthe fBSD discs, and create packages from your compiled programs.
Put those compiled programs on the disc and install them like normal.

You could make a snapshot of the entire system if you like as well, but I'd start from a fresh install and create a template like that.

man mkisofs

Old 06-30-2004, 03:40 PM   #3
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Using mkisofs will not keep permissions, so you may want to use tar. With tar, permissions are kept and you can make a fixed size.
Old 06-30-2004, 03:49 PM   #4
Registered: Jun 2004
Location: Baltimore, Maryland
Distribution: Fedora Core 2
Posts: 69

Rep: Reputation: 15
To create a bootable cd I use Nero Burning ROM, which I believe has a basic version for downloading. Simply go to compile new cd/image cd/ and select your file. You can also create one using, I believe, Kwrite in KDE. Right click on the iso and chose create with Kwrite
Old 06-30-2004, 05:03 PM   #5
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
If you want to create an image file of a partition, us the dd command, with the if= argument being the mounted device such as if=/dev/hda1 or even /dev/hda. You will need enough space on the output file-system to store it of course. Using an external usb drive would be handy for this. If you were copying the image to identical machines you could boot up to a rescue disk or a live distro and use the dd command the other way. You will need to give each machine unique host names and ip addresses if they are on a network.

If you have a large number of machines that you want to set up, check out the web site of the distro you are using. They have centralized installation methods that you could base your solution on.

You may want to look at the man page for the tar command. They have examples near the end of using the tar command to copy directories of infomation from one machine to another. If you pre-partition the target machines, you could boot them with a rescue disk or a live distro disk and use this method to populate the partitions you need to.

Last edited by jschiwal; 06-30-2004 at 05:07 PM.
Old 07-01-2004, 03:57 AM   #6
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Originally posted by Electro
Using mkisofs will not keep permissions, so you may want to use tar. With tar, permissions are kept and you can make a fixed size.
Electro, mkisofs will preserve file permissions if you use the -R flag. The following is from the mkisofs man page:
       mkisofs is capable of generating the  System  Use  Sharing
       Protocol records (SUSP) specified by the Rock Ridge Inter-
       change Protocol.  This is used  to  further  describe  the
       files  in  the iso9660 filesystem to a unix host, and pro-
       vides information such as longer filenames, uid/gid, posix
       permissions,  symbolic links, block and character devices.
       -R     Generate SUSP and RR records using the  Rock  Ridge
              protocol  to  further  describe  the  files  on the
              iso9660 filesystem.
That being said, I agree that tar would be a better solution.

bentman78, execute the following commands:

cd /
tar -cf filesystem.tar bin/ boot/ dev/ etc/ home/ lib/ mnt/ opt/ root/ sbin/ tmp/ usr/ var/
gzip filesystem.tar

Note that you don't include the /proc/ directory. You will now have a file called filesystem.tar.gz which you can burn to a CD just like any other file. Then you can boot your target machine with a rescue disk (I like Tom's root/boot); fdisk, format, and mount the target disk; mount your CD; copy, unzip, and untar the file system to the target disk. Now just chroot and run lilo, and your new system should be ready to boot.

Another (simpler) solution would be to physically install the drive from your target system into your existing system; fdisk, format, and mount it; then run the following commands:

cd /
cp -a bin boot dev etc home lib mnt opt root sbin tmp usr var /mnt/point/of/newdrive/

Then re-install the drive in your new system, boot with Tom's, then chroot and run lilo.

Though the second solution is simpler, the first will provide a nice portable, (semi-)permanent back-up of your shiny, new system. Personally, I don't trust CD-Rs to last, so I copied my latest LFS system to an old 2GB HDD as a back-up. The choice is yours.

--- Cerbere
Old 07-01-2004, 08:40 AM   #7
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212

Original Poster
Rep: Reputation: 30
Thank you everyone for your help. I think tar would be the best option since I want to retain file permissions. But will it keep my current file configurations as well, for example my httpd.conf file and all the modules I have compiled into apache?
Old 07-01-2004, 09:37 AM   #8
LQ Newbie
Registered: Jun 2004
Posts: 10

Rep: Reputation: 0
man mkisofs
Old 07-01-2004, 10:49 PM   #9
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799

Rep: Reputation: 33
Yes bentman78, tar will preserve all your files as well as their permissions/ownerships. This will include all your configuration files, so whatever settings you have for apache, etc. will be preserved.

It will create a file which contains all the files from your current system (which is why you don't want to include the /proc directory). This will be at least as big as the total size of all files on your system, so you want to be sure you have enough free space. Check this by running the 'df' command. You can compare the used space to the available space. This is also why you want to compress the tar file with the gzip command.

One other tip:
If you use Tom's root/boot to uncompress/extract your filesystem, you will have to do this in two steps:

gzip -d filesystem.tar.gz
tar -xvf filesystem.tar

because the 'tar' command on Tom's doesn't accept the 'z' option to unzip.

--- Cerbere
Old 07-02-2004, 05:22 AM   #10
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
For easy backing up parts (or all) of the system to CDR's I suggest you look into Mondo Rescue. There is a FreeBSD port available.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Splitting VOB to create DVD ISO image jerryk Linux - General 1 05-17-2005 12:31 AM
Create .iso image w/k3b joelescoulie Linux - Software 5 02-07-2005 01:26 PM
how to create an image *.iso without mkisofs and growisofs diegs Linux - Software 2 02-19-2004 03:31 AM
create your own ISO image files biotek1 Linux - General 4 10-27-2003 01:59 PM
unable to create a bootable cd from iso image abhijit Linux - Newbie 4 09-01-2003 04:16 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:41 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration