Transferral between two hard disks

Jerry McAllister jerrymc at clunix.cl.msu.edu
Wed Mar 24 15:32:27 PST 2004


> 
> > 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.
 
> > Does the NetBSD also need to be bootable?
> 
> > 
> > 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:
> >> http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#NEW-HUGE-DISK>
> >>
> >> 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).

You can probably use /stand/sysinstall to slice and partition 
the new disk.  It might be easier.   I have never done a second disk 
that way.  I always just use fdisk/disklabel/newfs 
But, I do the initial installs with the sysinstall on the boot CD
and that's the same thing.   You just have to select the right drive
and follow through.   Make sure you mark the new FreeBSD slice
as bootable in that screen (after you create the slice, put the
highlight on that line and select 's').   

////jerry

> 
> Bruno
> 
> 
> ---
> [Quipo ISP - Questa E-mail e' stata controllata dal programma Declude Virus]
> [Quipo ISP - This E-mail was scanned for viruses by Declude Virus]
> 
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
> 
> 



More information about the freebsd-questions mailing list