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. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
06-30-2004, 12:25 PM
|
#1
|
Member
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212
Rep:
|
Create an .iso image
Hello,
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.
|
|
|
06-30-2004, 01:24 PM
|
#2
|
Senior Member
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Rep:
|
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
--Shade
|
|
|
06-30-2004, 03:40 PM
|
#3
|
LQ Guru
Registered: Jan 2002
Posts: 6,042
Rep:
|
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.
|
|
|
06-30-2004, 03:49 PM
|
#4
|
Member
Registered: Jun 2004
Location: Baltimore, Maryland
Distribution: Fedora Core 2
Posts: 69
Rep:
|
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
|
|
|
06-30-2004, 05:03 PM
|
#5
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
07-01-2004, 03:57 AM
|
#6
|
Member
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799
Rep:
|
Quote:
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:
Code:
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.
Code:
-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.
Enjoy!
--- Cerbere
|
|
|
07-01-2004, 08:40 AM
|
#7
|
Member
Registered: Mar 2003
Location: Washington DC, USA
Distribution: Redhat
Posts: 212
Original Poster
Rep:
|
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?
|
|
|
07-01-2004, 09:37 AM
|
#8
|
LQ Newbie
Registered: Jun 2004
Posts: 10
Rep:
|
man mkisofs
|
|
|
07-01-2004, 10:49 PM
|
#9
|
Member
Registered: Dec 2002
Location: California
Distribution: Slackware & LFS
Posts: 799
Rep:
|
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.
Enjoy!
--- Cerbere
|
|
|
07-02-2004, 05:22 AM
|
#10
|
Senior Member
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032
Rep:
|
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.
Håkan
|
|
|
All times are GMT -5. The time now is 03:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|