Solved

Restore FC

Posted on 2013-01-23
9
129 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
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 …

930 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

9 Experts available now in Live!

Get 1:1 Help Now