rsync procedural thing - OT?
Hello SuSE people, I know this has been discussed a thousand times already, and I have reviewed 60+ archived email messages, and looked at the man page a couple of times about this subject/procedure. I am still unsure. Here is my situation. Added a brand new 40 gig hard drive to the system. Plan to only format it to ext3 using Yast. Now I want to copy my entire SuSE 9.2 which is all on one partition with the exception of /swap, is presently on hda2, over to the new drive and let it reside there as an operating OS. The procedure would be to open a console as root, and then issue an rsync ( + unknown options) / /dev/hdb command, and if this is correct, which I really don't think it is, and then after copying cd into /etc/fstab and edit the / partition and the /swap partition. Then cd into /boot/grub/Menu1st and edit that also to make it bootable. Then what about /proc ? Does that get copied over? and should it be? I am only a basic CLI guy. If anyone has any better solutions I would like to hear them. Bob S
On Mon, 6 Feb 2006 03:59 pm, Bob S wrote:
Added a brand new 40 gig hard drive to the system. Plan to only format it to ext3 using Yast.
Now I want to copy my entire SuSE 9.2 which is all on one partition with the exception of /swap, is presently on hda2, over to the new drive and let it reside there as an operating OS.
Get both disks mounted up, say the new one is mounted onto /target root> rsync -aHWv --delete --exclude '/target' \ --exclude-from exclude-list /source/ /target/ where `cat exclude-list` is: # file to control the rsync copy onto a new machine # Just the top level home directory to NFS mount onto + /home/ - /home/* # just the mount points + /media/ + /media/cdrom/ - /media/cdrom/* + /media/floppy/ - /media/floppy/* - /media/* # just mount points + /mnt/ - /mnt/* + /proc/ - /proc/* + /tmp/ - /tmp/*
The procedure would be to open a console as root, and then issue an rsync ( + unknown options) / /dev/hdb command,
No, mount the disk and copy into the mounted filesystem, copying /dev/hda /dev/hdb is only for cloning disks onto identical or bigger disks. It copies the partition table as well.
cd into /etc/fstab and edit the / partition and the /swap partition. Get /right, comment swap out.
Set the new disk as the boot disk in BIOS, or change the jumbering so it's /dev/hda Boot of a CD and ask for "Boot installed system" point it at your new root partition. You should get it up in the new system. Re-install GRUB adding a generic master boot record.
Then cd into /boot/grub/Menu1st and edit that also to make it bootable.
You'll probably need to re-install GRUB adding a generic master boot record to get the new disk bootable.
Then what about /proc ? Does that get copied over? and should it be? Just the mount point, it's generated during boot. See exclude-list for other clues.
Hope this helps, michaelj -- Michael James michael.james@csiro.au System Administrator voice: 02 6246 5040 CSIRO Bioinformatics Facility fax: 02 6246 5166 No matter how much you pay for software, you always get less than you hoped. Unless you pay nothing, then you get more.
Bob S wrote:
Here is my situation. Added a brand new 40 gig hard drive to the system. Plan to only format it to ext3 using Yast. Now I want to copy my entire SuSE 9.2 which is all on one partition with the exception of /swap, is presently on hda2, over to the new drive and let it reside there as an operating OS.
Boot up Knoppix or a SUSE rescue system. create two mountpoints, say /old and /new. mount /dev/hda1 /old (assuming hda is your old disk) mount /dev/hdb1 /new (assuming hdb is your new disk) rsync -aHWvx /old/* /new chroot /new Edit /etc/fstab and correct drive-letters, edit bootloader config and correct drive-letters, then run grub/lilo to update bootloader. If you swap the disks such that new becomes hda and old becomes hdb, you can skip the editing, but you still need to update the bootloader. Don't forget to chroot.
and edit the / partition and the /swap partition.
If you create a new swap partition, don't forget to mkswap.
Then what about /proc ? Does that get copied over? and should it be?
/proc should be copied, but nothing underneath it. It's only a mount point. /Per Jessen, Zürich -- http://www.spamchek.com/ - managed anti-spam and anti-virus solution. Let us analyse your spam- and virus-threat - up to 2 months for free.
On Sun, 2006-02-05 at 23:59 -0500, Bob S wrote:
Hello SuSE people,
I know this has been discussed a thousand times already, and I have reviewed 60+ archived email messages, and looked at the man page a couple of times about this subject/procedure. I am still unsure.
Here is my situation. Added a brand new 40 gig hard drive to the system. Plan to only format it to ext3 using Yast. Now I want to copy my entire SuSE 9.2 which is all on one partition with the exception of /swap, is presently on hda2, over to the new drive and let it reside there as an operating OS.
The procedure would be to open a console as root, and then issue an rsync ( + unknown options) / /dev/hdb command, and if this is correct, which I really don't think it is, and then after copying cd into /etc/fstab and edit the / partition and the /swap partition. Then cd into /boot/grub/Menu1st and edit that also to make it bootable.
Then what about /proc ? Does that get copied over? and should it be?
I am only a basic CLI guy.
If anyone has any better solutions I would like to hear them.
A better procedure would be to: 1. boot the a rescue system using either the install CD or DVD 2. create two mount points mkdir /old mkdir /new 3. mount old root and new root mount /dev/hda2 /old mount /dev/hdb2 /new 4. copy the data from the old disk to the new disk rsync -varpltz /old/ /new/ should do the trick. You always want to copy your system in quite mode (not running) which is what booting to the rescue CD/DVD does. This also takes care of the /proc problem as it should not be copied, only the directory created. /proc is dynamic and should be empty on a system that is not running. You can check this by looking at /old/proc when booted in rescue mode, the only thing on my laptop is proc/bus/usb which is empty. Start up rsync let it copy a few files and stop it and check /new that files/dirs are being created as you expect them to be. If they are then vi /new/etc/fstab and make any necessary changes. The last thing needed is to modify grub on the bootable first disk to add the new disk as a boot option. Also when creating partitions on the new disk create a swap partition just in case the old disk gets completely trashed. Hope this helps. If you have problems let us know what you were doing when the problem occurred, and be very precise with all of the steps/syntax used. -- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998
On Monday 06 February 2006 08:23, Ken Schneider wrote:
On Sun, 2006-02-05 at 23:59 -0500, Bob S wrote:
Hello SuSE people .....................<snip some>.................................. Then what about /proc ? Does that get copied over? and should it be?
I am only a basic CLI guy.
If anyone has any better solutions I would like to hear them.
A better procedure would be to:
1. boot the a rescue system using either the install CD or DVD 2. create two mount points mkdir /old mkdir /new
Hello Ken, thanks for replying. For my understanding, Please excuse my ignorance. These are not "real" directories, right ? They are in ram disk or something and go away when you close down the system?
3. mount old root and new root mount /dev/hda2 /old mount /dev/hdb2 /new
OK, won't need a password for that right?
4. copy the data from the old disk to the new disk rsync -varpltz /old/ /new/
should do the trick. You always want to copy your system in quite mode (not running) which is what booting to the rescue CD/DVD does. This also takes care of the /proc problem as it should not be copied, only the directory created. /proc is dynamic and should be empty on a system that is not running. You can check this by looking at /old/proc when booted in rescue mode, the only thing on my laptop is proc/bus/usb which is empty. Start up rsync let it copy a few files and stop it and check /new that files/dirs are being created as you expect them to be.
OK, how do I stop and restart rsync, and will it pick up where it left off?, and how would I look at what is there?
If they are then vi /new/etc/fstab and make any necessary changes. The last thing needed is to modify grub on the bootable first disk to add the new disk as a boot option. Also when creating partitions on the new disk create a swap partition just in case the old disk gets completely trashed.
Re: the /swap partition which on the old disk is hda3, should I create it when I format the new hard drive?, before I rsync everything over to the drive? I stated in my message that I was going to format the new drive only, no partitions, rsync doesn't create a real partition right?
Hope this helps. If you have problems let us know what you were doing when the problem occurred, and be very precise with all of the steps/syntax used.
Yes it helps. Sounds a lot less complicated. Bob S.
On Mon, 2006-02-06 at 23:43 -0500, Bob S wrote:
On Monday 06 February 2006 08:23, Ken Schneider wrote:
On Sun, 2006-02-05 at 23:59 -0500, Bob S wrote:
Hello SuSE people .....................<snip some>.................................. Then what about /proc ? Does that get copied over? and should it be?
I am only a basic CLI guy.
If anyone has any better solutions I would like to hear them.
A better procedure would be to:
1. boot the a rescue system using either the install CD or DVD 2. create two mount points mkdir /old mkdir /new
Hello Ken, thanks for replying. For my understanding, Please excuse my ignorance. These are not "real" directories, right ? They are in ram disk or something and go away when you close down the system?
They are real directories created on the ram disk and yes they will disappear after a reboot.
3. mount old root and new root mount /dev/hda2 /old mount /dev/hdb2 /new
OK, won't need a password for that right?
No, just type root as the user name at the login prompt.
4. copy the data from the old disk to the new disk rsync -varpltz /old/* /new/
should do the trick. You always want to copy your system in quite mode (not running) which is what booting to the rescue CD/DVD does. This also takes care of the /proc problem as it should not be copied, only the directory created. /proc is dynamic and should be empty on a system that is not running. You can check this by looking at /old/proc when booted in rescue mode, the only thing on my laptop is proc/bus/usb which is empty. Start up rsync let it copy a few files and stop it and check /new that files/dirs are being created as you expect them to be.
OK, how do I stop and restart rsync, and will it pick up where it left off?, and how would I look at what is there?
ctrl-c will stop the process. Look at what is there they same way you look at any files in a file system. And yes it will pick up where it left off.
If they are then vi /new/etc/fstab and make any necessary changes. The last thing needed is to modify grub on the bootable first disk to add the new disk as a boot option. Also when creating partitions on the new disk create a swap partition just in case the old disk gets completely trashed.
Re: the /swap partition which on the old disk is hda3, should I create it when I format the new hard drive?,
Well you have to create the partitions first anyway so yes.
before I rsync everything over to the drive? I stated in my message that I was going to format the new drive only, no partitions, rsync doesn't create a real partition right?
If you are going to store data on a filesystem on a disk you need to create as least one partition which is actually what is formatted. Why not make it two and have a swap partition as well.
Hope this helps. If you have problems let us know what you were doing when the problem occurred, and be very precise with all of the steps/syntax used.
Yes it helps. Sounds a lot less complicated.
-- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998
Bob, On Sunday 05 February 2006 20:59, Bob S wrote:
Hello SuSE people,
...
Then what about /proc ? Does that get copied over? and should it be?
I guess this hasn't been answered yet. No. That directory does not exist. It is a figment produced by the kernel. Just make the directory but by no means should you try to copy any of the contents of the /proc as it exists at the time you make the copy.
I am only a basic CLI guy.
Hurrah!
If anyone has any better solutions I would like to hear them.
Bob S
Randall Schulz
participants (5)
-
Bob S
-
Ken Schneider
-
Michael James
-
Per Jessen
-
Randall R Schulz