EOL HDD

Pavlicek Jaroslav Ing. jaroslav_pavlicek at kb.cz
Tue May 10 08:54:53 CEST 2005


Ahoj,

tohle je pekne popsano ve FAQ:

9.2. How do I move my system over to my huge new disk?

The best way is to reinstall the OS on the new disk, then move the user data over. This is highly recommended if you have been tracking -STABLE for more than one release, or have updated a release instead of installing a new one. You can install booteasy on both disks with boot0cfg(8), and dual boot them until you are happy with the new configuration. Skip the next paragraph to find out how to move the data after doing this.

Should you decide not to do a fresh install, you need to partition and label the new disk with either /stand/sysinstall, or fdisk(8) and disklabel(8). You should also install booteasy on both disks with boot0cfg(8), so that you can dual boot to the old or new system after the copying is done. See the formatting-media article for details on this process.

Now you have the new disk set up, and are ready to move the data. Unfortunately, you cannot just blindly copy the data. Things like device files (in /dev), flags, and links tend to screw that up. You need to use tools that understand these things, which means dump(8). Although it is suggested that you move the data in single user mode, it is not required.

You should never use anything but dump(8) and restore(8) to move the root filesystem. The tar(1) command may work - then again, it may not. You should also use dump(8) and restore(8) if you are moving a single partition to another empty partition. The sequence of steps to use dump to move a partitions data to a new partition is:

    1. newfs the new partition.
    2. mount it on a temporary mount point.
    3. cd to that directory.
    4.dump the old partition, piping output to the new one.

For example, if you are going to move root to /dev/ad1s1a, with /mnt as the temporary mount point, it is:

    # newfs /dev/ad1s1a
    # mount /dev/ad1s1a /mnt
    # cd /mnt
    # dump 0af - / | restore xf -
Rearranging your partitions with dump takes a bit more work. To merge a partition like /var into its parent, create the new partition large enough for both, move the parent partition as described above, then move the child partition into the empty directory that the first move created:

    # newfs /dev/ad1s1a
    # mount /dev/ad1s1a /mnt
    # cd /mnt
    # dump 0af - / | restore xf -
    # cd var
    # dump 0af - /var | restore xf -
To split a directory from its parent, say putting /var on its own partition when it was not before, create both partitions, then mount the child partition on the appropriate directory in the temporary mount point, then move the old single partition:

    # newfs /dev/ad1s1a
    # newfs /dev/ad1s1d
    # mount /dev/ad1s1a /mnt
    # mkdir /mnt/var
    # mount /dev/ad1s1d /mnt/var
    # cd /mnt
    # dump 0af - / | restore xf -

You might prefer cpio(1), pax(1), tar(1) to dump(8) for user data. At the time of this writing, these are known to lose file flag information, so use them with caution.



-----Original Message-----
From: users-l-bounces at freebsd.cz [mailto:users-l-bounces at freebsd.cz]On
Behalf Of Peter Rosa
Sent: Tuesday, May 10, 2005 1:28 AM
To: FreeBSD CZ
Subject: EOL HDD
Importance: High


Pani, prosim o RYCHLU pomoc. Skapina mi startovaci disk v produkcnom
serveri.

1. Ako najrychlejsie urobim zalohu CELEHO STARTOVACIEHO DISKU na iny pocitac
na sieti ?
2. Ako po vymene disku obnovim operacny system, ktory bol pri tejto zalohe ?

Rad by som sa vyhol novej instalacii a konfigurovaniu celeho servera
(samozrejme ak sa da), bezi mi tam dost sluzieb a aj bez tohto neviem, kde
mi hlava stoji...

Na serveri bezi 4.11-RELEASE-p2. Mam pristup cez mount_smbfs na sambove
zdielania na sieti, mam nainstalovany cdrtools2.0.1 - ak treba vytvorit
CD-image.

Velka vdaka za kazdu radu.

Peter Rosa


-- 
FreeBSD mailing list (users-l at freebsd.cz)
http://www.freebsd.cz/listserv/listinfo/users-l





More information about the Users-l mailing list