Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 136
  • Last Modified:

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.
0
NetRock6
Asked:
NetRock6
  • 4
  • 3
  • 2
1 Solution
 
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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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
 
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

Featured Post

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now