
KNOW-HOW Partimage Backing up partitions with Partimage PARTITION TRICKS tasosk, Fotolia tasosk, Protect your system and preserve your configuration with this powerful backup tool. BY KRISTIAN KISSLING inux users love to experiment creates some complications if you want dual boot or start a liveCD. Do not with new kernels, drivers, and to back up a Linux system. The best so- mount the source partition intended for Lprograms, but as you may already lution is to configure the computer for the backup. know from personal experience, things dual boot. Boot the system from one par- can go badly wrong. If worst comes to tition, install Partimage on it, and use Installing Partimage worst, you might have to reinstall the this version to copy the other Linux par- The source code for version 0.6.5 is whole system. tition to the server. As an alternative, available from the Partimage website [3]. Although experienced Linux users typ- you could boot the system using a Live To unpack, copy the archive to a direc- ically take this in stride, the install and CD, such as SystemRescueCd [2], which tory and enter tar -xvjf partimage-0.6.5. the ensuing configuration are time con- still uses Partimage version 0.6.4. tar.bz2 at the command line. Before you suming, and time is a precious commod- In this article, I show you how to get start the build, check first to see whether ity for most people. Why not preserve a started with Partimage. you have fulfilled all the dependencies perfect copy of the system so you can listed in Table 1. restore your original configuration when Negotiations Note that you need the header files something goes wrong? Partimage consists of two components: a (-dev) for the libraries. If you are install- Partimage [1] lets you back up com- server (Figure 2) and a client. The server ing Partimage on OpenSUSE 10.2, you plete partitions – either locally or across runs on the remote machine, where you should read the box titled “OpenSUSE the network. The Partimage backup tool store your backup copy. Up to 10 clients 10.2 and Partimage” before continuing. (Figure 1) supports several Linux filesys- can log in to the server and save their For security reasons, only the parti- tems (including ext2, ext3, Reiser3, and data. Of course, you don’t need a server mag user account is permitted to create XFS), as well as FAT16 and FAT32. Once if you will be creating a local backup. backups on the target machine. You will you finish the backup, you can burn the The first step is to launch the client on need to create a partimag user on both archive to a DVD or CD set and restore the machine you want to back up. In my the source and target systems. your system from disk if disaster eventu- example, /dev/hda7 is the device I need The setup routine will prompt for the ally strikes. to back up. account name at the make install step Partimage does not let you save parti- As I mentioned, you will need to and use the name to create standard tions that are currently in use, and this launch a different Linux version from directories. 60 ISSUE 80 JULY 2007 WWW.LINUX - MAGAZINE.COM Partimage KNOW-HOW Backing up partitions with Partimage PARTITION TRICKS Figure 1: Partimage lets you back up partitions locally or across the Figure 2: The Partimage server listens on the network for client network. input. Before you can run make install, you guarantee secure transfer of your data to the server, the client’s IP address and the need to configure the source code. To do the remote computer. backup path are both shown. so, change to the directory created when The server uses the certificates to you unpacked the archive and enter prove its identity to the client. To set this Client Access ./configure --prefix=/usr to store the up, change directory to /usr/etc/partim- On the client, enter sudo partimage to data in the /usr directory. aged, become root, and enter make cer- launch the client software. On Ubuntu, Assuming the configuration works tificates. The software creates certificates I originally saw the message /dev/ dm correctly, you can then type make to with appropriate privileges below /usr/ inode not found, but pressing Enter a build the binary, before entering sudo etc/partimaged. Typing ls -la shows you couple of times got rid of this message. make install to install. what has happened. In our lab, the message had no effect on The typical approach is to keep press- operations. If the message bothers you, ing the Enter key throughout the instal- Listening Service you can use the following command to lation dialog. You need to do this on It makes sense to launch the server on create the matching device file: both machines. You can then launch the target machine before trying to log Partimage on both PCs – either as the in with the client. Working as root, cre- mknod -m 644 /dev/dm b 240 0 server or as the client. ate a new user. The client logs in with In our lab, I found out that Checkin- the privileges assigned to this account; To run the command automatically stall simplified the installation procedure in this example, the username is kris. when you boot your machine, add the on Ubuntu: Checkinstall automatically To make sure the server will grant kris command to your /etc/rc.local file. builds a package from the source code access, you need to add kris to your After launching the client, you should and then goes on to install the package. /usr/etc/partimaged/partimagedusers see a fairly self-explanatory input dialog Just enter sudo checkinstall instead of file. To edit the file, enter sudo su to use box (Figure 1). To start, specify the parti- sudo make install. the console with root privileges, then tion to back up. As mentioned earlier, Again, setup will ask you for the name launch your preferred editor and add an you need to make sure that the partition of the Partimage user. Make sure you entry for the name. is not mounted. To see which partitions close any package management tools If multiple users will be creating back- are currently mounted, type mount at you have running. ups on the server, you can add entries the command line. In the line below this, for their user accounts – one name per you need the path to the backup direc- Security line. Partimage needs a user with the tory, so enter a name of your choice and It is a good idea to create SSL certificates same name on the target system on add GZ as the suffix. and store them in /usr/etc/partimaged to which the server is running. Server side, you still need to create the OpenSUSE 10.2 and Table 1: Dependencies directories in which you will store your Partimage backups. Make sure you have enough Program Header files Although I was able to build the source free space on the disk to avoid unpleas- code on OpenSUSE 10.2, I was unable OpenSSL libssl-dev ant surprises. You should also modify to access files on the SUSE Partimage Libnewt libnewt-dev the permissions to prevent access to the server from a Ubuntu machine. The Libmcrypt libmcrypt-dev directory by unauthorized users. server wouldn’t let me log on and kept Liblzo liblzo-dev Finally, type sudo partimaged to complaining about an incorrect pass- Libslang2 libslang2-dev launch the daemon – note the d at the word. I was unable to pin down the bug, Libbz2 libbz2-dev despite intensive searching, so I used an Zlib zlib-dev end of the name. A blue background ap- older version of Partimage (version Checkinstall No header file required. pears, showing you the free slots for ex- 0.6.4) as a workaround. ternal access. When a client logs on to WWW.LINUX - MAGAZINE.COM ISSUE 80 JULY 2007 61 KNOW-HOW Partimage Figure 3: Choose your compression level: if you see this dialog box Figure 4: Changing the compression level. You can even change the during a network backup, you know that remote login is working. compression level through the Partimage user interface. To select an action, use the radio but- Options lets you specify whether Parti- launch the server by entering ./partim- ton. To back up a partition, select Save mage should check the partitions before aged start. The partimage file stays on partition into a new image file. The next saving; you can enter a description or the client. step is to specify where the server is lo- disable the prompt, which warns you To launch the client software, type cated and whether you will be using a when you are about to overwrite an ex- ./partimage, again working as root, then secure SSL-encrypted connection. Enter isting version. enter the IP address of the remote ma- the IP address for the machine with the This just leaves one more thing: the chine; there is no need to log on or gen- listening daemon. Clients will use port Image split mode. Partimage will either erate certificates. 4025 to log on to the server by default. If automatically split the image file if it you have a firewall running on the client runs out of space or it will create files Coming Home or server, make sure you modify the of a definable size. Saving a partition on a remote server rules to accommodate this.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages4 Page
-
File Size-