linux on 17 Jun 2008 02:52:12 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] utility to image a linux host?


On Sat, 2008-06-14 at 11:26 -0400, PaulNM wrote:
> Morgan Jones wrote:
> > with dd it's theoretically very easy:
> > 
> > dd if=/dev/sda of=/mnt/somewhere
> > 
> > the filesystem mounted on /mnt/somewhere needs to have enough free space 
> > to hold the entire contents of /dev/sda.  This won't help you create and 
> > iso of course.
> > 
> > It's funny that you asked about an iso because I came across this in my 
> > searching: http://www.sysimage.com
> > 
> > sysimage is a little more complex that I'd like: ie client-server and 
> > focused around building an image server that can be used to create many 
> > clients.  It is flarcreate and jumpstart all wrapped up in a custom 
> > package..  It does seem to allow bare metal restores to a "golden image" 
> > though which is very handy.
> > 
> > -morgan
> > 
> > 
> > Casey Bralla wrote:
> >> I was literally opening my eMail client to post a very similar request.   
> >>
> >> I've got Gentoo pretty well where I like it, but it's a booger to get it to 
> >> here.  (Also takes a long time).  I'd like to create a ISO image of my hard 
> >> drive so that if I ever want to go back to this stage, I just boot to the 
> >> DVD, and presto, it's there.
> >>
> >>
> >> How do you do this with dd?
> >>
> >>
> >>
> >> On Saturday 14 June 2008 10:49:13 am Morgan Jones wrote:
> >>> I was talking to a coworker recently about 'flarcreate,' a solaris
> >>> utillity that creates an image of a system that can be used to re-create
> >>> a system either manually or via Jumpstart.  It's very handy for
> >>> re-creating production environments in test or taking an ad-hoc backup,
> >>> say, before an upgrade.
> >>>
> >>> Does such a utility exist for Linux (RHEL/Debian/Ubuntu)?  I know it can
> >>> be done with dd but I'm looking for error checking and some awareness of
> >>> the filesystem.  In particular, flarcreate will not backup empty space
> >>> and can be told to exclude paths.
> >>>
> >>> thanks,
> >>>
> >>> -morgan
> >>>
> Partimage can do all of that. I'm not sure about the exclude paths 
> option, though.
> 
> 
> 
>  From http://www.partimage.org/Main_Page :
> 
> Description: Partimage is a Linux utility which saves partitions having 
> a supported filesystem to an image file. Most Linux and Windows 
> filesystems are supported. The image file can be compressed with the 
> gzip / bzip2 programs to save disk space, and they can be splitted into 
> multiple files to be copied on CDs / DVDs, ... Partitions can also be 
> saved across the network since version 0.6.0 using the partimage network 
> support, or using Samba / NFS. If you don't want to install Partimage, 
> you can download and burn SystemRescueCd. It's a livecd that allows to 
> use Partimage immediately even if your computer has no operating system 
> installed (useful to restore an image), and it allows to save an image 
> on a DVD on the fly.
> 
> Partimage will only copy data from the used portions of the partition. 
> For speed and efficiency, free blocks are not written to the image file. 
> This is unlike the 'dd' command, which also copies empty blocks. 
> Partimage also works for large, very full partitions. For example, a 
> full 1 GB partition can be compressed with gzip down to 400MB.
> 
> This is very useful to save partitions to an image in some cases:
> 
>      *  First you can restore your linux partition if there is a problem 
> (virus, file system errors, manipulation error). When you have a 
> problem, you just have to restore the partition, and after 10 minutes, 
> you have the original partition. You can write the image to a CD-R if 
> you don't want the image to use hard-disk space.
>      * This utility can be used to install many identical computers. For 
> example, if you buy 50 PCs, with the same hardware, and you want to 
> install the same linux systems on all 50 PCs, you will save a lot of 
> time. Indeed, you just have to install on the first PC and create an 
> image from it. For the 49 others, you can use the image file and 
> Partition Image's restore function.
> 
> 
> 
> Paul


I've used partimage for a very short period also (about 3 or more years
ago) for transferring the entire os to another disk/computer on my home
servers/desktops.  Worked for me.  Or maybe I used it for backup.  If i
remember correctly, I booted  knoppix live on the source computer,
downloaded a STATIC version of the client into knoppix, and pushed the
partition images to a file server(over the network).  Then I would
reload the os by booting into knoppix, downloading the static compiled
client from the file server, and restoring the parition images over the
network into the hard disk.  I may have used a usb disk some times  but
the principle is the same.  So, you can keep partition images as simple
files on a disk (I kept them in  2 gig compressed chunks, if i remember
correctly). 

I used static versions of partimage to keep the server and client
versions consistent and to minimize trouble with the shared libraries
that a live cd may come with (knoppix also came with a version of
partimage).   Some versions didnt work with other versions though I dont
remember exactly why (had to do with passwords or security).

It undestands filesystems (at least ext2/ext3, and I remember
sucessfully restoring an windows XP image, at that time it was
experimental support) so it only "saves" the actual used files not the
whole disk.  Although from the website it says the partitions more or
less need to follow the original sizes (target cannot be smaller)--this
is also an important consideration as some of the reasons for
transferring an entire os is for a disk upgrade (usually for a bigger
one) -- not a big deal but a few extra work to resize partitions.  (I
dont remember it having the "exclude path" feature you mention.)

regardless, any restoration of root partition ("/") especially on a
fresh disk involves familiarity with grub or lilo, though partimage
supported some kind of imaging the boot sector.  

ep / jondz

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug