Hi all.
I have seen this question on multiple occasions. “My PCLinuxOS works just the way I wanted it to and I want to back it up… How do I create ISO from it?”. Today I have decided to show You how I do it.
First step: Check that You have drakx-finish-install installed. Issue this command:
rpm -qa | grep drakx-finish-install
If the output looks something like this:
[andrzejl@wishmasbell ~]$ rpm -qa | grep drakx-finish-install
drakx-finish-install-12.80-2pclos2011
[andrzejl@wishmasbell ~]$
You are good to go – if not issue this command:
su -c "apt-get update && apt-get --yes install drakx-finish-install"
give it a root password and some time to finish and then run
rpm -qa | grep drakx-finish-install
again. This time system should indicate that the package is installed.
Second step: Check for a free space. Issue this command:
df
The output will look something like this. Of course You can have less (or more…) partitions mounted in different mount points but You will have at least one / partition.
[andrzejl@wishmasbell ~]$ df
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 25G 19G 5.1G 79% /
/dev/sda6 9.9G 8.8G 1.1G 89% /home
/dev/sda7 37G 35G 895M 98% /media/Disk_1
/dev/sda8 37G 33G 2.4G 94% /media/Disk_2
/dev/sda9 20G 9.9G 8.9G 53% /media/Disk_3
/dev/sdb1 74G 26G 44G 37% /media/Disk_4
[andrzejl@wishmasbell ~]$
Now You can see which disk has enough space in it to create iso. In my case it’s the /media/Disk_4 because it has 44 GB of space available.
Now let’s say I want to remaster to this partition to the folder Remaster. and that I want to have all my data included…
Third step: Prep the folder and the remaster command. Run this commands:
su
Give root password and then run this command:
mkdir /media/Disk_4/Remaster
This will create folder folder where we will find out iso later. Don’t close this terminal window.
Now for the remastering command:
mylivecd --xz --nodir ^/media/Disk_4/Remaster/ --tmp=/media/Disk_4/Remaster/ --md5sum --ufs unionfs /media/Disk_4/Remaster/my.iso
— mylivecd – script that will remaster the PCLinuxOS to the iso file.
— xz – this will specify the compression method (there are other as well read mylivecd –help if You want to know more).
— nodir – this folders will not be added to the iso.
— tmp – this will be our temporary folder for the mylivecd process.
— md5sum – this will embed md5sum in the iso.
— ufs – this will specify the union file system.
— /media/Disk_4/Remaster/my.iso – this specifies where iso will be written.
So… in general this commands should look something like this:
su
mkdir /whatever1/whatever2
mylivecd --xz --nodir ^/whatever1/whatever2/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
If Your installation is not massive and bloated after running this command it should create a remaster iso. Sometimes however You will receive error like this one:
mylivecd, version 0.9.4, http://pclinuxos.com/
Copyright (C) 2010, TexstarThis program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.Disabling Services not needed on the LiveCD
running: /sbin/chkconfig –list
running: /sbin/chkconfig –list
running: /sbin/chkconfig –list
running: /sbin/chkconfig –list
running: /sbin/chkconfig –listCreating initrd: [100.00% 00:00:07/00:00:07]
Setting filesystem parameters: [100.00% 00:00:04/00:00:04]
Creating compressed image: [100.00% 00:14:10/00:14:10]
Creating isolinux boot: [100.00% 00:00:01/00:00:01]
Creating final iso: [100.00% 00:00:00/00:00:00]Restoring Services on the installed system
ls: cannot access whatever.iso: No such file or directory
Argument “” isn’t numeric in division (/) at /usr/sbin/mylivecd line 244.Created ‘whatever.iso’ (0,000 bytes) in 00:14:25
This happens if You try to add to much to Your iso. Mylivecd command can create iso of a maximum size 4.3 GB (single layer DVD size). If You want to remaster Your installation You will have to exclude some data out of it. Now… If You have few partitions and You only want some of them added You can exclude the rest of them by adding them to the nodir part of the command.
Let’s see…
[andrzejl@wishmasbell ~]$ df
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 25G 19G 5.1G 79% /
/dev/sda6 9.9G 8.8G 1.1G 89% /home
/dev/sda7 37G 35G 895M 98% /media/Disk_1
/dev/sda8 37G 33G 2.4G 94% /media/Disk_2
/dev/sda9 20G 9.9G 8.9G 53% /media/Disk_3
/dev/sdb1 74G 26G 44G 37% /media/Disk_4
[andrzejl@wishmasbell ~]$
All I want in my iso is my / and my /home and I want to skip all the rest of the partitions…
The remastering command will now look something like this:
mylivecd --xz --nodir ^/whatever1/whatever2/,^/media/Disk_1/,^/media/Disk_2/,^/media/Disk_3/,^/media/Disk_4/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
as You can see I have excluded 4 partitions.
The rule of thumb for adding new exclusions is: ,^/where/is/it/mounted/
mylivecd --xz --nodir ^/whatever1/whatever2/,^/where/is/it/mounted/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
If You want to exclude just one user’s home from the entire /home partiton add ,^/home/oneuser/
mylivecd --xz --nodir ^/whatever1/whatever2/,^/home/oneuser/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
If You want to exclude Your entire /home partition add ,^/home/
mylivecd --xz --nodir ^/whatever1/whatever2/,^/home/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
If You want to exclude folder /whateverXyZ/whateverAbC add ,^/whateverXyZ/whateverAbC/
mylivecd --xz --nodir ^/whatever1/whatever2/,^/whateverXyZ/whateverAbC/ --tmp=/whatever1/whatever2/ --md5sum --ufs unionfs /whatever1/whatever2/whatever.iso
After properly adjusting Your command You should be able to create a good working iso. Try it in a VirtualBox before You will burn it to the CD / DVD. Sometimes remaster process creates unusable iso and I wouldn’t want You to create a whole bunch of coasters before You will get it right.
Now to get the md5sum file:
I assume that You created the iso in /whatever1/whatever2/whatever.iso location.
Issue those commands then:
cd /whatever1/whatever2/
md5sum ./whatever.iso > ./whatever.md5sum
This will create the whatever.md5sum in the /whatever1/whatever2/ folder. The file will contain the check sum of Your iso.
Example:
[andrzejl@wishmasbell whatever2]$ cat ./whatever.md5sum
d784fa8b6d98d27699781bd9a7cf19f0 ./whatever.iso
[andrzejl@wishmasbell whatever2]$
Hope this helps somebody someday.
Regards.
Andy
EDIT: It was brought to my attention today that some of You might have spaces in the mount point paths. Example:
/dev/sda7 37G 35G 895M 98% /media/Windows 7
If You want to exclude this mount point from the remastering process You need to add before the space in the command like this:
--nodir ^/whatever1/Windows 7/
otherwise You will receive FATAL: Too many command-line arguments. error.
Regards.
Andy