Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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 5but 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?

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

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 likemount / -o remount,ro
(and other mounts from /dev/hda)
dd if=/dev/hda of=/dev/hdb
mount / -o remount,rw2) 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)

![]() |
![]() |
![]() |

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