Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


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

Imaging a running Linux server



> From: discuss-bounces-mNDKBlG2WHs at public.gmane.org [mailto:discuss-bounces-mNDKBlG2WHs at public.gmane.org] On
> Behalf Of Matthew Gillen
> 
> On 08/27/2010 12:12 PM, Chris O'Connell wrote:
> > Would one need to boot up with a live disk or can the dd command
> image a
> > server that is up and running?
> 
> The system can be up and running.  A slightly better solution would
> combine
> LVM snapshots and dd, in that you can do more to ensure filesystem

The problem with dd is that it needs to read (and copy and write) all the
space in the whole device, including unused space.  And when you need to
restore, it's not just a straightforward "gunzip -c backup.dd.gz | restore"
... With dd, you either need to uncompress the backup image in-place, mount
it as loopback, and then copy files out of it ... Or else your restored-onto
hardware must have the precise same size as the original device.

If you're using LVM snapshots, you're still better-off to use dump instead
of dd.

Dump is written and distributed with the EXT fs source code.  So it's
written by the same folks who make the filesystem, and no, there is no
problem with dump & ext4.  Since dump is natively built and distributed with
that filesystem, it understands all the details of every type of thing
that's supported in that filesystem.  All the files, fifos, hardlinks,
softlinks, permissions, selinux attributes, character special devices, etc,
everything.  Everything that filesystem can handle is understood natively.
No need for crazy options such as would be needed in tar, star, rsync, etc.

Dump will not backup unused space that's unnecessary for backing up the
filesystem.

(Use xz instead of gzip, by the way)
You would do something like this:
dump -0uaf - /dev/something | xz -1 > backupfile.dump.xz 
and then you can restore onto any size new device, 
mkfs.ext4 /dev/something ; mount /dev/something /mnt ; cd /mnt ; unxz -c
backupfile.dump.xz | restore -rf -







BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org