Transferral between two hard disks

Brunoc at brunoc at
Wed Mar 24 15:18:20 PST 2004

----- Original Message ----- 
> Hi community,
> I would like to transfer the contents of an hard disk
> partition,in which is installed FreeBSD (in another partition
> is installed NetBSD and another one is unused),to another hard disk.
> The recipient hard disk will have only FreeBSD,and is capable to get 
> all the data from the original.
> I guess I would perform such operation in a way like
> disk image software for Windows (System Commander,
> Norton Ghost) does.I've seen on previous postings the use
> of command like 'dd' or 'ioctl',but I don't know if they
> are appropriate or not.
> In a few words,my goal is to have a bootable hard disk 
> with my FreeBSD and data,like the original one,original one that 
> I'm going to use for other purposes.
> FreeBSD 4.9-RC FreeBSD 4.9-RC #0: Wed Oct 15 00:12:26 CEST 2003     root@:/usr/obj/usr/src/sys/CURRENT_WITH_WINE_OPTIONS  i386
> -------------------------------------------------------------
> For complete information,even in the case you don't need it,
> I include the disklabel command output of my original 
> FreeBSD disk:
> 8 partitions:
> #        size       offset           fstype                   [fsize bsize bps/cpg]
>   a:   163840        0             4.2BSD     1024  8192    16  # (Cyl.    0 - 10*)
>   b:   532480   163840      swap            # (Cyl.   10*- 46*)
>   c: 61432497        0          unused        0     0        # (Cyl.    0 - 4062*)
>   e: 60736177   696320    4.2BSD     1024  8192    16  # (Cyl.   46*- 4062*)
>  /dev/ad2s1e:
> type: ESDI
> disk: ad2s1
> label: 
> flags:
> bytes/sector: 512
> sectors/track: 63
> tracks/cylinder: 240
> sectors/cylinder: 15120
> cylinders: 4062
> sectors/unit: 61432497
> rpm: 3600
> interleave: 1
> trackskew: 0
> cylinderskew: 0
> headswitch: 0  # milliseconds
> track-to-track seek: 0 # milliseconds
> drivedata: 0 
> -------------------------------------------
> Thank you
> Bruno

> Does the NetBSD also need to be bootable?

> You really need to include the fdisk information too so we can see
> what the slices actually are - note you have a FreeBSD 'slice'
> not partition, in the FreeBSD world, and within that FreeBSD slice you 
> have three partitions - a, b and e.   You say you also have a NetBSD slice
> and an unused slice, but don't show anything.   The fdisk output would
> at least show that.    do:
>             fdisk -v da0 > fdisk.out  or fdisk -v ad0 > fdisk.out
> Then include the contents of fdisk.out in the message.

> Unless the new disk is identical in every way to the old one, you don't
> want to bother with dd or any of the other so-called imaging utilities.  
> Even if they are identical, they represent the less reliable way.
> In general, I would recommend doing a fdisk on the new disk to make the
> slices and then disklabel the FreeBSD slice and newfs the newly created
> partitions.  When you do the fdisk, make the FreeBSD slice bootable and 
> put an MBR on it and in disklabel put a standard boot block in the slice.  
> Then use dump(8) and restore(8) to copy the contents of each separate
> filesystem in the FreeBSD slice to the new filesystems on the new disk.
> You do not need to use tape for the dump.  Just mount the new file system,
> to some alternate mount point such as /newroot.  cd in to it and then
> pipe a dump of the old file system to a full restore in the new one.
> There used to be an example of this in the dump and restore man pages
> but I don't see it now.  Maybe it was in man pages on another OS.
> You only need to do this for the root (a) and other big file system (e) (is 
> it mounted as /usr?)   Don't try to copy the swap partition.
> This is the most reliable way.
> Presuming that your e partition mounts as /usr
> and you did the fdisk, disklabel and newfs of the new disk OK.
> Also, presuming it is SCSI disk.  
> If it is IDE, then da1s1a becomes ad1s1a, etc.
>   recommend doing this in single user mode
>   So, after rebooting in to single user.
>   mount -a
>   mkdir /newroot
>   mount /dev/da1s1a /newroot
>   cd /newroot
>   dump 0af - / | restore -rf -
>   mkdir /newusr
>   mount /dev/da1s1e /newusr
>   cd /newusr
>   dump 0af - /usr | restore -rf -
> Since you don't show anything about the NetBSD slice, it is hard to know
> what to do with it.   You might actually be able to use the dump/restore
> for it too if you can mount it in a running FreeBSD.   Of course, there
> is no point in trying to copy the unused slice.
> ////jerry
>> <URL:
>> HTH,
>> Jud

Thank you very much for your valuable information.

The NetBSD slice does not need to be bootable,
I was playing with it and I have no significant data,
so I will eventually reinstall NetBSD or OpenBSD 
from scratch on the first hard drive (the recipient).
Yes,my e partition mounts as /usr.
I'm going to include the fdisk information as soon
as I can boot again on my second hard disk (is an IDE one),
from which the FreeBSD slice is to be tranferred to the first
drive (another IDE).


[Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus]
[Quipo ISP - This E-mail was scanned for viruses by Declude Virus]

More information about the freebsd-questions mailing list