Summary of procedures to move boot disks

From: Marty Leisner 311/? x? (leisner@eso.mc.xerox.com)
Date: Fri Jun 19 1992 - 04:51:06 CDT


I never had to move my boot disk, but there are a number of useful responses enclosed here.

Basically, I adopted the attitude if you don't absolutely have to, don't (there are many things to break...)

One of the most useful things I never thought of was piping dump into restore (I guess this
also is a defragmenter ;-)) Many people have asked "why is there no defragmenter on Unix?

Thanks to:
mattson@cs.ucsd:edu
labute@galois.math.mcgill:ca
jjb@pandora.cs.wayne:edu
kalli!kevin@fourx.aus.sun:com:
blymn@baobab.awadi.com:au
miker@sbcoc:com:
Eckhard.Rueggeberg@ts.go.dlr.de
aadne@tss.no.
heiser@sud509.ed.ray.com
fallan@awadi.com.au
Perry Hutchison:Portland
 mp@allegra.att
etnibsd!vsh@uunet.uu
paulo@dcc.unicamp.br
matt@wbst845e.xerox:com:

Here's the replies: (forgive the email address -- I'm reading it through the XNS mail system)

::::::::::::::
moving-disks/1
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA08134; Sun, 31 May 92 20:02:14 EDT
Date: Sun, 31 May 92 20:02:14 EDT
Message-Id: <9206010002.AA08134@vangogh.wbst147.xerox.com>
Postmark: Sat May 30 17:34:44 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: sun-managers-relay@ra.mcs.anl:gov:Xerox
Reply-To: leisner:HENR801c:Xerox
From: leisner@eso.mc.xerox:com:Xerox
To: sun-managers@eecs.nwu:edu:Xerox
Subject: Moving system to another disk on a machine (and removing the disk)

I have a sparcstation 2 where the internal disk is going onto another machine.

I have a 1.3G disk on this machine, what I want to do:
move the system to the 1.3G disk, boot off this disk with a minimum of
work.

The disk is now in 2 large partitions --
what I want to do is leave 1 partition alone, a break up
the other partition to
/
swap
/usr
and everything else goes into another partition.

I suppose what I need to do is:
1) back up everything I'll blow away on tape
2) repartition the disk (not touching the good partition)
3) run newfs on the new partition
4) copy the system to the new partitions
[Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]
5) change fstab to know about the new system
6) change the rom to boot off the new device (after I try it out manually).
7) Copy the save stuff from tape (if it fits)

Anything I forgot about?

Does dd work copying files sytems?? What about running newfs??

How straightforward is changing the boot device in the rom?

Marty leisner.henr801c@xerox.com
                    leisner@eso.mc.xerox.com
           Member of the League for Programming Freedom
::::::::::::::
moving-disks/2
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA08144; Sun, 31 May 92 20:02:19 EDT
Date: Sun, 31 May 92 20:02:19 EDT
Message-Id: <9206010002.AA08144@vangogh.wbst147.xerox.com>
Postmark: Sat May 30 23:10:31 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: mattson@cs.ucsd:edu:Xerox
From: mattson@cs.ucsd:edu:Xerox
To: leisner:HENR801c:Xerox
Inreplyto: Marty Leisner 311/? x?'s message from 2:34 PM PDT:
Subject: Re: Moving system to another disk on a machine (and removing the disk)

I hope that the partition you want to leave alone is towards the end of
the
disk and the partition you are going to break up into pieces is towards
the
beginning. This is because you'll want to use the 'a' partition to boot
and
the 'b' partation for swap. Because of the way the boot block gets
installed, I'm pretty sure the 'a' partition has to start at cylinder 0
if
you want to be able to boot off of it. If the partition you want to save
is
at the beginning of the disk, you may have to just back everything up and
repartition the whole thing.

When running newfs, you may want to specify a different value for the number
of bytes of data per inode. The default is 2k, but we usually use 4k on
root file systems and 8k on /usr and user file systems. Your mileage may
vary. Use the '-i' option to newfs for this.

You can't use dd to copy file systems which are not the same geometry.
(That is, dd will only copy file systems where the source and destination
are the same number of cylinders, same number of sectors per cylinder on
the
disk, etc.) Instead, you'll want to use dump | restore, as follows:

        newfs -i 4096 /dev/rsd1a (assuming this is your new root partition).
        mount /dev/sd1a /mnt
        cd /mnt
        dump 0f - / | restore rf -
        rm restoresymtable

Remember to fix the boot block on the new root partition. Assuming you
are
still in /mnt after the above steps,

        /usr/kvm/mdec/installboot -v boot /usr/kvm/mdec/bootsd /dev/rsd1a

Since you're losing the internal disk, why not change the unit number on
the
external disk to 3 (the unit number that corresponds to sd0)? That way,
you
don't have to change the boot device in the eeprom at all. You probably
will have some fstab changes to make either way.

--jim
--------
In reply to the following message:
--------
I have a sparcstation 2 where the internal disk is going onto another machine.

I have a 1.3G disk on this machine, what I want to do:
move the system to the 1.3G disk, boot off this disk with a minimum of
work.

The disk is now in 2 large partitions --
what I want to do is leave 1 partition alone, a break up
the other partition to
/
swap
/usr
and everything else goes into another partition.

I suppose what I need to do is:
1) back up everything I'll blow away on tape
2) repartition the disk (not touching the good partition)
3) run newfs on the new partition
4) copy the system to the new partitions
[Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]
5) change fstab to know about the new system
6) change the rom to boot off the new device (after I try it out manually).
7) Copy the save stuff from tape (if it fits)

Anything I forgot about?

Does dd work copying files sytems?? What about running newfs??

How straightforward is changing the boot device in the rom?

Marty leisner.henr801c@xerox.com
                    leisner@eso.mc.xerox.com
           Member of the League for Programming Freedom
--------
::::::::::::::
moving-disks/3
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA01297; Mon, 1 Jun 92 13:10:46 EDT
Date: Mon, 1 Jun 92 13:10:46 EDT
Message-Id: <9206011710.AA01297@vangogh.wbst147.xerox.com>
Postmark: Sun May 31 11:05:23 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: labute@galois.math.mcgill:ca:Xerox
From: labute@galois.math.mcgill:ca:Xerox
To: leisner:HENR801c:Xerox
Subject: Re: Moving system to another disk on a machine (and removing the disk)

You will also have to install the new bootblocks (see manpage for installboot).
A much better way to transfer the system to the new partition is to do
a
dump-restore pipeline (consult the manpages for restore under 'f dump-file'.
-John Labute
::::::::::::::
moving-disks/4
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA01232; Mon, 1 Jun 92 13:10:06 EDT
Date: Mon, 1 Jun 92 13:10:06 EDT
Message-Id: <9206011710.AA01232@vangogh.wbst147.xerox.com>
Postmark: Sun May 31 11:48:57 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: jjb@pandora.cs.wayne:edu:Xerox
From: jjb@pandora.cs.wayne:edu:Xerox
To: leisner:HENR801c:Xerox
Inreplyto: <9205302134.AA07898@louvre.wbst147.xerox.com>; from "Marty Leisner 311/? x?" at May 30, 92 2:34 pm
Subject: Re: Moving system to another disk on a machine (and removing the disk)

>
> I have a sparcstation 2 where the internal disk is going onto another
machine.
>
> I have a 1.3G disk on this machine, what I want to do:
> move the system to the 1.3G disk, boot off this disk with a minimum of
work.
>
> The disk is now in 2 large partitions --
> what I want to do is leave 1 partition alone, a break up
> the other partition to
> /
> swap
> /usr
> and everything else goes into another partition.
>
> I suppose what I need to do is:
> 1) back up everything I'll blow away on tape
> 2) repartition the disk (not touching the good partition)
> 3) run newfs on the new partition
> 4) copy the system to the new partitions
> [Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]
> 5) change fstab to know about the new system
> 6) change the rom to boot off the new device (after I try it out manually).
> 7) Copy the save stuff from tape (if it fits)
>
> Anything I forgot about?
>
> Does dd work copying files sytems?? What about running newfs??
>
> How straightforward is changing the boot device in the rom?
>
> Marty leisner.henr801c@xerox.com
> leisner@eso.mc.xerox.com
> Member of the League for Programming Freedom
>

Looks about right. Changing the ROM is fairly simple -- you need to change
the boot-from parameter, either from the "new" monitor mode with setenv,
or via the eeprom command. I've never tried using dd(1) to copy filesystems.
I have used dump(8) piped into restore(8). There is an example on the
restore man page:

RESTORE(8) MAINTENANCE COMMANDS RESTORE(8)

     f dump-file
          Use dump-file instead of /dev/rmt? as the file to
          restore from. If dump-file is specified as `-',
          restore reads from the standard input. This allows,
          dump(8) and restore to be used in a pipeline to dump
          and restore a file system:

          example# dump 0f - /dev/rxy0g | (cd /mnt; restore xf
          -)

          If the name of the file is of the form machine:device
          the restore is done from the specified machine over the
          network using rmt(8C). Since restore is normally run
          by root, the name of the local machine must appear in
          the .rhosts file of the remote machine. If the file is
          specified as user@machine:device, restore will attempt
          to execute as the specified user on the remote machine.
          The specified user must have a .rhosts file on the
          remote machine that allows root from the local machine.

Good luck,
Jon
::::::::::::::
moving-disks/5
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA01318; Mon, 1 Jun 92 13:11:00 EDT
Date: Mon, 1 Jun 92 13:11:00 EDT
Message-Id: <9206011711.AA01318@vangogh.wbst147.xerox.com>
Postmark: Sun May 31 14:07:49 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: kalli!kevin@fourx.aus.sun:com:Xerox
From: kalli!kevin@fourx.aus.sun:com:Xerox
To: fourx!xerox.com!leisner.henr801c@fourx.aus.sun:com:Xerox
Subject: Re: Moving system to another disk on a machine (and removing the disk)

[ Regarding "Moving system to another disk on a machine (and removing the
disk)", fourx!eso.mc.xerox.com!leisner writes on May 30: ]

> I have a sparcstation 2 where the internal disk is going onto another
machine.
>
> I have a 1.3G disk on this machine, what I want to do:
> move the system to the 1.3G disk, boot off this disk with a minimum of
work.
>
> The disk is now in 2 large partitions --
> what I want to do is leave 1 partition alone, a break up
> the other partition to
> /
> swap
> /usr
> and everything else goes into another partition.
>
> I suppose what I need to do is:
> 1) back up everything I'll blow away on tape

Yes - hopefully you won't need it, but it is a good idea.

> 2) repartition the disk (not touching the good partition)

Yep.

> 3) run newfs on the new partition

On two of the new partitions...

> 4) copy the system to the new partitions
> [Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]

presume sd0 and sd1 for the discussion - sd0 is old disk, sd1 is new...

newfs /dev/rsd1a ; newfs /dev/rsd1g
mkdir /a /g
mount /dev/sd1a /a ; mount /dev/sd1g /g
sync
dump /dev/rsd0a | (cd /a ; restore rf -)
dump /dev/rsd0g | (cd /g ; restore rf -)

> 5) change fstab to know about the new system

change fstab on the new disk - might want to look at dumpdates too.

> 6) change the rom to boot off the new device (after I try it out manually).

Yep.

> 7) Copy the save stuff from tape (if it fits)

What save stuff - you can do it all on-line with the tar/tar or dump/restore
tricks. You shouldn't have to use tape unless something goes wrong.
>
> Anything I forgot about?
>
> Does dd work copying files sytems?? What about running newfs??

Nahhhh, with dump/restore you can move files from different sized
partitions - and dump/restore is usually faster, as you don't copy
all the free blocks and such.
>
> How straightforward is changing the boot device in the rom?

Depends on the rom - for the SS2, you can use the "eeprom" command,
or you can do it in forth mode at the ok prompt:

eeprom "boot-device=/sbus/esp/sd@<target>,0"

or

setenv boot-device /sbus/esp/sd@<target>,0

                l & h,
                kev

Kevin Sheehan
Unix Professional Services
kalli!kevin@fourx.aus.sun.com

::::::::::::::
moving-disks/6
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
        id AA01307; Mon, 1 Jun 92 13:10:53 EDT
Date: Mon, 1 Jun 92 13:10:53 EDT
Message-Id: <9206011710.AA01307@vangogh.wbst147.xerox.com>
Postmark: Sun May 31 14:40:06 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: blymn@baobab.awadi.com:au:Xerox
From: blymn@baobab.awadi.com:au:Xerox
To: leisner:HENR801c:Xerox
Inreplyto: <9205302134.AA07898@louvre.wbst147.xerox.com> from "Marty Leisner 311/? x?" at May 31, 92 02:34:44 pm
Subject: Re: Moving system to another disk on a machine (and removing the disk)

According to Marty Leisner 311/? x?:
>I suppose what I need to do is:
>1) back up everything I'll blow away on tape
>2) repartition the disk (not touching the good partition)
>3) run newfs on the new partition
>4) copy the system to the new partitions
>[Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]

I use dump and restore to do this, if you do something like:

dump 0dsf 54000 6000 - /root/of/old/partition | ( cd \
/root/of/new/partition; restore xf - )

This of course assumes you have the target partition mounted, I
usually just mount it on /mnt temporarily to do the copy.
Which will copy the entire partition for you and is a bit safer than
using dd since on a live system you may dd a directory while it is
being changed!

>5) change fstab to know about the new system
>6) change the rom to boot off the new device (after I try it out manually).
>7) Copy the save stuff from tape (if it fits)
>
>Anything I forgot about?
>

Only one thing I can think of - you will need to do an installboot on
the new disk or it will not boot. Apparently this command must be run
if you have done a full restore of the root filesystem or the boot
process will not be able to find the boot image.

>Does dd work copying files sytems?? What about running newfs??
>
Yes, but you should only do it on file systems that are not mounted
because dd does not know anything about file systems - it just copies
bytes.

>How straightforward is changing the boot device in the rom?
>

use the new command mode in the prom monitor and do a setenv
boot-device, if you have a look at the one there and just change the
sdx part of the command you should be right.

-- 
Brett Lymn
Computer Systems Administrator
AWA Defence Industries
::::::::::::::
moving-disks/7
::::::::::::::
Return-Path: <leisner>
Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 )
	id AA00523; Mon, 1 Jun 92 08:29:16 EDT
Date: Mon, 1 Jun 92 08:29:16 EDT
Message-Id: <9206011229.AA00523@vangogh.wbst147.xerox.com>
Postmark: Sun May 31 23:21:29 1992 (XNS-SMTP-Gateway:Parc:Xerox)
Sender: miker@sbcoc:com:Xerox
From: miker@sbcoc:com:Xerox
To: leisner:HENR801c:Xerox
Subject: Re:  Moving system to another disk on a machine (and removing the disk)

That should work, but don't use dd to copy filesystems across differently sized disks (i.e., different cylinder sizes). newfs/mkfs do funny things based upon cylinder alignments. Use dump/restore (after a newfs), and then be sure to do a "installboot" on the new root partition. If you were moving the filesystems to an identically sized partition (on a disk with identical geometry, which usually means the same brand and model), you could dd, and thus skip the newfs and installboot. Another gotcha with dd, though, is if you dd the 0 cylinder, that includes the disk label, and will possibly screw things up when the new disk ends up with the same disk label as the original disk.

You should be in good shape; I've done this sort of thing before.

Changing the EPROM boot device is easy from SunOS (the eeprom command) or, with sun4c architectures, the "environment" monitor command.

Please be sure to summarize back to the list; thanks. :::::::::::::: moving-disks/8 :::::::::::::: Return-Path: <leisner> Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 ) id AA00543; Mon, 1 Jun 92 08:29:26 EDT Date: Mon, 1 Jun 92 08:29:26 EDT Message-Id: <9206011229.AA00543@vangogh.wbst147.xerox.com> Postmark: Mon Jun 1 02:00:08 1992 (XNS-SMTP-Gateway:Parc:Xerox) Sender: eckhard@ikarus.ts.go.dlr:de:Xerox From: Eckhard.Rueggeberg@ts.go.dlr:de:Xerox To: leisner:HENR801c:Xerox Subject: Re: Moving system to another disk on a machine (and removing the disk)

You forgot an installboot invocation, and I'd prefer a dump | restore pipe to move the contents of the disk. See the manual pages for parameters, I can't remember them. Also, I would suggest a "-i 8192" or even "-i 16384" parameter to the newfs command exept for the new root partition. /| / | Eckhard R"uggeberg / | DLR G"ottingen _____/___|_____ Abt. SM-TS / / / / Bunsenstr. 10 / / / / /____/____/____/ 3400 G"ottingen / Germany | / | / Tel. : 0551/709-2429 | / Fax : 0551/709-2446 |/ E-Mail : Eckhard.Rueggeberg@ts.go.dlr.de

Niulize nitakujibu :::::::::::::: moving-disks/9 :::::::::::::: Return-Path: <leisner> Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 ) id AA00564; Mon, 1 Jun 92 08:29:35 EDT Date: Mon, 1 Jun 92 08:29:35 EDT Message-Id: <9206011229.AA00564@vangogh.wbst147.xerox.com> Postmark: Mon Jun 1 03:10:20 1992 (XNS-SMTP-Gateway:Parc:Xerox) Sender: aadne@tss:no:Xerox From: aadne@tss:no:Xerox To: leisner:HENR801c:Xerox Subject: Re: Moving system to another disk on a machine (and removing the disk)

you cannot do dd on the root (/) file system!!!

Best Regards Adne Hestenes, Spacetec a.s, Box 585, 9001 Tromsoe, NORWAY

email: aadne@tss.no. :::::::::::::: moving-disks/10 :::::::::::::: Return-Path: <leisner> Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 ) id AA01267; Mon, 1 Jun 92 13:10:28 EDT Date: Mon, 1 Jun 92 13:10:28 EDT Message-Id: <9206011710.AA01267@vangogh.wbst147.xerox.com> Postmark: Mon Jun 1 09:49:12 1992 (XNS-SMTP-Gateway:Parc:Xerox) Sender: rayssd!tdw220.ed.ray.com!heiser@uunet.uu:net:Xerox From: heiser@tdw220.ed.ray:com:Xerox To: leisner:HENR801c:Xerox Inreplyto: <9205302134.AA07898@louvre.wbst147.xerox.com>; from "Marty Leisner 311/? x?" at May 30, 92 2:34 pm Subject: Re: Moving system to another disk on a machine (and removing the disk)

You'll probably also have to run installboot(8S) on the new disk to make it bootable.

-bill -- Bill Heiser Work: heiser@sud509.ed.ray.com Home: bill@unixland.natick.ma.us Public Access E-Mail, USENET, UNIX, and UUCP Accounts 508-655-3848 :::::::::::::: moving-disks/11 :::::::::::::: Return-Path: <leisner> Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 ) id AA00501; Mon, 1 Jun 92 08:28:59 EDT Date: Mon, 1 Jun 92 08:28:59 EDT Message-Id: <9206011228.AA00501@vangogh.wbst147.xerox.com> Postmark: Mon Jun 1 12:01:09 1992 (XNS-SMTP-Gateway:Parc:Xerox) Sender: fallan@baobab.awadi.com:au:Xerox From: fallan@baobab.awadi.com:au:Xerox To: leisner:HENR801c:Xerox Subject: Re: Moving system to another disk on a machine (and removing the disk)

Marty

if the new root and swap partitions are not sd0a and sd0b you will need to build a new kernel with the modified config line pointing to the appropriate partitions.

dd is fine as long as the partitions are the same size and in the same place, but it's probably beter to use dump piped to restore (there is an example in TFM entry for restore)

changing the ROM boot is straight forward. depending on the ROM revision, it varies slightly, but 'help setenv' from the PROM prompt gives an example I think.

regards

Frank Allan Network Manager e-mail: fallan@awadi.com.au AWA Defence Industries Phone: Intn'l + 61 8 343 6357 Module 5 Endeavour House Home: Intn'l + 61 8 263 5723 Fourth Avenue Fax: Intn'l + 61 8 262 7489 Technology Park SA 5095 Australia

:::::::::::::: moving-disks/12 :::::::::::::: Sender: Perry Hutchison:Portland:Xerox Date: 1 Jun 92 18:45:26 EDT (Monday) Subject: Re: Moving system to another disk on a machine (and removing the disk) From: Perry Hutchison To: leisner:HENR801c Reply-to: Perry Hutchison

> The disk is now in 2 large partitions -- > what I want to do is leave 1 partition alone, a break up > the other partition to > / > swap > /usr > and everything else goes into another partition.

While you're at it, you might want to make /tmp and /var into separate partitions (of about 10Mb each). This avoids filling up the root partition when things start getting large. (First axiom of file systems: disks are always full.)

> 1) back up everything I'll blow away on tape

Probably advisable to back up the other partition, too, just in case.

> 3) run newfs on the new partition

Actually, on each of the new partitions except swap.

> 4) copy the system to the new partitions > [Use dd if=/dev/oldpartition of=/dev/newpartition ??? ]

This is dicey. Since newpartition is on a SCSI disk it will probably work, but unless the geometries are identical the resulting performance will probably be suboptimal; also this results in the new filesystem having exactly the same number of blocks as the old even if the new partition is larger (and it will fail miserably if the new partition is smaller than the old). Better, after running newfs on the new root:

mount /dev/newpartition /mnt cd /mnt dump 0f - /dev/oldpartition | restore rf - cd / umount /mnt

and similarly for /usr.

> Anything I forgot about?

/etc/exports, perhaps, and you may need to reinstall the boot program on the new root after copying the files.

> Does dd work copying files sytems??

Yes, as long as the geometries are the same or the target is a SCSI disk, but dump/restore, or tar, or cpio, is usually better.

> What about running newfs??

Not needed if using dd, since dd will overwrite the target filesystem with a copy of the source one (including superblock, cylinder groups, etc -- which is why this is not the best approach when the geometries or partition sizes differ).

> How straightforward is changing the boot device in the rom?

I looked at "man 8 eeprom" and it is not obvious how to specify a disk other than sd0 (target 3); however this may be in the installation manual. Another option would be to change the external drive to target 3 after removing the internal drive :::::::::::::: moving-disks/13 :::::::::::::: Sender: mp@allegra.att:com:Xerox Date: 31 May 92 08:27:17 EDT (Sunday) Subject: Re: Moving system to another disk on a machine (and removing the disk) From: mp@allegra.att To: leisner:HENR801c

rather than just dd'ing the partitions, it's better to use newfs to create a new empty filesystem and then to fill it using dump 0f - old| (cd new; restore rf -) since - the old and new filesystems probably have different sizes - your 2 disks probably have different geometries. a filesystem layout is generally optimized for a given disk geometry, and 'newfs' is what does the layout determination.

you don't want to use dd to copy the 'a' partition because it'll copy the label, too.

after copying the 'a' partition, run installboot to reinstall the boot block on the new disk, because the blocks in /boot will have changed location. :::::::::::::: moving-disks/14 :::::::::::::: Sender: etnibsd!vsh@uunet.uu:net:Xerox Date: 1 Jun 92 09:59:36 EDT (Monday) Subject: Re: Moving system to another disk on a machine (and removing the disk) From: etnibsd!vsh@uunet.uu To: uunet!xerox.com!leisner.henr801c@uunet.uu In-Reply-to: <9205302134.AA07898@louvre.wbst147.xerox.com>; from "Marty Leisner 311/? x?" at May 30, 92 2:34 pm

Marty Leisner 311/? x? writes: > > I have a sparcstation 2 where the internal disk is going onto another machine. > > I have a 1.3G disk on this machine, what I want to do: > move the system to the 1.3G disk, boot off this disk with a minimum of work. > > The disk is now in 2 large partitions -- > what I want to do is leave 1 partition alone, a break up > the other partition to > / > swap > /usr > and everything else goes into another partition. > > I suppose what I need to do is: > 1) back up everything I'll blow away on tape > 2) repartition the disk (not touching the good partition) > 3) run newfs on the new partition > 4) copy the system to the new partitions > [Use dd if=/dev/oldpartition of=/dev/newpartition ??? ] > 5) change fstab to know about the new system > 6) change the rom to boot off the new device (after I try it out manually). > 7) Copy the save stuff from tape (if it fits) > > Anything I forgot about?

Well, back up **EVERYTHING**, not just the stuff you **PLAN** to blow away! :-)

> Does dd work copying files sytems?? What about running newfs??

Yes, but the partitons should be the same size (acutally, the size of the target partition must be >= that of the source). The resultant filesystem will be an exact copy of the original, including inode table and any file fragmentation.

I would do a "newfs; dump | restore", this will allow you to change the size of the partition and/or the inode ratio (for root partition, we use 4096, for all others we use 8192, except maybe a news partition).

re: 6) change the rom to boot off the new device (after I try it out manually).

I would change the SCSI address of the disk to 3 rather than changing the ROM. I like all my machines to be as "plain vanilla" as possible. I would want to be able to move the disk (or replace the CPU) and not have to worry about anything being "non-standard", Two years from now when there is a crisis and you have to make a swap, you (or your replacement/assistant) will have forgotten that this system has a unique configuration.

-- .. Steve Harris - Eaton Corp. - Beverly, MA - uunet!etnibsd!vsh :::::::::::::: moving-disks/15 :::::::::::::: Sender: @uicvm.uic.edu!paulo@dcc.unicamp:br:Xerox Date: 1 Jun 92 18:15:40 EDT (Monday) Subject: RE: Moving system to another disk on a machine (and removing the disk) From: paulo%dcc.unicamp.br@uicvm.uic:edu To: leisner:HENR801c

Cross-References: ?'s message <<9205302134.AA07898@louvre.wbst147.xerox.com>>

Though I haven't done this myself, after everything is ready on the new partition you should run "installboot", so that boot knows which blocks of the disk contain the code it needs.

-- Paulo Licio de Geus INTERNET:paulo@dcc.unicamp.br Depto de Ciencia da Computacao DCC - IMECC - UNICAMP caixa postal: 6065 13081 Campinas SP Brazil :::::::::::::: moving-disks/16 :::::::::::::: Return-Path: <leisner> Received: by vangogh.wbst147.xerox.com (4.1/SMI-4.0 ) id AA02049; Wed, 3 Jun 92 15:28:45 EDT Date: Wed, 3 Jun 92 15:28:45 EDT Message-Id: <9206031928.AA02049@vangogh.wbst147.xerox.com> Postmark: Wed Jun 3 14:43:00 1992 (XNS-SMTP-Gateway:Parc:Xerox) Sender: matt@wbst845e.xerox:com:Xerox From: matt@wbst845e.xerox:com:Xerox To: leisner:HENR801c:Xerox Subject: Re: Moving system to another disk on a machine (and removing the disk)

> 1) back up everything I'll blow away on tape Yes. You may want to back up everything on the disk, in case you make a mistake.

> 2) repartition the disk (not touching the good partition) Yes.

> 3) run newfs on the new partition Yes -- on ALL new partitions (other than swap). Note that it is best (administratively) to have root on the 'a' partition and swap on the 'b' partition.

> 4) copy the system to the new partitions Yes. > [Use dd if=/dev/oldpartition of=/dev/newpartition ??? ] No. You can only use 'dd' if the partitions are identical (i.e. same disk type and same size). Use "dump 0f - /dev/old | (cd /mnt; restore rf)".

> 5) change fstab to know about the new system Yes, if necessary (/ and /usr), see below.

> 6) change the rom to boot off the new device (after I try it out manually). Might be easier to simply change the SCSI id of the disk.

> 7) Copy the save stuff from tape (if it fits) Yes.

You can call me if you have any specific questions...

Matt Goheen (x23731) KBSCC Unix Admin. Bldg. 845



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