# Network Bootable "Ghost" Like Application?

## ydleiF

Hello,

I'm looking for an application which would boot off a network (pxes /

tftp), and then it's job would be to let me create an image of a disk

(with dd probably), and then let me store it on a tftp or ftp server. It

would also do the reverse, fetching that image, and writing it to the

hard disk.

I found an app, but it's too old and inflexible. But this is a good idea

of what I'm looking for.

http://www.bigwebmaster.com/General/Howtos/Clone-HOWTO/

I have looked at systemimager, but the very old docs make me wary. It

also needs to be operating system independant, so that I can use it with

linux or windows systems.

If I were to do this manually i'd have say a gentoo livecd, boot that,

use dd and other tools to pipe the image of the entire hard drive

somewhere on an ftp site. Or the reverse, fetch from an ftp server and

write the contents to the local disk.

Thoughts?

----------

## nobspangle

have a look at acronis true image, it's not free and doesn't boot off of a network, but it lets you create and restore images of disks and it's very quick for drives formated in fat/fat32/ntfs/ext2/ext3/reiserfs

It boots from a cd and you can back up to an smb share

----------

## ydleiF

Okay, thanks for the feedback.

Unfortunately our client machines don't have cd-rom drives (which is why I specified network boot).

----------

## BCC

partimage (http://www.partimage.org/) is an application that can save and restore partitions (fat, ntfs, ext2, ext3, reiserfs, ...) to and from network (use the partimaged daemon for that). You will need some "live" distribution containing partimage (sry, I have no advice on this, maybe some custom gentoo already contains partimage ? I use the RIP live CD (http://www.tux.org/pub/people/kent-robotti/looplinux/rip/) ... but you need a cdrom for that).

partimage is GPL.

----------

## ydleiF

Right on, someone else just pointed me at that.

I'm installing it right now, of all the things people have pointed me at, this sounds like the best bet so far.

I'll post here my results.

----------

## ydleiF

Not sure if you run it, but maybe somebody else can help me. I've run into two issues:

 1) no init.d script for partimaged

 2) trying to run partimaged -d /some/existing/directory spits out:

```

(null): Bad address

```

I've looked at the rather poor documents, but can't find anything. Even a google search turned up only one result which did not help.

Any ideas?

----------

## st. anger

maybe something like this?

http://www.feyrer.de/g4u/

----------

## ydleiF

g4u might have some potential as well, thanks.

----------

## ydleiF

Do any of you have experience running partimaged?

The documents are VERY old and very imcomplete. Options that are supposed to work (like --nossl or -n) get spit back as unrecognized. The installation of it on gentoo by the ebuild is quite sloppy. I am getting SSL errors, I find hints to run a certain script, but that script is nowhere to be found.

If this keeps up I'll have to scrap the idea, which I really don't want to do as it looks the best for me so far.

----------

## ydleiF

Well, I've hit my wits end with partimage. I ran into problem after problem after problem. Some seem related to how it was installed by the ebuild, but most seem to be the applicatino itself. The very poor state of it's documentation makes it worse. I posted a bug for anyone interested, I'll go and try out g4u now.

https://bugs.gentoo.org/show_bug.cgi?id=65717

----------

## gpreston

Try seeing what you can make use of from this documentation:

http://www.gentoo.org/doc/en/diskless-howto.xml

----------

## BCC

For now, you can get partimage and partimaged to work on Gentoo, using the ebuilds, but with great pain.

```
emerge newt

emerge slang

USE='-ssl' emerge partimage

```

Then create the partimag account (8 letters) :

```
grouppadd partimag

useradd -c partimage -g partimag -s /bin/false partimag

```

Replace 'bcc' by your login name in the following line :

```
echo bcc >> /etc/partimaged/partimagedusers

```

Then chdir to a location where you have space (saved images will be stored where you are (there is probably some (working) option to tell partimaged to store images elsewhere)) :

```
cd /mnt/spare

```

This starts partimaged, and shows some listening processes :

```
partimaged

```

Here comes another problem : partimaged won't start if /etc/partimaged/partimagedusers has other permissions than (root, root, 600), but partimaged won't be able to read this file, with these permissions, since it has setuid to user 'partimag' right after starting. So we change the permissions on the file after having started partimaged. Ugly :

```
chmod 644 /etc/partimaged/partimagedusers

```

Remember to chmod 600 /etc/partimaged/partimagedusers after having finished your images, since partimaged won't restart next time if permissions are still '644'...

On the client system (the one you want to save), you should use the same partimage command as the one you compiled on Gentoo (No SSL support at compile time). You should use the same binary (just copy 'partimage', and maybe some libraries, depending on the 'livecd' distribution you use). Warning : you should only save images of unmounted partitions.

Use the account listed in your '/etc/partimaged/partimagedusers' file above to connect to the Gentoo system running the 'partimaged' daemon. You should also avoid putting 'comments' on the image files, you should use 'gzip compression' (so that partimage can save the partition's boot record too).

Hope that helps.Last edited by BCC on Wed Sep 29, 2004 11:17 pm; edited 1 time in total

----------

## ydleiF

Damn. I really appreciate all the typing you did, thanks a lot.

Unfortunately I ended up dropping that option, it's just taking far too much messing with to get working.

----------

## ydleiF

I'm now trying to come up with my own solution, as what I've found isn't what I need.

We already use pxes (http://pxes.sourceforge.net/) on almost all of our client systems. I think I could use that as a very good starting point for my own solution.

Any thoughs on this line of thinking:

 1) network boot pxes, drop to command line

 2) create a named pipe (FIFO)

 3) cat or dd a disk or partition to this FIFO

 4) use an FTP client to read the other side, and upload to an FTP server

I've already tried a little bit of this, using ncftpput which is part of ncftp.

In it's man page:

```

 A neat way to pipe the output from any local command into a remote file is  to  use the -c option, which denotes that you're using stdin as input.  The following exam-       ple shows how to make a backup and store it on a remote machine:

$ tar cf - / | ncftpput -c sonic.sega.co.jp /usr/local/backup.tar

```

So I tried the following on a full install of linux (not a PXES station, yet).

```

# mkfifo -m 700 ftp-fifo

# ls -lh ftp-fifo

prwx------  1 root root 0 Sep 29 09:45 ftp-fifo

cat /dev/hdc1 > ftp-fifo

```

Meanwhile on another terminal on that system:

```

cat ftp-fifo | ncftpput -c -u me an-ftp-server /home/me/ftp-fifo.raw

*** Error: getline(): not interactive, use stdio.

```

Back where I began to cat into the FIFO:

```

# cat /dev/hdc1 > ftp-fifo

Broken pipe

```

Now I haven't used FIFO's myself before, but this sounded pretty straight forward.

Could anyone point out my errors?

----------

## ydleiF

Actually I think this is veering off the original subject, I'm making my own solution which has it's own little issues, so I'll do a new forum posting, and see what people know.

Thanks for the replies!

----------

## labrador

UDPCAST is a fantastic solution.. Try it.

udpcast is in portage!

We used it to image 4500 laptops with Windows and Linux at my

University.

Here is a web site with more info:

http://udpcast.linux.lu

----------

## epretorious

 *nobspangle wrote:*   

> have a look at acronis true image, it's not free and doesn't boot off of a network, but it lets you create and restore images of disks and it's very quick for drives formated in fat/fat32/ntfs/ext2/ext3/reiserfs

 

Try Mondo. It's flexible; It's free; It's actively supported, and; There's already an ebuild for it.  :Wink: 

----------

## epretorious

 *epretorious wrote:*   

> Try Mondo. It's flexible; It's free; It's actively supported, and; There's already an ebuild for it. 

 

Oops - Although  Mondo-rescue will back-up its files to and restore from an NFS share, the documentation is way out of date, development seems to have slowed to a crawl, and the support leaves something to be desired.    :Sad: 

----------

