Solved

Restore FC

Posted on 2013-01-23
9
128 Views
Last Modified: 2013-01-30
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.
0
Comment
Question by:NetRock6
  • 4
  • 3
  • 2
9 Comments
 
LVL 31

Expert Comment

by:farzanj
ID: 38811025
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
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 38811088
You will also need to change the computer names (in /etc/hostname), and perhaps IP addresses if you don't use DHCP.
0
 
LVL 31

Expert Comment

by:farzanj
ID: 38811152
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
 
LVL 14

Expert Comment

by:ThomasMcA2
ID: 38811264
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:NetRock6
ID: 38820178
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
 
LVL 31

Expert Comment

by:farzanj
ID: 38821094
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
 

Author Comment

by:NetRock6
ID: 38821252
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
 
LVL 31

Accepted Solution

by:
farzanj earned 500 total points
ID: 38822183
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
 

Author Comment

by:NetRock6
ID: 38828589
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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

747 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now