Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2008, 09:47 AM
stevethebuilder stevethebuilder is offline
Junior Member
 
Join Date: Sep 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Full system backup and restore
Hi,

What is the best and easiest for a newbie to do a full system backup and restore? I have a new larger HD and wish to copy the complete system from my old HD onto it so I can use the old HD in another computer.
Reply With Quote
  #2  
Old 02-07-2008, 05:10 PM
Galactic Dominator Galactic Dominator is offline
Senior Member
 
Join Date: May 2006
Posts: 168
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Full system backup and restore
There are several methods for doing this here is one.

http://www.bsdguides.org/guides/freebsd ... ddrive.php

If you don't like that one, feel free to google around and find an alternative solution.
Reply With Quote
  #3  
Old 02-07-2008, 10:16 PM
graedus graedus is offline
Senior Member
 
Join Date: Jul 2006
Location: .mx
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Full system backup and restore
I have personally used old tar (to move, backup, and rearrage filesystems)

From man tar
Code:
To move file hierarchies, invoke tar as
tar -cf - -C srcdir . | tar -xpf - -C destdir
I would suggest adding the following flags too just in case: --one-file-system, and v for verbose to know what's going on.


or this utility for whole partitions: g4u http://www.feyrer.de/g4u/ either from two disks in the same system (ide/sata/usb) or via ftp.
Reply With Quote
  #4  
Old 02-08-2008, 05:08 PM
stevethebuilder stevethebuilder is offline
Junior Member
 
Join Date: Sep 2007
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Full system backup and restore
Thanks, I will try these and hopefully one will work for me.
Reply With Quote
  #5  
Old 02-08-2008, 09:11 PM
TerryP TerryP is offline
Senior Member
 
Join Date: Nov 2005
Location: Ga. USofA
Posts: 7,906
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to TerryP Send a message via AIM to TerryP Send a message via Yahoo to TerryP
Default Re: Full system backup and restore
my back ups usually consist of taring files and scp'ing them to another machine or taking a dump(8) and sending it through ssh to be compressed with gzip or bzip2 on the storage machine or in processing.


I posted this on my blog a long time ago:


dump -0f - / | gzip -2 | ssh -c blowfish [my user]@IP dd of=hostname_date.gz


I use some thing similar when I take a dump of my home directory but normally I try to due the compression on the most powerful machine. I favor bzip2 for cold storage and a quick gzip for the just get it done jobs hehe.
Reply With Quote
  #6  
Old 02-09-2008, 05:08 AM
graedus graedus is offline
Senior Member
 
Join Date: Jul 2006
Location: .mx
Posts: 606
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Full system backup and restore
I have migrated several instalations to larger/similar hard drives using the tools I commented. I will insist on the tools. Although I am aware that dump and dd work well, I'm personally not comfortable using dd, or tunefs after a dump. I still believe tar is the way to move filesystems and backup installations. g4u is ghost on steroids, and will clone whatever slice you need without touching the filesystem.

It really depends how you have your disk layout, if you dual or triple boot, etc.

For example, I migrated a triple boot xp/pcbsd/hp-quickplay linux (must be at the end of the geometry) (1 ntfs/1 ufs2/1 propietary hp slices) from a 100gb to a 120gb hdd. Depending on where to allocate the extra 20 gb, this is what I did:

+20 on xp: Dump using g4u the nfts slice to the new hdd connected as ide from the original drive in usb2. Use qtparted from mepis-livecd to prepare two dummy slics with the same former size for usf2 and hp, expand nfts slice on remaining space. g4u remaining slices.

+20 on /: Dump using g4u the ntfs slice. Dummy space for pcbsd and hpqp using qtparted. Prepare new hdd using qtparted from mepis-livecd, with three dummy slices. Install minimal pcbsd on the dummy slice or use sysinstall to prepare the target slice (depending on your expertise and confidence level of the command line. Tar original pcbsd***(check at the end how to do these last steps). G4u hp-qp.

+20 on PCBSD + change bsdlabel layout (more swap, separate /home/ /usr/ /var /tmp or /etc): This is the only reliable way I'm aware of to shrink and change usf disklabel layouts (I really wished there would be an foolproof graphic tool to do this). Same as above, but when doing the tar, consider the following:

Plan ahead your new layout, with a custom freebsd minimal installation, or a custom pcbsd slice layout. Using the --one-file-system flag, move each file system, one at a time.

http://unixarticles.com/articles/92/...ive-in-FreeBSD
Quote:
Shutdown and install the new drive in the computer, leaving the existing drive as the primary master. Installing the new drive as the master on the secondary ATA channel will give you faster throughput for transferring data, but the new drive may be installed as the slave drive on the primary ATA controller. Be sure to set both new drive and existing drive jumpers as required.
Boot to single user mode. If you are using FreeBSD 5.x or 6.x, choose the 'Boot FreeBSD in single user mode' option at the boot menu; otherwise, during the boot loader countdown, press any key other than the Enter key, and at the boot prompt, enter the command:

ok boot -s

At the shell prompt, mount the file systems:

# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a
Run sysinstall:

# /usr/sbin/sysinstall (In FreeBSD 4.x, it's /stand/sysinstall)
Choose 'Configure,' then 'Fdisk' from the menu, then choose your new drive. (For ATA drives, the new drive will be 'ad1' if it's the primary slave, or 'ad2' if it's the secondary master; for a SATA master on channel 4, it will be 'ad8'.) For the purpose of this procedure, we will assume that the new drive is 'ad2'.
In the FDISK Partition Editor, choose 'A' to use the entire disk. Press 'Q' to continue.
At the "Install Boot Manager" prompt, choose the appropriate boot manager. This procedure assumes that FreeBSD is the only operating system, so choose the 'Standard' master boot record.
Back at the sysinstall menu, choose 'Label'.
In the Disklabel Editor, create the following partitions:
ad2s1a /mnt 512MB as UFS2
ad2s1b swap 2048MB as swap (4x system RAM)
ad2s1d /var 4096MB as UFS2 + Softupdates
ad2s1e /usr remaining as UFS2 + Softupdates To get partition 'a', tell Disklabel Editor the mount point is '/', then change it to '/mnt' using the 'M' option.


Choose 'Q' to continue.
Exit sysinstall.
Mount the new filesystems:

# mount /dev/ad2s1a /mnt
# mount /dev/ad2s1d /mnt/var
# mount /dev/ad2s1e /mnt/usr
Copy the existing filesystems:

# tar cf - --one-file-system -C / --exclude='mnt/*' . | tar xpvf - -C /mnt
# tar cf - --one-file-system -C /var . | tar xpvf - -C /mnt/var
# tar cf - --one-file-system -C /usr . | tar xpvf - -C /mnt/usr
Shutdown and remove the old hard drive. Move the new drive to the location of the old drive; make sure to set the new drive's jumpers accordingly. If you are moving from an ATA drive to a SATA drive, make sure you change the boot device in the computer's System BIOS.
Boot to single user mode as described previously.

At the shell prompt, mount the file systems:

# fsck -p
# mount -u /
# mount -a -t ufs
# swapon -a
Verify that all of the filesystems are properly mounted:

# mount

You should see something like:
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad0s1e on /usr (ufs, local, soft-updates)
/dev/ad0s1d on /var (ufs, local, soft-updates)
Reboot and observe startup messages to ensure the system is functioning properly.
At the very last, I let the GAG bootloader to sort things out. This looks very complicated, but it was very straight forward, and it took me only an hour and a half to dump all the data.

P.S. I really like having separate / and /home layouts (with swap in between), since this layout will allow me to do the following:

Reinstall the system and leave /home and all personal files alone.

Back up /home, erase it, and expand / or swap according to your needs, then restore /home.

Move filesystems without compromising personal/user configuration files.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File system full? miggols99 Installing PC-BSD 8 05-05-2008 09:05 AM
How to dump and restore your drives. antik Guides 0 04-11-2007 12:50 PM
Anyone installed OSS Open Sound System full? sblevin General Questions 5 02-14-2007 10:44 AM
Can I restore my PBI Programs menu? Shagbag PBI Discussion 7 07-26-2006 11:23 PM
How do I backup the system without copying free space ??? PCdoc General Questions 10 07-16-2006 10:46 PM


All times are GMT. The time now is 06:36 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Copyright 2005-2010, The PC-BSD Project. PC-BSD and the PC-BSD logo are registered trademarks of iXsystems.
All other content is freely available for sharing under the terms of the Creative Commons Attribution License.