From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1ECVIW-0004QB-7R for garchives@archives.gentoo.org; Tue, 06 Sep 2005 04:43:04 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j864cFNe019778; Tue, 6 Sep 2005 04:38:15 GMT Received: from mail.kietra.com (mail.kietra.com [207.224.24.118] (may be forged)) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j864cDc5026441 for ; Tue, 6 Sep 2005 04:38:14 GMT Received: (qmail 16858 invoked by uid 210); 5 Sep 2005 21:41:28 -0700 Received: from 24.22.30.76 by mail (envelope-from , uid 201) with qmail-scanner-1.25st (clamdscan: 0.86.1/1062. spamassassin: 3.0.2. perlscan: 1.25st. Clear:RC:0(24.22.30.76):SA:0(0.1/4.0):. Processed in 2.477065 secs); 06 Sep 2005 04:41:28 -0000 X-Spam-Status: No, hits=0.1 required=4.0 Received: from c-24-22-30-76.hsd1.or.comcast.net (HELO tiger.irey.org) (michael@irey.org@24.22.30.76) by mail.kietra.com with SMTP; 5 Sep 2005 21:41:25 -0700 From: Michael Irey To: gentoo-server@lists.gentoo.org Subject: Re: [gentoo-server] Imaging software for a production server Date: Mon, 5 Sep 2005 21:41:24 -0700 User-Agent: KMail/1.8.1 References: <200508181509.28863.michael@irey.org> <431481C2.6020207@imperium.org> <43181888.30402@food4brain.org> In-Reply-To: <43181888.30402@food4brain.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-server@gentoo.org Reply-to: gentoo-server@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509052141.24227.michael@irey.org> X-Archives-Salt: 767c6af1-817c-4ad2-ae53-08ebf4ef9f4c X-Archives-Hash: 64d8d4841a5a26fc89c885022d3c6a40 I was looking for the same thing you are trying todo last week. I used partimage and was not happy with it, so I just used tar, and why not? Its tried and true, and I think its about 30 years old. I use this for our production mail (qmail) server. I have tested by fdisking the whole drive and restoring. I had no problems or errors using the restored server. These are the steps I took. Modify for your needs. -- To Backup 1) save metadata about how the disk is partitioned. # sfdisk -l > /etc/partition.bak # cp /etc/fstab /etc/fstab.bak 2) back up master boot record (MBR) # dd if=/dev/sda of=/etc/mbr.bak bs=512 count=1 3) back up the operating system: # mount /boot ## if its not already # cd / # tar zcvf - . --exclude='./proc' --exclude='./sys' --exclude='./lost+found' | ssh some_host "cat > backup_server.tar.gz" -- To Restore 1) boot live cd 2) partition drive(s) # ssh backupserver 'cat /etc/partition.bak' Disk /dev/sda: 9729 cylinders, 255 heads, 63 sectors/track Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0 Device Boot Start End #cyls #blocks Id System /dev/sda1 * 0+ 8 9- 72261 83 Linux /dev/sda2 9 133 125 1004062+ 82 Linux swap / Solaris /dev/sda3 134 9728 9595 77071837+ 83 Linux /dev/sda4 0 - 0 0 0 Empty # sfdisk /dev/sda << EOF 0,9,83,* 9,125,82 134,9595,83 ,,0; EOF notes: sfdisk reads lines of the form where each line fills one partition descriptor. 3) create file systems # mke2fs /dev/sda1 # mke2fs -j /dev/sda3 # mkswap /dev/sda2 # mkdir /mnt/gentoo # mkdir /mnt/gentoo/boot # swapon /dev/sda2 # mount -t ext3 /dev/sda3 /mnt/gentoo # mount /dev/sda1 /mnt/gentoo/boot 4) restore OS and data # cd /mnt/gentoo # ssh target "cat filename.tar.bz2" | tar zpvxf - -j Decompress with bzip2 -p Preserve permissions -v Verbose -x Extract -f File 5) create proc and sys # mkdir /proc # mkdir /sys 6) restore MBR # dd if=/mnt/gentoo/etc/mbr.bak of=/dev/sda bs=512 count=1 notes: one could run grub-install --no-floppy /dev/sda instead. 7) reboot --end Michael Irey System Administrator ................................................ SightWorks, Inc. Portland, Oregon Web: http://www.sightworks.com SightWorks : Creative Internet Technologies On Friday 02 September 2005 02:16 am, Luca Dell'Oca wrote: > Hi all, > I have a couple of gentoo servers that I cannot shutdown for > maintenance. In the past, I've used Acronis trueimage on my windows > machines in order to create images of the drives, and I love the fact I > do not need to shutdown the machine to create the image, and the image > can be saved on the same partition I'm ghosting. > I've tried several program for linux, but none of them seem to have the > same features: partimage can backup live systems, but it cannot create > the file on the same partition I'm ghosting and it creates different > files for every partition, and all the other softwares have their own > liveCD to boot from, but in this way I have to shutdown the server. > > Acronis has a linux version of trueimage, but it needs X to run, and I > do not want to install it on a mail or web server, and gentoo is not > supported, so I think it could be a PITA to install it. > > Any suggestion, maybe also some script able to copy also the mbr? > > Thanks, > Luca, Italy -- gentoo-server@gentoo.org mailing list