addendum to SUMMARY: copying a system disk to a new one

From: Howard Schultens (hs@demeter.ukps.gwdg.de)
Date: Thu Sep 24 1992 - 15:14:24 CDT


After posting my summary, I received some further messages that were so
useful I want to send out this addendum:

Jaques Beigbeder (Jacques.Beigbeder@ens.ens.fr) pointed out that the
dump/restore method also reduces any coredump files to their minimum
size.

Shelley Shostak (sls@cs.duke.edu) noted that one should use the "rf" options
for restore rather than "xf", and that using tar (in a pipeline) would require
one to rebuild /dev entries.

The commands I actually used to copy the disk was

        dump 0f - / | (cd /mnt; restore rf -)

/mnt is the mount point where the new partition is mounted. This worked
perfectly. Then one has to copy the boot blocks. There was a problem with
the command I passd on: Chris Schanzle (chris@speckle.ncsl.nist.gov) informed
me that

        installboot -vlt /mnt/boot bootsd /dev/rsd1a

does NOT copy the bootblocks, it is only a test! He writes:

:Interesting that two people made the same error. With the "t" option
:installboot doesn't actually update the boot blocks. Very
:inconvenient to then reload miniroot...
:
:I've done this mistake more than once since you usually aren't thinking
:real clearly at that phase and don't read the man page carefully enough.
:The "-vlt" example is in the man pages in the EXAMPLE section, but it
:doesn't comment that it doesn't REALLY update the boot blocks!

I thanked him for this information, and he sent some more tips on increasing
the performance of the new disk:

:You're quite welcome. here's another bit of information: when
:newfs'ing the new disk, increase the number of bytes per inode from 2K
:(default) to something like 8192 or 10240. This can give you several
:to many more Mb of storage space. E.g.,
:
: % newfs -i 10240 /dev/rsd0c
:
:or even 10240. But don't do this to the root partition, as /dev takes
:up lots of inodes when compared to most other file systems.
:
:speckle:~: df -t 4.2
:Filesystem kbytes used avail capacity Mounted on
:/dev/sd0a 7735 5314 1648 76% /
:/dev/sd0g 143965 101176 28393 78% /usr
:/dev/sd0h 7255 2680 3850 41% /var
:/dev/sd2d 960124 487072 377040 56% /usr/local
:/dev/sd1c 2031472 1374242 454083 75% /v
:/dev/sd3c 1007449 842633 114444 88% /u
:speckle:~: df -t 4.2 -i
:Filesystem iused ifree %iused Mounted on
:/dev/sd0a 933 3931 19% /
:/dev/sd0g 10953 62007 15% /usr
:/dev/sd0h 231 3417 6% /var
:/dev/sd2d 15245 80435 16% /usr/local
:/dev/sd1c 15756 84084 16% /v
:/dev/sd3c 18419 81421 18% /u
:
:I am certain /usr/local, /u, and /v are newfs-ed with at least 8K and
:we're not even close to running out of inodes. On the big file systems
:the difference is in the 10's of Mb.
:
:Besides, even if you do eventually run out of inodes, it's a good excuse
:to defragment the disk with the backup/newfs/restore scenario!
:
:Ah, and one more thing. Tunefs that puppy! Significant increase in
:performance if you set maxcontig (-a) to 15, -d 0, -e 16777216 (2^24)
:or something else BIG. See tunefs(8) for details.

I did these suggestions, and the system is noticeably faster than with the
old disk, but this might be in part due to the disk itself.

Tony Tran (tonytran@leland.stanford.edu) and Ted Rodriguez-Bell
(ted@ssl.Berkeley.EDU) both gave a FAST method to copy to a new disk when
the new one has the same size and geometry as the old one. Here is Tony's
version:

:If these 2 disks are the same, the following will work much faster:
:
:1. shutdown the system to single user mode
:2. get into format to partition the 2nd disk the same as the first system disk
:3. and do the following:
: # dd if=/dev/sd0a of=/dev/sd1a bs=10k
: # dd if=/dev/sd0g of=/dev/sd1g bs=10k
: This took about 2 minutes on a 207 MB disk
:4. Make sure to mount the 2nd disk and change the fstab
: and make appropriate change to the eeprom if necessary.
:
: You do not need to "installboot" (like in dump) and
: this method is many times faster than using dump
:

Finally, Dan Kelley (dank@teleng.telxon.com) recently posted a summary telling
how to do the whole thing for NFS filesystems, ie. to do this all over
ethernet.

Thanks again to all who replied.

--------------------------------------------------------------------------------
\ ..\ /../ Howard Schultens Tel: ++49 551 39 5914
 \.o.\ /../ Zentrum Physiologie FAX: ++49 551 39 5923
  \o.o> /: / Abteilung Neuro- und
   \o/ / \ Sinnesphysiologie E-Mail: hs@demeter.ukps.gwdg.de
    Y R .oo \ Humboldtallee 23
     / o o.o \ D-3400 Goettingen
    <_*o*_*.*_> Germany
--===r=R=r=Rr===----------------------------------------------------------------



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:50 CDT