<!doctype linuxdoc system>

<article>
<title>The Partimage FAQ
<author>
    <name>François Dupoux
      <tt><htmlurl url="mailto:fdupoux AT partimage POINT org" name = "fdupoux at partimage dot org"></tt>
  <and>
    <name>Franck Ladurelle 
      <tt><htmlurl url="mailto:ladurelf AT partimage POINT org" name = "ladurelf at partimage dot org"></tt>
</author>
<date>$Revision: 1.5 $ for Partimage version 0.6.2, Jan 19th, 2003. 
<abstract>
Most Frequently Asked Questions about Partimage Version 0.6.2.
</abstract>

<toc> 

<p>
<sect> Reporting bugs
<p>

<sect1> When may I send a bug report?
<p>
When you found something bad but only when you read all this document,
documentation on the web site and archives of mailing lists.

<sect1> What must I include in my bug report?
<p>
You must provide us at least following informations:
<itemize>
  <item>version of partimage (package name and revision)
  <item>what you were doing (give details!)
  <item>what you expected
  <item>what you got
  <item>all details about your partition (file system, size, percent used...)
  <item>log file of partimage and partimaged
  <item>your /proc/partitions file
  <item>output of dmesg
  <item>distribution name and revision
  <item>kernel version
</itemize>

<sect1> Where do I report bugs?
<p>
You should only post into partimage-debug@sf.net list. Avoid posting directly
to authors.

<p>
<sect> General questions
<p>

<sect1> If I make an image file of a partition, can I restore it to an unpartitioned hard disk?
<p>
The current version can only read/write from/to a partition. Partimage doesn't use
the partition table at all. (The Linux kernel reads it, and Partimage can directly
use hda1, hda2, ...). But I'd like to implement this in the future, to allow
users to select partition to save/restore from a list (with name, size,
filesys, usage, ...), and Partimage would be able to create the partition if needed at
restore, or resize it...

<sect1> Can I restore it to a smaller or bigger partition ?
<p>
You can't restore to a smaller partition (you will have an error), but it's
possible to restore to a lager one. In this case, some space will be lost (I
suppose the OS cannot use all the size). Partimage don't have a resize feature, but you can use other tools. I'd like
to add this in the future too. It will allow to restore into a smaller
or larger partition. Indeed, as Partimage is low level it uses data blocks. So resizing is
possible, but that's a complex feature to implement. With some File Systems
made to be easily re-sizable (as NTFS, ext2, ReiserFS), it may be easy, but
with FAT, it's hard to do. For example, when resizing from 1,5 GB to 3 GB,
you must change FAT16 into FAT32... You can use GNU Parted to do it.


<sect1> I need a write support for NTFS. It exists in kernel-2.4,
but it's not enabled in partimage boot disk. How can I use it ?
<p>

NTFS write support, as UFS write support are dangerous and supported only by experimental drivers. It can damage partitions,
and corrupt data. That's why it's not enabled in partimage-bootdisk. Users who
weren't aware of this problem could lose their data if the support was enabled.

If you need the write support, you will have to use another boot disk. Please, have a
look at the question in this FAQ which explains how to build your own boot disk.

<sect1> Partimage says "Segmentation Fault". What does this mean and how can I fix this problem?
<p>

A segmentation fault means that some part of the program was not coded correctly. Report this to authors. Give as many
details as you can (architecture, package version, what you did, /proc/partitions file, output of dmesg, logfiles...).
If you can reproduce the matter, tell us what you did step by step. In any case, if you can, try with -g10 option to
create full log file. We may need your help so don't delete images or don't erase your partition.

<sect1> I have a non i386 architecture machine, will partimage/partimaged work on it?
<p>

Quick answer: no. A bit longer, partimage/partimaged 0.6.x can't work on Big Endian machine. On Little Endian machine,
you may have luck any make it working but you'll be on your own because we won't be able to help you.
If someone has an old SPARC, HP-UX, MIPS or whatever he doesn't use, please, give it to us and we'll be able to make
partimage working on non-i386.

<sect1> Is there a batch mode to use partimage in a script?
<p>

Yes. You just need to use -b (batch) option on command line. You may use something like this:
partimage -b -z3 save /dev/sda9 /mnt/image_sda9.

<p>
<sect> Partimage vs others
<p>

<sect1> What does partimage give you over the following: clear the free blocks with DD, and copy with DD 
<p>dd if=/dev/zero of=/mnt/filetmp ; rm /mnt/filetmp ; dd if=/dev/xxx | gzip > image_file.gz
<p>
<itemize>
  <item>1. Partimage is faster. You don't have to wait for "dd if=/dev/zero" first.
during the copy, free blocks are not read. Then, if 20 % of the partition is
used, partimage will avoid two access to 80 % of the free areas.

  <item>2. There's a GUI (graphical user interface). It has a lot of advantages: you
can see the remaining time, the percentage of the copy, ... The Qt GUI in the
next version will be very nice and easy to use.

  <item>3. Partimage can work on file systems which are not supported (stable write
support) by the Linux kernel, such as NTFS, BSD FFS, XFS/JFS in a non-patched
kernel. To run "dd if=/dev/zero", you need the write support in Linux.

  <item>4. Partimage is made to be easy to use, and to replace commercial software
such as Ghost, Drive Image, ... and the user does not have to know many
command lines.

  <item>5. Partimage has a lot of options, such as -V which allow th create a new
volume if space is missing. DD will show and error and abort.

  <item>6. The network support allows to save an image file from a client, without
having to configure both client and server NFS. (Network File System). When
the multicast will be implemented, it will allow to restore X clients from 1
server, and DD can't do a such multicast copy.

  <item>7. We provide root disk and bootcd. You can boot on it, if Linux is not
installed on your computer. They contains everything that is need (the LZO
compression in 0.7, which is very useful for big files). You don't have all
these tools on every boot rescue systems.
</itemize>

<sect1> Any hope of a browser like utility to allow restoring individual files from the archives?  Like Ghost Explorer?
<p>
Sorry, Partition Image is not a high level program, like Ghost. Ghost makes a file copy, and we obtain a file
in a tar.gz archive, with other details (such as the boot sector). But Partimage works at a low level, as Drive Image: it
copies used blocks of the disk. So, it doesn't know where files are written, and cannot allow to see files in the
image without restoring. But maybe it will become possible in future versions. We will try to make partimage image files
mountable: a driver, such as the loop one, could allow us to make an image file be a block device. If you know how to write
block device drivers, please contact us.

<p>
<sect> About boot systems
<p>

<sect1> A driver is missing in the partimage-bootdisk/bootcd. How can I solve the problem ?
<p>

Many users write us because they can't use the network (or another device). In most cases, the
problem comes from the bootdisk/bootcd which does not support all drivers.

Space is limited in both partimage-bootdisk and partimage-rootdisk. We can't include all drivers
that exists in the kernel sources. That's why only the most common NE2000  cards, and the most
common AIC7xxx SCSI drivers are supported. It provides support for a lot of devices, but some of them
need another driver. For example, 3COM  cards are not supported. There are many ways to solve
this problem:

<itemize>
<item>You can <bf>use another bootcd distribution</bf>, with more drivers, and which can be easily rebuild
with your own options. Two projects provides eltorito bootable CD-Rom with stable versions of partimage:
http://rescuecd.sourceforge.net/ and http://mkcdrec.ota.be/
<item>You can also <bf>replace partimage-bootdisk with a Slackware bootdisk</bf>. Slackware provide a lot of
boot disks, and each of them include a kind of drivers. For example, there's one with all the SCSI drivers,
another with all network drivers, and another with USB support. You can choose the one which will support
your device. The full list of boot disks of Slackware 8 can be find here:
<url url="ftp://ftp.slackware.com/pub/slackware/slackware-8.0/bootdsks.144/">.
<item>You can <bf>compile your own kernel</bf>. That's the best way to be sure all your devices will be supported.
We won't tell you how to compile your kernel here. We will tell you how to use a compiled vmlinuz/bzImage to create
a partimage bootdisk. But first, when compiling your kernel, you must include some options: In the block-devices page,
you must choose Yes for the last four options:
  <itemize>
  <item>Loopback device support
  <item>Network block device support
  <item>RAM disk support with a default size of 40960 (that's not an error) disk size
  <item>Initial RAM disk initrd support.
  </itemize>
 In the File systems,
you must choose Yes for the Minix FS support. In the loadable module support page, you must choose No, in order to
disable modules. After compiling your kernel, you will obtain bzImage. You must type three commands to make it the same thing as
an official partimage-bootdisk image:
  <itemize>
  <item>rdev bzImage /dev/fd0
  <item>rdev -r bzImage 49152
  <item>rdev -R bzImage 0
  </itemize>
</itemize>

<sect1> When I use the bootfloppy, I see an error with 09000900090009000900090009000 on the screen
<p>

I'm having a problem with booting from the bootdisk.

I've created the disk from the partimage-0.3.5-bootdisk-1.raw file, and
when booting, all I see is

 090009000900090009000900090009000900090009000900090009000900090009000900090
0090009000900090009000900090009000900090009000900090009000900090009000900090
0090009000900090009000900090009000900090009000900

all over the screen.

This is a problem when you download the file with Netscape, and the ASCII mode. Try using FTP, or
another tool: type
<bf>wget AdressOfTheFileToDownload</bf>

<sect1> Using Knoppix, Live Linux Filesystem On CD
<p> 

Knoppix livcd <url url="http://www.knopper.net/knoppix/"> provides partimage and partimaged with login and SSL support.
To run them, you need to switch to text console (Ctrl+Alt+F1) because they require root rights. If you want to use partimaged,
you need to set a password for user 'partimag' with passwd command (as root). Then use partimag login when prompted
by partimage.

<p>
<sect> Running partimaged
<p>

<sect1> Where does partimaged save images?
<p>

The path is the one you choose with partimage in "Image file to create/use" on first screen. 2 cases:
1. If you entered absolute path (name starts by a '/'), it will be used as it.
2. You entered a relative path (name starts by anything else than '/'). The path will be related to the one you 
started partimaged from. If you only gave image filename, the path will be the current directory (where you started
partimaged).

<sect1> Partimaged says "Write access is denied". What's wrong?
<p>

partimaged switched to 'partimag' user for security reasons but ion your system, this user can't write in the directory you
choose to save images. You have to change permissions of the directory. Man chmod and chown can help you here.

<sect1> How do I generate certificate/key file for SSL support
<p>
First: run
<itemize>
<item>openssl req -new -x509 -outform PEM > partimaged.csr
<item>openssl rsa -in privkey.pem -out partimaged.key
<item>openssl x509 -in partimaged.csr -out partimaged.cert -signkey partimaged.key
</itemize>

<p>Then, put partimaged.key and partimaged.cert into appropriate directory and chmod them 0600

<sect1> How to run partimaged in chroot environment
<p>
<itemize>
<item>Create a etc subdirectory in the chroot directory and put files in it:
  <itemize>
  <item>/etc/ld.so.conf
  <item>/etc/ld.so.cache
  <item>/etc/passwd
  <item>/etc/shadow
  <item>directory /etc/terminfo
  </itemize>
<item>Create a lib subdirectory and put files into it:
  <itemize>
  <item>/lib/libc.so.6 and its linked file
  <item>/lib/ld-linux.so.2 and its linked file
  <item>/lib/libnsl.so.1 and its linked file
  <item>/lib/libnss_compat.so.2 and its linked file
  </itemize>
<item>Create a dev subdirectory and run mknod tty c 5 0 in it.
<item>If needed, also put partimagedusers, partimaged.key and partimaged.cert
  into appropriate location.
</itemize>

If partimaged --chroot {your directory} doesn't fail, you'll be able to run
partimaged as daemon into chrooted environment with
`partimaged -D --chroot {your directory}'

<p>
<sect> Networking questions
<p>

<sect1> Will it be possible to save images to a Windows(TM) shared directory?
<p>

Not yet. Once we'll have a working boot cdrom we'll try to add this feature via Samba.

<p>
<sect> New  file systems
<p>

<sect1> I use XFS. Does partimage also take things like ACLs and other Extended Attributes 
into account ?
<p>
Yes. Partimage makes a physical copy of the partition. It's not a simple "tar.gz" 
of files. In other words, it does the same work than dd does, but it forget 
to copy all free blocks in order to save space and time. All blocks which are
not marked as free will be copied. Then everything is kept (boot sector informations, 
all attributes that can exist, ...) It even keeps location of files on the disk, 
then the vmlinuz file won't be moved, and LILO will continue to work.

<p>
<sect> ChangeLog 
<p>

<itemize>
  <item> revision 1.1
    <itemize>
      <item>Initial release.
    </itemize>
  <item> revision 1.2
    <itemize>
      <item>Spelling checked.
    </itemize>
  <item> revision 1.3
    <itemize>
      <item>New section: partimage in batch mode.
      <item> Some sections reorganized.
    </itemize>
  <item> revision 1.4
    <itemize>
      <item>New section: reporting bugs.
    </itemize>
  <item> revision 1.5
    <itemize>
      <item>New section: Partimage/partimaged on Knoppix cdrom.
    </itemize>
</itemize>

<sect>Copyright
<p>
Copyright 2002-2003 François Dupoux, Franck Ladurelle.

<p>
We disclaim everything.  The contents of this article might be totally
inaccurate, inappropriate, misguided, or otherwise perverse.

<p>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.1 or any later version published by the Free Software
Foundation; with no Invariant Sections, with no Front-Cover Texts, and
with no Back-Cover Texts.
<p>
<bf>Note:</bf> it's not a call to make this document unusable.
<p>

</article>
