Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Backing up an install [SOLVED]

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
15 posts • Page 1 of 1
Author
Message
HeXiLeD
Veteran
Veteran
User avatar
Posts: 1160
Joined: Sat Aug 20, 2005 5:41 pm
Location: Online

Backing up an install [SOLVED]

  • Quote

Post by HeXiLeD » Thu Jan 22, 2009 2:26 am

Recently i found that i have bad blocks on a couple HD's and i would like to keep my install the way i have it but moved to a new HD.

The current install is:

Code: Select all

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1           6       48163+  83  Linux
/dev/sda2               7         261     2048287+  82  Linux swap / Solaris
/dev/sda3             262        4500    34049767+  83  Linux
And i am also upgrading my HD to a bigger one where i will be redoing the size of these 3 partitions.

I know that i can use "dd" to create the backup but i want to be sure that i wount be making any mistakes.

so lets go for questions:

1: I would like to know if i will have any problems with the fact that the 3 new partitions will be of bigger size.
2: Will i have any problems if i change the file system ?
3: Can anyone give me a few exemples on how to use "dd"or another tool; to do the backup and how i should proceed in the end.


Thanks :)
Last edited by HeXiLeD on Wed Feb 04, 2009 8:29 pm, edited 2 times in total.
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Top
jettjunker
Apprentice
Apprentice
User avatar
Posts: 267
Joined: Sat Sep 10, 2005 9:50 pm

  • Quote

Post by jettjunker » Thu Jan 22, 2009 4:16 am

My harddrive recently died, and I simply created a stage4. It worked well and was easy to do. It's described quite clearly on the following page:

http://blinkeye.ch/mediawiki/index.php/ ... t_(stage4)
(note that the forum software is throwing a fit about the parentheses... just copy/paste, and make sure you get the whole url)

As to your questions...
1) It won't matter (though could matter if they were smaller, of course)
2) I don't know what "dd" is, but if you use the stage4 method it certainly won't be a problem, just as you can copy a file from one partition to another even if they have different file systems. Be sure to have both enabled in your kernel though.
3) stage4 is really quite easy. I added ~/.wine/drive_c, my /usr/portage/distfiles, and my media (pictures/videos/music) to the default_exclude_list= portion of the script, and simply copied them over after following the stage4 instructions since there's no point in tar-ing them up. The instructions are quite clear, and worked perfectly (though it might be worth mentioning that "install grub" doesn't mean emerge it, but rather update your MBR with a "grub-install --no-floppy /dev/sda").
Core2Duo T7100 1.8 ghz mini-itx, Nvidia FX220: Gentoo/Gnome/CompizFusion:XGL
CoreDuo 1.83 ghz 13" Macbook, GMA 950: Ubuntu/Gnome/CompizFusion:AIGLX
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Thu Jan 22, 2009 12:33 pm

For a complete backup, you can also use the Stage 5.
Top
fangorn
Veteran
Veteran
User avatar
Posts: 1886
Joined: Sat Jul 31, 2004 1:31 pm
Contact:
Contact fangorn
Website

  • Quote

Post by fangorn » Thu Jan 22, 2009 12:46 pm

dd is a good utility, but for backups of linux installations it is plainly speaking overkill. Usually I just create a tarball (an archive) containing all the directories and files besides the ones created dynamically (which can get pretty big :twisted: /dev/zero *hint*). That way the filesystem and size of source and target are more or less irrelevant. The same is true for a harddisk with failing sectors.

I do use the following script.

Code: Select all

#!/bin/sh
# Create live backup of running linux system


path=`pwd`
#erstellen eines eindeutigen Verzeichnisnamens
dirname=$path/`date -I`
mkdir $dirname
zipper=yes

if [ -z `/bin/which 7z` ] ; then
   echo "Please install 7zip archive manager for better performance"
   zipper=no 
fi

echo "creating backups in $dirname directory"

if [ ! -d /mnt/backup ] ; then 
   mkdir /mnt/backup 
fi

#erstellen des / backups
if [ -d /mnt/backup ] ; then
  mount -o bind / /mnt/backup
else
  mkdir /mnt/backup 
  mount -o bind / /mnt/backup
fi
cd /mnt/backup
if [ $zipper = "no" ] ; then
	tar -cjvpf $dirname/linux-root.tar.bz2 *
else
	nice -20 tar -cp * | nice -20 7z a -si -tbzip2 $dirname/linux-root.tar.bz2
fi

#erstellen des /home backups
#cd /home
#tar -cjvpf $dirname/linux-home.tar.bz2 *

#erstellen des /boot backups
cd /boot
if [ $zipper = "no" ] ; then
	tar -cjvpf $dirname/linux-boot.tar.bz2 *
else
	nice -20 tar -cp * | nice -20 7z a -si -tbzip2 $dirname/linux-boot.tar.bz2
fi

#erstellen des etc abbilds
cd /etc
if [ $zipper = "no" ] ; then
	tar -cjvpf $dirname/linux-etc-`hostname`-`date -I`.tar.bz2 *
else
	nice -20 tar -cp * | nice -20 7z a -si -tbzip2  $dirname/linux-etc-`hostname`-`date -I`.tar.bz2
fi

#erstellen des opt abbilds
cd /opt
if [ $zipper = "no" ] ; then
	tar -cjvpf $dirname/linux-opt-`hostname`-`date -I`.tar.bz2 *
else
	nice -20 tar -cp * | nice -20 7z a -si -tbzip2  $dirname/linux-opt-`hostname`-`date -I`.tar.bz2
fi

cd $path

cp mbr.save $dirname
cp partitions.save $dirname

umount /mnt/backup
Downside:
Every directory that is not on the partition that contains / has to be backed up seperately (in the script these are /boot, /etc /home and /opt)

To extract them just unpack them using tar xjpf <filename> in the appropriate target directory.

To get the installation booting again you have to reinstall grub. I prefer the grub shell, but you can do it using the same command as with the installation process.
Video Encoding scripts collection | Project page
Top
cwr
Veteran
Veteran
Posts: 1969
Joined: Sat Dec 17, 2005 11:17 am

  • Quote

Post by cwr » Fri Jan 23, 2009 12:39 pm

dd is good idea for snapshot images, but you probably don't want an image if
your hard drive is dying. And dd won't work unless the source and destination
partitions are _exactly_ the same size.

In your case, use tar, which understands files and directories rather that the
raw blocks which dd uses. Tar just packs or unpacks the files it sees; it doesn't
care how big the whole filesystem is, as long as the destination filesystem has
at least as much space as the source.

The only things you _have_ to back up are /etc, for the configuration files, and
/home and /usr/local for your data; everything else can be recovered by a re-install.
Obviously if you have the space it's quicker to back up everything (except /sys and
/proc).

Will
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Fri Jan 23, 2009 12:43 pm

I never tested that, but maybe you can even backup a ext3 partition with tar and you can untar it inside a ReiserFs partition or something else.
Top
fangorn
Veteran
Veteran
User avatar
Posts: 1886
Joined: Sat Jul 31, 2004 1:31 pm
Contact:
Contact fangorn
Website

  • Quote

Post by fangorn » Fri Jan 23, 2009 1:10 pm

d2_racing wrote:I never tested that, but maybe you can even backup a ext3 partition with tar and you can untar it inside a ReiserFs partition or something else.
Sure you can. With tarballs you can easily realize heavy migrations.

Say you have a setup

/ reiserfs 15GB
/home xfs 5GB
/usr/portage reiserfs 6GB

and want to go to this setup

/boot ext2 100MB
/ ext4 3GB
/usr ext4 10 GB
/usr/portage 1GB reiserfs(512bytes blocksize)
/home ext4 20 GB on dmcrypt
/opt reiser4 5GB
/tmp tmpfs

This is just a point of creating and formatting the partitions, mounting them in the correct places and unpacking the tarball and editing /etc/fstab and /boot/grub/menu.lst.
Video Encoding scripts collection | Project page
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Sun Jan 25, 2009 9:46 pm

Nice to know that :P
Top
blueflame
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 107
Joined: Sun Nov 26, 2006 9:18 am
Location: Singapore

  • Quote

Post by blueflame » Mon Jan 26, 2009 2:30 am

Nobody mentioned partimage yet....?
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Mon Jan 26, 2009 3:07 pm

Partimage backup same size partition like dd.
Top
HeXiLeD
Veteran
Veteran
User avatar
Posts: 1160
Joined: Sat Aug 20, 2005 5:41 pm
Location: Online

  • Quote

Post by HeXiLeD » Thu Apr 22, 2010 1:20 am

Another topic with a similar subject.
gerard82 wrote:I have moved my Gentoo partitions several times.
I always use rescuecd.
I simply use

Code: Select all

mount /dev/<original> /mnt/gentoo
mount /dev/<new-partion> /mnt/backup
cp -a /mnt/gentoo/* /mnt/backup
I use it also to make back-ups.
Never any problems.
It's probably not the most sophisticated way,but it works and is simple.
Gerard.
I have used it. Easy as pie ;)
Last edited by HeXiLeD on Sat Apr 24, 2010 1:31 am, edited 1 time in total.
Do you hear the sound of inevitability?
With age, comes great grumpiness and that, was 20 years ago...

CertFP: becbbd161d5a5c31de3c45171b77bf710911db29 / d985d21f89fe2977b593c4d381a1a86802e62990d9328d893db76d59f9935244
Top
GWilliam
Guru
Guru
Posts: 350
Joined: Thu Dec 29, 2005 2:11 pm

  • Quote

Post by GWilliam » Fri Apr 23, 2010 3:38 am

#NULL
Last edited by GWilliam on Sun Jul 25, 2010 5:51 pm, edited 1 time in total.
Top
nikaya
Veteran
Veteran
User avatar
Posts: 1471
Joined: Sat May 13, 2006 9:43 am
Location: Germany

  • Quote

Post by nikaya » Fri Apr 23, 2010 8:30 am

I'm using fsarchiver for my backups. http://www.fsarchiver.org/Main_Page

It's not in portage yet, but in sunrise overlay: http://www.ebuildfind.net/application/fsarchiver/. And it is included in SystemRescueCD.
Notes on Dhamma
How to waste your time: look for an explanation of consciousness, ask to know what feeling is. (Nanavira Thera)
Top
gerard27
Advocate
Advocate
Posts: 2377
Joined: Sun Jan 04, 2004 3:30 pm
Location: Netherlands

  • Quote

Post by gerard27 » Fri Apr 23, 2010 11:45 am

I am happy that my method is being used.
I have in the past used it to move WinXP from one partition
to an other one.
The new partition has to be formatted to NTFS first of course.
It worked ok,WinXP never noticed that it had been moved.
The directory names mentioned in my post exist in Rescuecd.
Gerard.
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Sat Oct 09, 2010 1:48 am

Is there any avantages to use fsarchiver instead of a tar command ?

I don't get the point why fsarchiver is the new backup buzz these days ?
Top
Post Reply

15 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic