Installation guide
5. Calculate the new partition parameters. You can increase or decrease
the size of a partition. You can also cause partitions to overlap.
6. Edit the disk label by using the disklabel command with the −e
option to change the partition parameters, as follows:
disklabel -e
[-r] disk
An editor, either the vi editor or that specified by the EDITOR
environment variable, is invoked so you can edit the disk label, which
is in the format displayed with the disklabel −r command.
The −r option writes the label directly to the disk and updates the
system’s in-memory copy, if possible. The
disk
parameter specifies the
unmounted disk (for example, rz0 or /dev/rrz0a).
After you quit the editor and save the changes, the following prompt is
displayed:
write new label? [?]:
Enter y to write the new label or n to discard the changes.
7. Use the disklabel command with the −r option to view the new disk
label.
8. Edit the /etc/fstab file to include the new file systems.
7.9 Cloning Disks
You can use the dd command to clone a complete disk or a disk partition;
that is, you can produce a physical copy of the data on the disk or disk
partition.
Because the dd command was not meant for copying multiple files, you
should clone a disk or a partition only on a disk that is used as a data disk
or one that does not contain a file system. Use the dump and restore
commands described in Chapter 11 to clone disks or partitions that contain
a file system. For example the following command can be used to clone
the/usr partition of a disk to a new disk partition mlunted on /newdisk
#dump -0f - /usr | (cd /newdisk ; restore -xf -)
Using this command, you can clone a complete disk. For example, if you
wanted to move your system disk to a disk with larger capacity. To clone a
complete disk, use the following procedure:
1. set up the target disk using diskconfig. The new disk should have
target partitions for each partition on the source disk and requires a
boot block if it is to be a boot disk. Not that you do not need identical
partitions if you do not plan to clone all data, however, you will need to
adjust your /etc/fstab file before using the new disk.
Administering the UNIX File System 7–29