Original Poster: Gagarin Gambit
Remastering with mklivecd is an invaluable tool for Linux operating systems: with it you can copy your entire operating system, including your configuration and personal files, in a CD or DVD and use it and install it in almost any computer. Moreover, PCLinuxOS includes scripts and a graphic interface which make it simple to use.
Here I will illustrate the process of creating a remastered liveCD: what you should consider before making one, tricks that may help you, common issues that might frustrate you.
Reasons to make a liveCD:
- To clone your installation in another machine.
- To backup your installation in the case of hardware failure.
- To backup your installation in the (unlikely) event of system instability.
- To use it as a liveCD in machines other than your own.
- To experiment with system configuration and applications without affecting your actual installation.
The process is the same for all these cases, however there some things to consider depending on your intentions, which will be explained later.
Preparation and considerationsThe first thing to consider is
disk space. The maximum size of a remastered DVD can not exceed 4GB, which means at best a maximum of 12GB uncompressed data. If your installation is bigger than this, you'll have to exclude some data from your remaster; that's easy to accomplish. But still you may want to manually free some space before proceeding: for example if you're using Thunderbird it's a good idea to physically delete the deleted messages (file->compact folders). Or, if you have no use for the preview thumbnails, you may want to delete the hidden .thumbnails folder located in your home (which can get quite large). Remember to empty the trash as well. In addition, when considering disk space, don't forget any heavy applications you may be using under wine; since they are located in a hidden file (.wine in your home) it's easy to miss them. Don't think of emptying tmp; by default it's not included in the remaster anyway.
Obviously before remastering you should also make sure to unmount any device other than your root and home partitions.
There's another aspect of disk space; that's the
temporary disk space. Remastering uses a LOT of space. In order to successfully remaster, you need free space equal to the size of your remaster in your root partition AND in the partition where the final iso image will be created. Remastering first creates the data in tmp; then it uses the data to create the final image. If there's not enough free space you'll need to free some or use a workaround, like, say, saving it into a usb stick. However, if you have limited space in your root partition you're stuck (unless you resize it, but that's another issue).
But if you have lots of RAM there might be a trick to help you in this case. Open the PCLinuxOS Control Center and go to boot->set up boot system->advanced. There you'll see the option to empty the tmp folder at each boot. This, in fact, will cause your system to use your RAM to store temporary files. If you have lots of RAM but few disk space, this might do the trick for you. But, and this is important: in most cases it will cause nothing but trouble and you shouldn't enable it unless you have a good reason. Actually enabling this option is a common cause for remaster failure: if your RAM is less than the size of your remaster, it will fail!
And a final note: for some reason unknown to me, mklivecd is unable to handle files or folders that include gaps in their path. If you have such files that you wish to exclude from your remaster, you should temporary either rename them, or move them inside a folder that will be excluded.
RemasteringYou can begin making your remaster either from the "make LiveCD" entry in your Utilities folder (if you have one), or from the KMenu under System->Make LiveCD. Enter your root password; you'll see a warning message and afterwords you'll be asked if you want to provide advanced options. Unless you intent to remaster your entire home folder, you should answer yes.
Unless you know what you're doing and have a reason to do so, you don't need to change anything in the first window. Choose OK which leads as to the next window:
This is where you can specify which folders or files you don't want to include in your remaster. So if, say, you have a collection of thousands of mp3s you can't expect to put them in a remaster; you'll have to backup them in dvds or usb sticks. The examples provided are pretty self explanatory. Let's say that your user name is kate, and you have two things you need to exclude: your music, located in your a folder named "Music" in your home, and your downloads, located in "Downloads" in your home. In this case this is the command you should input:
--nodir=^/home/kate/Music --nodir=^/home/kate/Downloads
Remember, Linux is case sensitive: Music is different from music!
Moreover, as I already noted, mklivecd is unable to handle files and folders including gaps in their path. If, for example, your music is located in a folder named "My Music" you can't type "--nodir=^/home/kate/My\ Music", using a backslash as you would normally do in a terminal. Similar ways, like using an asterisk, also don't work according to my experience. So, the only workaround is to temporary rename these folders/files, or move them in another directory to be excluded.
Beware, any mistake here will cause your remaster to fail!
After you have entered the folders and files to be excluded, all you need to do is to select where to save the resulting image. The default location is under root; it's better to select a location like your home where you'll have immediate access to it. Disk space considerations may also be important for you.
Now the remastering begins. Be patient; according to your machine and size of the remaster, it will take from several minutes up to more than an hour. If everything goes well, you'll have an iso image which you can burn to a dvd (or a cd if it's small enough) using an application like K3b; otherwise you'll get a message notifying you that something went wrong.
If your remaster is a success, you may want to try it, just to make sure that it works exactly as you expect.
Common causes of failure- You have entered wrong commands. In this case the process will probably fail almost immediately. If you're excluding lots of stuff it's easy to make a mistake, you may want to type them in a text editor and then paste them.
- The resulting iso might exceed the 4GB limit. In this case you'll have to exclude more data from your remaster.
- You don't have enough temporary disk space. The "clean /tmp at each boot" option is especially tricky. Above is explained what can be done about it.
In the later two cases, failure will occur after some time of remastering.
Usage of the liveCDDepending on what you intend to do with your remaster, there are some things you'd have to consider:
Usage as a liveCD, with no intention of installationIf you try to use your remaster in a machine other than one that you used to create it, you'll probably have to select a safe video mode option during boot, otherwise you might end up in a command line mode.
Moreover, if you intend to carry it with you, it's a good idea to disable automatic login in (in the pcc under boot->set up autologin). In case your remaster falls into the wrong hands, you wouldn't like anyone browsing your personal files...
Usage as a backup in the event of hardware failure/clone to another machineAgain, you should probably use a safe video option to boot. To install, you have to use the command "/usr/sbin/draklive-install" in a terminal window. It's more convenient if you create a shortcut before remastering; I have one in my Utilities folder. Just make sure not to use it in an installed system!
Usage as a backup in the event of system instability.That's unlikely with PCLinuxOS, and if it happens you'll probably find a solution in this forum. But there are occasions that you might expect the risk of an update breaking something in your system; in particular if you haven't updated for a long time (and especially in an event similar to the big update), and if you're about to update your kernel. The difference for this kind of backup is that you should exclude your entire home folder. Then, when you're about to install, choose to use the existing partitions and make sure that only the root partition will be formatted. This way your home partition with your setting and documents will remain intact. If, on the other hand, you install from a remaster including your home folder, any new files you've added since the remaster will stay, but any other files that have been modified (especially configuration files) will be overwritten by the installation, reverting them to where they were at the time of remastering.
It's a good policy to make remasters at least monthly, as backups. Since you'll be performing the same tasks, you may want to create a txt file including your options; an experienced user may even want to create a script performing the remaster.
Good luck!