Remastering Your PCLinuxOS (creates ISO from a current installation)…

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, Texstar

This 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 –list

Creating 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

Texstar says: Time to upgrade your kernel

Hi all.

Few hours ago Texstar wrote:

Please be advised if you are running a kernel older than what was present on our 2010.12 (2.6.33.7) release then it is time to install an updated kernel. Failure to do so can result in possible boot failures on an upgraded system.

The most recent kernel available is version 2.6.38.8. The default kernel we are using is the 2.6.38.8.bfs kernel. All you have to do is mark it for installation and click apply. Please do not mark and remove your existing kernel.

Please note on first boot of a new kernel you will need to give it a few minutes to complete building some dynamic kernel drivers. Please allow it to complete this transaction before it proceeds to the desktop. Your computer has not hung up. Please do not press the reset button. You can press esc once the bootsplash appears on the screen if you wish to watch it in verbose (text) mode.

Just passing the words.

Andy

PCLinuxOS 2011 with the xorg 1.10.2 and the old radeon cards…

Hi all.

I checked last night will the “Fix for old Ati cards under PCLinuxOS 2011 with the xorg 1.9.5” work with the new xorg 1.10.2 and the answer is YES! 3D works perfectly well. Neverwinter Nights, Morrowind, Quake 3 Arena games are still working fine. 3D KWin Desktop Effects are working fine as well.

The only problem I have noticed is that there are some tiny glitches when KDE4 starts and when You minimize and maximize Thunderbird from the tray.

Regards.

Andy

Adding and running Irssi perl scripts. [ShortenURL.pl]

Script fixed by TerryN! Thanks Dude! Howto amended.

Hi all.

This is an addition to my “Adding and running Irssi perl scripts. [Nicklist.pl]” post so please read it before following this HOWTO.

Ok… I love Irssi. Its my favorite IRC client BUT it has at least two major annoyances IMHO. First one is the lack of the users list which I solved by using the “Nicklist.pl” script. Second is the way that URLs are handled. Irssi is indenting the text so the conversations are very easy to read and they look great BUT it breaks the links. <<< Read EDIT1. If You are a Irssi user and You use nicklist script You will know what I mean. It looks like only a part of link is active. How to fix the long links issue? Shorten the links. How? By using ShortenURL.pl script. How? Let me show You ;).

Close Irssi and run (copy & paste) this command:

rm -f ~/.irssi/scripts/shortenurl.pl && rm -f ~/.irssi/scripts/autorun/shortenurl.pl && mkdir -p ~/.irssi/scripts/autorun && cd ~/.irssi/scripts/ && wget -c http://andrzejl.cyryl.net/WoTW/WoTW_files/shortenurl.txt && mv ~/.irssi/scripts/shortenurl.txt ~/.irssi/scripts/shortenurl.pl && cd ~/.irssi/scripts/autorun/ && ln -s ../shortenurl.pl

Start Irssi.

Now run this command (it’s a shortenurl.pl specific command – find out more by reading the script itself) in irssi:

/set shortenurl_autoconvert_minlen 10

Final step: Close irssi. Start screen session. And re-run irssi. Join any channel of Your choice 🙂 and wait for someone to post one of those long links again :).

Thanks to the script author and to TerryN!

Hope this helps somebody someday.

Andy

EDIT: I just checked and it’s the nicklist.pl not the Irssi’s indentation that breaks the links. Sorry. My bad. If You don’t use the nicklist perl script Your URLs will not break. However I like my users list to much to get rid of the script plus the shortenurl script really does takes care of the issue.

KResource Migration Tool annoyance… and how to get rid of it.

Hi all.

If You have followed my “Stopping the darn akonadi server…” post sometime ago You may experience an annoyance when booting to the KDE4 desktop after upgrading to the kdepim 4.6.0.

KResource Migration Tool will harass You every time You log into the KDE and want to use Akregator or other part of the kdepim.

KResource Migration Tool annoyance...

There is a simple fix:

A) Check the status of the akonadi server by issueing this command:

akonadictl status

[andrzejl@wishmasbell ~]$ akonadictl status
Akonadi Control: stopped
Akonadi Server: stopped
Akonadi Server Search Support: not available
[andrzejl@wishmasbell ~]$

B) Edit file ~/.config/akonadi/akonadiserverrc and change the value of the StartServer from false to true. Save the file.
C) Reboot.
D) Check the status of the akonadi server by issuing akonadictl status in konsole. This time it should say that it’s running.
E) Start akregator or other kdepim app. This time migration should end with Successfull message.
F) Follow the post about “Stopping the darn akonadi server…” again.
G) Reboot.

This time it should not harass You anymore.

Hope this helps to somebody someday.

Andy

Attention: aptupgrade required for all users of PCLinuxOS

Hi all.

Just passing the news.

Yesterday almost at midnight of GMT Texstar wrote:

Please be advised all users of PCLinuxOS will need to install and run aptupgrade when it appears in the software repository. This script will upgrade your PCLinuxOS system to the latest rpm, apt-get and Synaptic Package Manager. This update cannot be performed through the Synaptic Package Manager. Another notice will be posted when the package is available for installation. If you fail to install and run aptupgrade, your Synaptic Packager Manager will eventually fail to run as the new file list created by the updated apt-get is not backward compatible with the old apt-get file list. This is the easiest solution to avoid requiring everyone to do a clean installation.

Eventually yum and YumEx frontend will appear as an alternative Package manager but creating the repository list for it at this time is non-functional.

Just passing the words.

Andy

Fix for old Ati cards under PCLinuxOS 2011 with the xorg 1.9.5

Hi all.

I own this card:

[andrzejl@wishmasbell ~]$ lspci | grep VGA
01:05.0 VGA compatible controller: ATI Technologies Inc Radeon XPRESS 200M 5955 (PCIE)
[andrzejl@wishmasbell ~]$

After upgrading to new xorg 1.9.5 the card lost all of it’s 3D power. I searched and tried different options… but to now avail… Today I have joined #radeon channel on Freenode IRC network and after many hours thanks to BioTube and Dresto I have found out few things… Radeon module is loading to late – it’s loading after X is started – hence it’s not used – that’s one. Second – modeset for radeon is set to 0 by default…

Guys from the #radeon channel helped me a lot. Really – without them – there would be no post today. Thanks guys! I had to figure out how to load radeon module before X starts myself ;). I am proud of myself ;).

Ok… Here is what needs to be done in order for the old Ati cards running on “ati” driver to be able to run decent 3D again.

Fair warning. This HowTo is written for advanced users. You may bork Your system if something goes wrong. HowTo is written in the best way it could be. If something will get messed up – it’s more then likely Your deed. Don’t blame me. I will not be responsible.

su

cat /etc/X11/xorg.conf | grep iver

The output of this command should be Driver “ati”

Now move old xorg.conf somewhere safe:

mv /etc/X11/xorg.conf /etc/X11/xorg.conf.oldie

Now setup Your card using the correct values.

drakx11

Now edit the /etc/modprobe.preload file as root and add radeon as a last line so it looks something like this:

[andrzejl@wishmasbell ~]$ cat /etc/modprobe.preload
# /etc/modprobe.preload: kernel modules to load at boot time.
#
# This file should contain the names of kernel modules that are
# to be loaded at boot time, one per line. Comments begin with
# a `#’, and everything on the line after them are ignored.
# this file is for module-init-tools (kernel 2.5 and above) ONLY
# for old kernel use /etc/modules
fuse
sbp2
ohci1394
i8k
nvram
tifm_7xx1
evdev
evdev
radeon
[andrzejl@wishmasbell ~]$

Now edit /etc/modprobe.conf file as root and add options radeon modeset=1 so it looks something like this:

[andrzejl@wishmasbell ~]$ cat /etc/modprobe.conf
install scsi_hostadapter /sbin/modprobe sata_uli; /sbin/modprobe pata_ali; /bin/true
install ide-controller /sbin/modprobe ide_generic; /bin/true
install usb-interface /sbin/modprobe ehci_hcd; /sbin/modprobe ohci_hcd; /bin/true
options radeon modeset=1
[andrzejl@wishmasbell ~]$

Done editing the files? Ok – reboot. During the reboot You will experience a black screen for a few seconds. DON’T PANIC. Soon after that KDE4 should be loaded. The black screen shows up because the radeon module is being modprobed.

After the reboot glxgears will show values equal to Your screen refresh rate. Don’t mind that. Try playing some 3D game…

I can now play Quake 3 Arena again with FPS around 30. Before I was only getting 2… UH UH Neverwinter Nights and Plants vs Zombies are working fine too.

Hope this helps somebody some day.

Andy

EDIT: I have edited the post (which makes the fix much easier to apply) thanks to Texstar who pointed out to me that it’s no longer required to rebuild the initrd file after You add something to the /etc/modeprobe.conf file. I tested it on 2 other of my Ati based laptops. Solution works. Also – I hear from Marcin82 on the PCLinuxOS Forum that upgrading to a new kernel will not break this fix. Now I am fully happy ;). Elder Scrolls Morrowind works again under PCLinuxOS. :D. I also tried the 3D effects like Desktop Cube and Cover Switch. No prob… Seems like this fix is really successful.

Cloning PCLinuxOS to a new drive…

Hi Folks.

I have decided to share with You a method of cloning PCLinuxOS instance from one drive to another. There idea came from Cyryl and the whole HOWTO is just a translation with screenshots and little changes. I used it twice so far – both times successfully however I must WARN You – Your brain needs to be in the ON position when following this. No it’s not very difficult BUT if You won’t do it correctly You will loose all Your data.

So… Fair warning – this HOWTO is written for a bit advanced users or noobs who are not afraid to learn by borking like myself.

Let me tell You a bit about the situation that I have here before I will go any further. As You probably know I own a few laptops. Recently I have purchased a 160 gigs 2.5 inches HDD and I have decided to replace my main machine HDD with it. I could do the remaster of the 80 gigs drive and then install it on the 160 gigs drive. I could BUT… Remaster is limiting the size of the transferred data to 4.3 GB plus remaster skips some of the /var/ files. My installation was rather large so… I decided to use this method.

What I did first was I took out the 80 gigs HDD from the Packard Bell and placed it in the USB external case. Then I have assembled the laptop with a 160 gigs HDD inside and booted it from LiveCD. First thing done. Next thing is to create a partitions on the new HDD. We are going to need at least two partitons – root / and swap. I always add one extra partition for the /home and if there is any place left I add another one or two for my data. Partitions that You create on the new HDD must be at least the same size of the partitions that You want to clone to them. They can be bigger. They can’t be smaller. After creating new set of partitions I rebooted and booted to LiveCD again. When KDE4 was fully loaded I plugged in the 80 gig drive in the USB case to it. No drives were mounted. No drives should be mounted. You don’t need the USB case. It’s easily done with desktop HDDs as well. If You are an advanced user You will know what I mean. NO I do not mean to plug the HDD when the computer is running. I did it once several years ago – all I saw was a smoke coming out from the HDD. That was it. HDD went to the bin. Be careful and make sure You know what are You doing! Ok LiveCD is booted up. KDE4 is loaded. 160 gigs HDD is inside the lappy and 80 gigs HDD inside the USB case is plugged in and detected. No drives are mounted. Now using a set of few command I have cloned the 80 gigs / and /home partitions to the 160 gigs / and /home partitions. When this was done I unplugged the 80 gigs drive from the USB port. Next thing I did was checking the partitions and resizing them. Why? Cloning copies everything and makes the partition look like the one I had on the 80 gigs. Since I made partitions on the 160 gigs bigger I need to re-size them to their normal size. When this was done I had to setup grub and reboot. This time I booted from 160 gigs. First thing I have noticed was a “Timeout 1 min” problem for the cloned HDDs. It really took 2 minutes of just standing and looking at it. Then when the /dev was filling laptop rebooted. Ok… No problem. It booted to the KDE4 no problem this time – altho I still had to wait for 2 mins with the HDD timeout. No problem – there is cure for this. When the KDE4 was fully booted I had to mess around a bit with few things like HDD mounting and labeling, regenerating initrd file, adding swap to the /etc/fstab. Nothing to difficult. After all the final touches system was up and running and it had everything I needed and wanted. Super sweet Dude!!

So now I have 80 gigs HDD laying around collecting dust. 60 gigs HDD in a USB case. And 10 gig HDD in the Dell Latitude C610 machine. Yeah… 10 gigs… Ok that needed to be changed… No rush. In the future. Today I spoke to a good Friend of mine and I told Him about my little adventure. He told me that He could use this method to copy His massive install into a new drive. From one word to another I have decided to write a HOWTO for my blog. Reasons? Anybody will be able to use it and it will keep my head busy which is a good thing lately.

So… Here is the second time I did it.

Just like before. I took out the old drive from the machine and placed a new one in it. Then I booted from LiveCD and created set of partitions. Rebooted from LiveCD with the old drive plugged in as well. Cloned / checked / re-sized partitions and setup a grub. Then after booting from the cloned drive I mounted and labeled all the hdds, redid initrd to remove timeout problem and added swap entry and voila… second computer is done.

So now 80 gigs is in the USB case, 10 gigs waits for a 2nd USB case which I have purchased on eBay from a guy at Hong Kong for less then €6 including shipping. All is good.

Now that You know the background and all the fair warning it’s time to cut to the chase.

Preparing the partitions on the new HDD:

Boot from a LiveCD and start a konsole.

When the konsole window appears type in pcc and press [ENTER]

You will be asked for a root’s password. As You can read from the top right corner of the wallpaper its root.

PCLinuxOS Control Center will start up. Click on Local disks in the left pane. Now click on Manage disk partitions.

Now You can see the sda drive – in my case its completely empty. If You want to get rid of old partitions click Clear all below the drive info. Now click Toggle to expert mode in the bottom right corner.

You can see that the info section has been extended about some extra information. Now click on the long whitish rectangle representing an empty drive.

Info has changed and the Create button in the right pane appeared. Click on it. We will create the / root partition now.

Create a new partition window appeared. It has some data in it. What You need to change is the Size in MB value. Remember to make it either the exact size of the old root / partition or bigger.

It cannot be smaller otherwise the cloning process will fail due to the lack of space. Also remember that 1 gig = 1024 megs. In my case I will use 20 gigs root / partition so the number of megs I type in is 20480. Now press Ok.

Notice that the white rectangle is now divided into 2 rectangles. Smaller on the left. It’s the partition You have just created. You can check if You did everything correctly by reading the info below the partition.

Make sure that the focus is on the created sda1 partition by clicking on it and then click Format in the right pane. You will be asked about partition table to be written to the disk. Click Ok.

Check for bad blocks question will pop up. I tested my drive with HDD Regenerator sometime ago. I know it has no bad sectors so I clicked No. If You want to test the drive click Yes but be aware that it will take long time.

Drive is now being formatted. Wait till the process is finished.

Drive has now finished formatting. It’s time to create another partition. Click on the white rectangle on the right. This is the unpartitioned part of the drive. Click on Create button.

Create a new partition window appeared. It has some data in it. What You need to change is this time is the Size in MB value and Filesystem type. This will be our swap partition. Typical size of a swap partition will be equal to the 4 times amount of Your Ram memory but not bigger then 2 gigs. I recommend 2 gigs for most of the setups and that’s how much I will use here as well.

Remember that 1 gig = 1024 megs. In my case I will use 2 gigs swap partition so the number of megs I type in is 2048.

Now click on the expandable list next to the Filesystem type entry to make it drop down. Top left – Linux swap. Click on it.

Now press Ok.

Notice that the white rectangle is now divided into 3 rectangles. Small on the left. Smallest in the middle – its the swap partition You have just created. You can check if You did everything correctly by reading the info below the partition.

Make sure that the focus is on the created sda5 partition by clicking on it and then click Format in the right pane. You will be asked about partition table to be written to the disk. Click Ok.

Check for bad blocks question will pop up. I tested my drive with HDD Regenerator sometime ago. I know it has no bad sectors so I clicked No. If You want to test the drive click Yes but be aware that it will take long time.

Drive is now being formatted. Wait till the process is finished.

Drive has now finished formatting.

You can see that it says Formatted in the partitions info.

It’s time to create another partition. Click on the white rectangle on the right. This is the unpartitioned part of the drive. Click on Create button.

Create a new partition window appeared. It has some data in it. What You need to change is the Size in MB value. Remember to make it either the exact size of the old home /home partition or bigger.

It cannot be smaller otherwise the cloning process will fail due to the lack of space. Also remember that 1 gig = 1024 megs. In my case I will use 10 gigs home /home partition so the number of megs I type in is 10240. Now press Ok.

Notice that the white rectangle is now divided into 4 rectangles. Another partitions in now created. You can check if You did everything correctly by reading the info below the partition.

Make sure that the focus is on the created sda6 partition by clicking on it and then click Format in the right pane. You will be asked about partition table to be written to the disk. Click Ok.

Check for bad blocks question will pop up. I tested my drive with HDD Regenerator sometime ago. I know it has no bad sectors so I clicked No. If You want to test the drive click Yes but be aware that it will take long time.

Drive is now being formatted. Wait till the process is finished.

Drive has now finished formatting. You can see that it says Formatted in the partitions info.

It’s time to create another partition. Click on the white rectangle on the right. This is the unpartitioned part of the drive. Click on Create button.

Create a new partition window appeared. It has some data in it. What You need to change is the Size in MB value. I will not be cloning this partition so the size is not that important.

This partition will be used as a extra data (photos, documents) partition. I will use the remaining drive space by clicking on the little arrow in the box next to Size in MB. Now that the arrow is grayed out I know that I used the entire disk space. If You want You can create few smaller partitions instead of one big. Just repeat the steps as before. Press Ok.

Notice that the white rectangle is now divided into 4 rectangles. Another partitions in now created. No more space is left. You can check if You did everything correctly by reading the info below the partition.

Make sure that the focus is on the created sda7 partition by clicking on it and then click Format in the right pane. You will be asked about partition table to be written to the disk. Click Ok.

Check for bad blocks question will pop up. I tested my drive with HDD Regenerator sometime ago. I know it has no bad sectors so I clicked No. If You want to test the drive click Yes but be aware that it will take long time.

Drive is now being formatted. Wait till the process is finished.

Drive has now finished formatting. You can see that it says Formatted in the partitions info.

The disk is now prepared for cloning data onto it.

You can toggle between the partitions by clicking on the segments of the white horizontal rectangle.

Summary.

We have created 20 gigs root / partition sda1 and formatted it with Ext4 file system.
We have created 2 gigs swap partition sda5 and formatted it with Swap file system.
We have created 10 gigs home /home partition sda6 and formatted it with Ext4 file system.
We have created 23 gigs data partition sda7 and formatted it with Ext4 file system.

Click Done button in the right bottom. You will be asked for fstab modifications. Click Yes.

Close the PCLinuxOS Control Center window.

Close the Konsole window.

Restart the machine.

Now if You are using desktop it’s better to shutdown machine so You will have a chance to connect the old drive. Test that the drive is detected by bios. Now boot the machine from LiveCD.

If You are using laptop with one drive in the box and one drive in a USB case You can reboot the machine and boot to LiveCD again. After choosing the keyboard wait for the KDE4 to load completely and then plug in the drive to the USB port. Device Notifier will report that the drive was connected. Ignore it. Do not mount any drives.

Click on the KMenu and open a konsole window.

Done? Good.

Open another one.

Done? Good. In first konsole type in su and press [ENTER]

Now type in the root’s password. It’s root.

Now do the same thing in the second konsole window.

Now that both konsole windows have root privilages in the second window type in fdisk -l (small L letter) and press [ENTER]. A lot of info will be shown – don’t panic. On my screenshot its divided into two sections. Highlighted and not highlighted. If You will read into it You will notice that the highlighted section is nothing else but info about my old 10 gigs HDD. It has 2 partitions that are of interest to me. /dev/sdb1 which is my old root / partition and /dev/sdb6 which is my home /home partition. It also has /dev/sdb5 partition which was my old swap – there is no reason for cloning it. There is also /dev/sdb2 partition – marked as Extended. I will not be explaining why it’s there. If You know – good. If You don’t… You will find out in the future adventures with Your PC.

The most important info from the highlighted section is.

A) This is the drive we will be clonning from
B) /dev/sdb1 = old root /
C) /dev/sdb6 = old home /home

Now lets look at the not highlighted part. Analogically:

A) This is the drive we will be clonning to
B) /dev/sda1 = my new root /
C) /dev/sda6 = my new home /home

Examine Your output of the fdisk -l command. Make sure You understood everything. If not – go back and read my HOWTO again and again until You do.

Ok if You are still reading it means You understood everything. let’s continue.

In the first konsole I will type in

dd if=/from of=/to

from fdisk -l we know that from = /dev/sdb1 to = /dev/sda1 analogically the command will look like this:

dd if=/dev/sdb1 of=/dev/sda1 & pid=$!

dd is a command that clones the media. It does not looks what it does. It does not asks. It’s Your responsibility (not mine) to give a correct info to the command or You WILL loose all Your data. Just a fair warning. Got it all figured out? Command written? Ok then press [ENTER].

I used dd command in a way that will make it work in a background. Why? So we can check its progress by using command:

kill -USR1 $pid

You can do it as many times as You want. Sometimes it looks like the above command is stuck. Just press [ENTER] to go back to the root prompt.

It may take a long time to copy the partition. Do not unplug the USB cable. Basically leave the machine alone until it has finished copying.

Here is the message that dd has finished copying.

Confirm it… by using kill -USR1 $pid one more time. If it says No such process – it’s done.

Type in clear and press [ENTER]. Ready for round number two? Now we are copying /home partition. I won’t be explaining the whole syntax again.

Command I used this time was:

dd if=/dev/sdb6 of=/dev/sda6 & pid=$!

I used dd command in a way that will make it work in a background. Why? So we can check its progress by using command:

kill -USR1 $pid

You can do it as many times as You want. Sometimes it looks like the above command is stuck. Just press [ENTER] to go back to the root prompt.

It may take a long time to copy the partition. Do not unplug the USB cable. Basically leave the machine alone until it has finished copying.

Here is the message that dd has finished copying.

Confirm it… by using kill -USR1 $pid one more time. If it says No such process – it’s done. Now if You are using desktop just continue with the howto. If You are using laptop with one HDD inside and another in a USB case – You can unplug the USB cable. We won’t need the old HDD anymore.

In the first konsole type in clear and press [ENTER]. Ready for round number three? Now we are checking partitions and resizing them.

First my root / partition:

fsck -f /dev/sda1

Second my home /home partition:

fsck -f /dev/sda6

Remember that You need to adjust the commands to Your needs. When I was cloning the drives for the first time fsck asked me about some data in the journal and do I want to continue. I pressed y to confirm. The second time during writing this howto it did not asked. It may ask You but there is no general rule about this. If it does just press y.

Now in the second konsole window type in clear and press [ENTER].

Type in fdisk -l (small case L) and press [ENTER]

After unplugging the USB case – there is only one drive left in my laptop. It’s the 60 gigs HDD with my new root / and home /home partitions.

Good.

Now go back to the first konsole window and type in:

resize2fs /dev/sda1

and press [ENTER]

When its done type in

resize2fs /dev/sda6

and press [ENTER]

Drives are now re-sized and ready to be used.

Now we need to take care of the grub.

Type in grub in the first konsole window and press [ENTER].

When grub is loaded type in:

find /boot/grub/menu.lst

and press [ENTER]

Grub says hd(0,0)

This means that the first hdd on the first partition has a file we want. That’s a good sign.

We will set the root partition now. My root partition is a first partition of the first drive (grub is taking a 1 from the numeration that is why it says 0,0 as a location).

Type in

root (hd0,0)

and press [ENTER]

Now we will setup grub on our disk.

Type in:

setup (hd0)

and press [ENTER]

after a sec or two grub will finish and You will see it prompt ready and a whole bunch of info above it. If it looks anything like on my screenshot – You are good to go.

Type in:

quit

and press [ENTER].

This will close grub editor. Close both konsole windows and reboot. You can remove LiveCD from the drive and boot from the new – cloned HDD.

Now that the hdd has been cloned and You are booting to the system press [ESC] when the Plymout is shown. You should see a 1 minute delay for drives sda1 and sda6. The machine can even restart itself while booting. Happened to me so I am just warning. After the 2 minutes of waiting the machine should boot right into the system.

Now that we are inside our cloned system there are some final touches that You need to do before system is fully usable.

Open terminal window and use su command to gain root.

Type in pcc and press [ENTER].

PCLinuxOS Control Center will open. Click on Local disks in the left pane.

Now click on Manage disk partitions.

This will load partition manager we worked with before.

Click on Toggle to expert mode.

Click on the sda5 partition – it’s our swap. Check the details below the rectangle representing partitioned drive. In my screenshot swap drive is green but it may be gray in Your machine. Depends on the gtk theme used. Anyway click on swap partition and click Format in the right pane.

Click Ok on the warning popup.

Again… if You feel drive may contain bad sectors press Yes. I will press No.

Now click on the data partition (the one on the right) and click Unmount in the right pane.

The partition is now unmounted and we gained access to a few more options.

Click on the Mount point button. It offers /var by default.

Change it to /media/Data_Disk_1 or something similar.

On the red rectangle I now have the path to where the drive will be mounted by default.

Click on the Label button in the right pane. Type in Data Disk 1 and Ok the window.

Click Mount button in the right pane.

Drive is now mounted.

Click Done. Click Yes when asked about fstab entries.

Close the PCLinuxOS Control Center window.

Now about the delays… PCLinuxOS and wise Old-Polack has a solution for this

First I will remove the current initrd file using rm command as root in the terminal…

rm /boot/initrd-2.6.38.7-pclos1.bfs.img

Confirm when asked by pressing y.

Now we need to regenerate the deleted file. In my case the command will look like this.

mkinitrd -v /boot/initrd-2.6.38.7-pclos1.bfs.img 2.6.38.7-pclos1.bfs

It may look slightly different in Your case. Read Old-Polack’s post for more details.

The command may take a bit of time to finish.

Now we need to give ourselves permissions to read and write to the data disk. Chown will do it for us.

As root in the terminal use this command:

chown -Rf andrzejl:andrzejl /media/Data_Disk_1

and press [ENTER]. Of course You need to change andrzejl to Your username and the path to the data drive to match Your mount point.

Type in:

free -m

and press [ENTER].

You will notice that Swap is not mounted. We need to fix this.

I will use mcedit to fix this issue – You can use Your favorite file editor as root to amend the file.

mcedit /etc/fstab

and then I am adding the line below the sda1 entry lines.

# Entry for /dev/sda5 :

and below it

UUID=uuidoftheswappartition swap swap defaults 0 0

How to find out what’s the uuid of the swap partition?

Run blkid as root in another terminal…

After properly amending the file save it by pressing [F2].

and close the editor by pressing [F10].

Now reboot.

There should be no delay in the boot time. Swap should be mounted. You should be able to access the drive labeled Data Disk 1.

That’s it. All done.

Hope this helps somebody someday.

Andy

P.s. All the screenshots are available here thanks to Cyryl