Restore FC

I have a Fedora 18 customized  image which I have selected specific packages. I need to deploy ( basically restore) this image on the different PCs which have customized partition table lay out then the original hard disk I have made my image on.
Ex.: base image made on hard drive which has the following layout:
/boot partition sdc1,
swap sdc2,
/ sdc3

And for example the destination Pc might has:
  /boot partition sda1,
/  sda2, ( root on sda2)
Swap  /sdc3

To get fedora working error free after restore on the destination PC I need to change fstab , grub2.conf files manually.....etc
Are there more files need to be changed and is there a way to automate (using bash script) this process, I am looking for a fast effective solution.
Thanks for your help.
NetRock6Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

farzanjCommented:
If in your /etc/fstab, you use the good practice of mounting by labels or ids, you don't even have to change your /etc/fstab.

You can simply use rsync to copy files from one system to another over the network.  Another way is to use tar.  In either method make sure to preserve the permissions, etc.

Like
rsync -avz /source/partition IP:/source/partition

tar Ppcvfz tar_name.tgz /source/partition
0
ThomasMcA2Commented:
You will also need to change the computer names (in /etc/hostname), and perhaps IP addresses if you don't use DHCP.
0
farzanjCommented:
In Fedora or Redhat family in general, there is no file /etc/hostname.  Yes, you will may need changes in /etc/hosts, and/or /etc/sysconfig/network.  This is for hostname.  I was assuming that the hostname and ip addresses would be new in the new system.  But if you need to change, you can do it.  Likewise you may need to copy all user accounts and/or user id's in the new system.  Take a look at /etc/passwd and /etc/shadow and /etc/group
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

ThomasMcA2Commented:
Oops, I stand corrected. My notes about that process were from my Ubuntu days. Sorry about the confusion. It does still need to be changed, but I was mistaken about where to make the change.
0
NetRock6Author Commented:
Hi , thank you for your comments
Mounting by ids sounds interesting, so how can I change a partition's UUID using bash script. In another words, using bash script first inquire UUID of let's say /dev/sdc1 and then if is not equal to the desired value and change it for each partition.  

I guess I must start with

blkid to get UUID and then use a "if" to see already inquired UUID is different and then
Use tune2fs /dev/sdc1 -U `uuid` to change it….
Anyone knows a better way or ready script to do this.

Thanks
0
farzanjCommented:
Lets make it simpler than that.  Just use label.  Use e2label command to set labels when you first install machines.  Say label of / will be / and label of /boot will be /boot.  So if /boot is /dev/sda1, then at install time you would issue command like

e2label /dev/sda1 /boot

And /etc/fstab will have like

LABEL=/boot   /boot   ...

So, it will always stay the same in fstab.
0
NetRock6Author Commented:
Hi,
Just want to know if I have already install FC and issue a e2label, do I have to change anything else like fstab...
Thanks
0
farzanjCommented:
So you know you have labels set correctly for each partition device?  If not make sure by issuing command
e2label /dev/sda1

If you don't give a second parameter, it shows you the current value.

Once that is done, as I said earlier, your fstab has to be set to use LABEL instead of actual device id.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NetRock6Author Commented:
I run into issue where the destination PC has gpt partition table and the source FC18 is installed on msdos partition table. I did use dd command to backup bootloader and got image from sdc1 (boot) and sdc2 (root). Next, I restored the bootloader , sdc1 and sdc2 on the destination PC and reboot. After pc boots and I ended up with a black screen that is only says Grub.
What can I do to get the FC18 loads on the destination PC with gpt partition while FC18 the source image installed on msdos partition.  
Thanks for your help
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.