Computing.Net > Forums > Linux > how to use script to clone linux system

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to use script to clone linux system

Reply to Message Icon

Name: michael
Date: November 30, 2001 at 17:56:33 Pacific
Comment:

I want to clone redhat 6.0 linux system from main drive to backup drive, it can be done by following:

init 1
dd if=/dev/hda of=/dev/hdb
init 5

but if I write script to have it done automatically, it fails:
1)After run "init 1", system switchs to single user mode, unable to run "dd" command, have to manually
type second line "dd if=/dev/hda of=/dev/hdb", then after complete cloning hard drive, type "init 5" to resume
all services, switch back to Xwindow, how can I get rid of these manual work to have system done it automatically?

2)After init 1, the linux system quits Xwindow, shuts down the services and go to single user mode, I have web server running on this machine, is it possible to have web server still running while cloning
system?



Sponsored Link
Ads by Google

Response Number 1
Name: ronen
Date: December 1, 2001 at 10:32:06 Pacific
Reply:

hi
first y do u want 2 clone a partition?
if u want u can back up your materials...
second if u do it i can't beleave thet u can run your site simultaniusly.
ronen


0

Response Number 2
Name: ddddummy
Date: December 3, 2001 at 13:14:28 Pacific
Reply:

1) do you want to do backups that often that you cannot afford to type the three commands manually?
if so, i would suggest putting the dd into your bootup scripts, perhaps something like

mount / -o remount,ro
(and other mounts from /dev/hda)
dd if=/dev/hda of=/dev/hdb
mount / -o remount,rw

2) you will have to edit the runlevel init scripts and put the webserver init script also in runlevel 1, so it is not closed during the transition from 5.
but there will be more services to take care of, besides, the idea of runlevel 1 is *single* user mode; no networking, that is.

but as i think runlevel 1 was suggested so that probably no hdd writes would occur during backup, above mount cmds instead of the runlevel changes should also do the job.

as ronen said, it might make more sense to just backup your actual data regularly (using tar/gzip)



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: how to use script to clone linux system

How to use LILO to boot a CD-ROM? www.computing.net/answers/linux/how-to-use-lilo-to-boot-a-cdrom/2018.html

How to use CSCOPE on RedHat Linux 7 www.computing.net/answers/linux/how-to-use-cscope-on-redhat-linux-7/13324.html

I want to try Linux system www.computing.net/answers/linux/i-want-to-try-linux-system/19173.html