LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-02-2007, 05:11 PM   #1
gochita
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Rep: Reputation: 0
Lightbulb How to overwrite a complete File system?


Hi there:

I have a compressed File System in "file.tgz", and I need to install a new machine with the same FS. But, if I install Linux OS and then copy the FS on top of the OS it won't work, Any ideas? help? Please

Thanks
 
Old 02-02-2007, 05:23 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
What problems in details is happening?
What did you make into the tgz file? The entire running distro or copied the contents from a non running system. Meaning you booted up with a floppy or cd and made the file.

Brian
 
Old 02-02-2007, 05:42 PM   #3
gochita
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Unhappy

I need to put the same File system that the file.tgz has in a new box, so both machine can have the same configuration and info.

???
 
Old 02-02-2007, 05:43 PM   #4
gochita
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Unhappy

I didn't make the image, but I need to use it for the new mahcine.

Thanks!
 
Old 02-02-2007, 05:51 PM   #5
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
Does the partition tables match on both machines?
Are both the same distro setup? May not matter if restoring an entire system.
I would boot up with a live CD or floppy and mount the partitions and restore the data that way.

Brian
 
Old 02-02-2007, 06:09 PM   #6
gochita
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Unhappy

Thanks Brian for your help!!! I am kind of new here!!

The machines have different partitions, so I do not know how I can boot the machine if I copy the new FS on top of Linux. I guess I have to modify menu.lst, but I guess that is not enough.

???
 
Old 02-02-2007, 06:15 PM   #7
gochita
LQ Newbie
 
Registered: Feb 2007
Posts: 5

Original Poster
Rep: Reputation: 0
Lightbulb

The new machine has RHEL3 U8 and the other one has RHEL3 U6
 
Old 02-02-2007, 06:37 PM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Assuming the tgz is a tarball of the file system (and a entire OS), and not a compressed file system image, here is what to do:

First, use a livecd to boot the machine you want to install this on. Next, format the hard drive and create all the file systems you want. Now, mount all file systems, this includes any file systems like /var /home, or whatever other sub-file systems you created (note: this requires first mounting the root file system you made, then creating the necessary directories, then mounting the sub-files systems on top of those). Now, use the livecd to copy over the file.tgz you have. This should contain all the OS things, make sure your mounted file systems within the root file system line up to the same directory structure as the OS your about to install. Now, simply unpack the tgz on the root file system you created and mounted. Assuming all went well, you now have installed a OS, but its not usable. Chroot over to your mounted root file system, you need to create the bootloader so the OS boots up. assuming you have lilo installed, and that the OS just just installed already configured the /etc/lilo.conf (check it, to make sure it is configured for your machine), simply run lilo so that it installs the bootloader in the boot sector on your hard drive. If you use grub, i have no idea what to do, but whatever bootloader you have, make sure you configure and install it so that you can boot the OS. Next, edit /etc/fstab to match the file system structure you created. Change the root password, add any new users and set their passwords. And that should be about it, unless i forgot something... oh, make sure to configure the init scripts for your OS, so that it will start whatever services you want. Once your all done, unmount everything (so you dont wreck the file systems) then restart the computer and try to boot into your new OS.
 
Old 02-02-2007, 06:56 PM   #9
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
edit:
What I wrote is pretty much the same as SciYo posted. Was working on this as it was posted.
edit:

I think I see where you are going. You can pull the /etc/fstab file from the tgz file to see what partitions were mounted.

Now you can create ones in similiar size needed but you may not know them.

Do both systems have the same hardware like using same IDE drives or both using sata drives. Both using same type of controller for sata, ide, scsi.
If hardware differs and kudzu is active then it may correct the /etc/modprobe.conf file on the restored system.

So many unknown variables from the info I see.

If both systems use the same hardware overall. Then I would have to try this way without knowing previous system settings.
I would boot up with a live CD like knoppix or kubuntu.
Next both all partitions on the new system.
Now create a small partition say 100meg and use it for /boot.
Then create a second one and use the rest as /.
Format them to ext3.
Mount both partitions like /boot1 and /rootdrive
Then restore the portion of the tgz file for /boot to the new /boot1 partition.
Then restore the rest of the tgz excluding the /boot directory to /rootdrive.
Go into /rootdrive and edit /rootdrive/etc/fstab and correct the file to correct mount points.
Then same for /rootdrive/boot1/grub/grub.conf and make sure it is pointing to the correct partition.
Unmount partitions.
Boot up with the RHEL install cd and type ' linux rescue '.
Let it chroot the system files and run the command grub-install to install grub to mbr.

Brian

Last edited by Brian1; 02-02-2007 at 06:58 PM.
 
  


Reply


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make complete image file from partition file for qemu lbdgwgt Linux - Newbie 2 11-16-2006 08:04 AM
Complete system freeze SilverEagle Linux - Software 8 07-17-2006 02:44 PM
can we overwrite the permissions of folder/file zameer_india Linux - Networking 0 09-30-2004 01:11 AM
Overwrite or unistall linux on a dual boot system. PsychoQc Linux - Newbie 2 07-08-2004 10:00 PM
Proftpd file overwrite problem NetScripter Linux - Software 6 10-14-2003 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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