Copying / Replicating your Linux Install to a Different Hard Drive

I’ve had my current Linux install on a 300 gig drive for over a year now while my previous system was on a 500 gig drive, along with an ancient copy of Windows XP.  That drive has been laying around collecting dust.  I’ve been wanting to “copy” it over to
this larger drive.  My initial thought was to “replicate” my current disk over to it the way I did it in this previous post:  “How to Clone a Dying Hard Disk.”  This however, would’ve wiped the Windows XP partition, which came with my computer that I just haven’t quite brought myself to do (I might want to compile some Windows binaries with it with PAR, and for whatever reason, I’ve never been able to get ActivePerl to install on my other Windows 7 installation after several attempts).  Anyway, I was looking for another way to just copy individual partitions, rather than the entire drive.  Here’s what some research suggested and what I was able to get to work (YMMV! – WARNING: MANIPULATING PARTITIONS IS INHERENTLY DANGEROUS, A MISTYPED COMMAND CAN INSTANTLY DELETE YOUR DATA!  I can NOT guarantee that these steps will work for you in your situation, I can only state here from memory what worked for me!  I’m not responsible if this does not work for you, so if you are not comfortable attempting this, then DON’T!):

0)  (Optional, informative) Check if your running distro is fully up-to-date with packages, update anything that you need/want to update. Do hdparm -i; -I; -t; and -T commands writing out the results, save ’em to compare to your new drive if you want to compare the performance of the two disks.

1)  Boot up into a LiveCD and use GParted to (re)create and format partitions, MAKING ABSOLUTELY *SURE* YOU SELECT THE *NEW* DISK EACH TIME!!!!!!!! Also make sure your LiveCD didn’t mount anything (if so UMOUNT it!)

2)  Try using GParted to copy the old partitions to the new ones one at a time.
(MAKE SURE YOU SELECT YOUR EXISTING PARTITION(S) FIRST to copy, then paste into your NEW drive!)

If this fails (or GParted won’t let you paste) for a partition, try (as root with NEITHER mounted):

     e2image -ra -p /dev/sd<FROM> /dev/sd<TO>

Failing this: try mounting the first as readonly (mount -r), then the 2nd as read/write, and do:

     cp -afv /mnt/sd<FROM>/* /mnt/sd<TO>

Yes, this DOES copy symlinks, etc. AND preserves ownership, permissions, and timestamps!

3)  Get the UUID’s of your NEW partitions using:

     ls -l /dev/disk/by-uuid

and save this in a text editor/file somewhere.

4)  Mount your NEW (copied) root partition, and edit your NEW /etc/fstab, /etc/mtab, /boot/grub/menu.lst, and ALL files within /etc that contain “UUID”, since they ALL need to be changed.  Each old UUID needs to be changed to the UUID of the corresponding partition that it was copied to!  ALSO make sure you fix your menu.lst file to the NEW hd(0,#) for the new partitions your kernel(s) are in!!!  If you are moving to a disk that already has Windows on it from one that doesn’t, you’ll for sure have to change the “#” above AND add this to your NEW /boot/grub/menu.lst file

For Windows XP:
     title Microsoft Windows XP Professional
     root (hd0,0)
     chainloader +1

For Windows 7:
     title Microsoft Windows XP Professional
     title Windows 7
     hide (hd0.0)
     rootnoverify (hd0,1)
     chainloader +1

5)  Power down, REMOVE your old disk drive, make your new one primary, and try booting.  Most likely it won’t work, but no harm in tryin’!

6)  Power down and reboot in your LiveCD, and do as root:

     mkdir /mnt
     mount /dev/sd<yourNewRootPartition> /mnt
     mount --bind /dev /mnt/dev
     mount --bind /proc /mnt/proc
     mount --bind /sys /mnt/sys
     chroot /mnt

This makes your new hard-drive installation your “root” (/)!

     cd /boot

Select a SINGLE linux kernel you want to boot that isn’t working and do (as root):

     update-initramfs -k <version> -v

EXAMPLE where <version> is 4.0.0-antix.1-486-smp, if your chosen kernel is: vmlinuz-4.0.0-antix.1-486-smp

7)  Update-grub:

     >find /boot/grub/menu.lst
     >root (hd0,#)      <-based on output from find!
     >setup (hd0)

8)  Update-grub Again, just to make sure!

     grub-install      (if you're SURE grub's still broke AND you're SURE you're installing to MBR)

9)  Remove LiveCD, reboot selecting the kernel you did the update-initrams command on earlier (others likely won't boot) & do sign of the cross!

10)  After successfully booting into a linux kernel, go repeat the update-initrams you did earlier on each kernel, else removing any you don't need.

11)  Reboot into Windows (if you have it) to make sure it's ok.

12)  Reboot into your preferred production kernel!

Helpful links:

Copy Your Linux Install to a Different Partition or Drive, by (©) Ningappa Koneri, Linux Journal, July 9, 2009.
chroot to repair GRUB - How does it work?, by (©) Ubuntu Forums, Feb. 21, 2011.

RED ALERT! Time To Go On Defense (In Stocks)!

Flashing Emergency LightsBears WrestlingI have been watching the stock market for several months looking for a “top” to form sometime late this year as the current bull market in equities is now over six years old.  For this entire year we’ve seen the market stuck in a sideways trading range between S&P 2040 and 2140.  This has been the longest such period in the last hundred years.  I’ve been watching for two diametrically opposed potential endings for this pattern while noting that there had not been a serious correction in recent times.  The bullish case is that this has been a “rolling correction” taking the market to the bottom of a longer term trend channel that, when the correction completed the market would resume higher going into Autumn, most likely when there would be more clarity on the direction of interest rates and in the Greek, et. al. debt situations.  Furthering this case has been the lack of bullish / mania sentiment that usually accompanies a major market top.  The bearish case is that the market, particularly breadth was tiring and that repeated failures to break out would eventually lead to a breakdown.  Furthering this case is the looming debt bubble, the fact that true long-term economic growth is nearly impossible under currently socialist policies worldwide without near-zero interest rates and central bank stimulus to prop up financial assets.

Elliott Wave theory has also been presenting both these patterns for several months now as I’ve been waiting for the market to select one of the conflicting patterns, something the market has been extremely reluctant to do all Summer.  As recently as a week ago, I was reasonably confident that the bullish pattern was going to temporarily prevail into the Autumn, but now the market has finally and clearly chosen the bearish course as of this Thursday, having broken critical support at 2040.  In fact, it not only broke support, it smashed it and followed through massively Friday to paste a nasty “19-handle” on our backsides Friday closing at NINETEEN-71!

D Fense
image courtesy (©) “Going Like Sixty
As a retiree fearing the possibility of this happening, I sold some non-taxable holdings to cash over the last month while staying mostly invested against what I felt was the more likely bullish scenario playing out.  Now, however, I am and am advising SELLING ALL non-taxable stock holdings to cash, with maybe some into bonds, along with at least half of one’s taxable holdings to avoid the potential of a deep correction to at least 1800, or worse, a new bear market.  Whatever I do not plan to sell Monday, I will be looking to sell on any short term bounces as I believe 2040 is now strong resistance!   While I base most of this on technical indicators (Elliott Wave, etc.), I also have some non-technical, non-scientific “gut instincts” that suggest that September could be a major turning point in the current global financial and political situation.  First, there is the IMF that seems to be preparing for a global move away from the Dollar as a reserve currency, possibly replacing it with it’s SDR currency and gold selling off to very attractive levels and nearing a major, major bottom.  There’s also the Shemitah.  While I don’t put a lot of stock in these types of indicators, it does seem to line up well with more technical data that I do follow.  In short, just about EVERYTHING is flashing RED!  One thing I am looking to continue to purchase a few more of is gold and silver coins, particularly circulated U.S. silver coins minted 1964 and earlier.  These are currently trading around 15-16X face value!   Below are some recent charts and articles from several people I have grown to respect for their usually timely investment information that has helped me avoid major losses in the past.

Chart on S&P 500 (INX) for Sunday August 16th 2015
Article and Chart on S&P 500 (INX) for Sunday August 16th 2015, by (©) Avi Gilbert, Elliott Wave, via
S&P 500 Daily Bars, by Simon Maierhofer, July 30, 2015
Recent Profit Radar Report S&P 500 Calls, July 30, 2015
Secret Sauce Chart, by Simon Maierhofer, August 13, 2015
Deep Tissue S&P 500 Analysis, August 13, 2015
Articles and charts by (© 2015) Simon Maierhofer, via iSPYETF.
Nested ABCD Structures Trying to Trigger Lower, by (©) L.A. Little
Stock-market technicals suggest a breakdance lower
Turns Bearish and Breaks Multiple Swing Point Lows, by (©) L.A. Little
Ugly stock-market action may result in attractive buy opportunity
Articles and charts by (© 2015) L.A. Little, via
Market Alert: We Have Reached Our Sell Trigger“, Aug. 21, 2015, by (©) Ken Moraif,  I’ve been following this guy for many years now.  His ability to avoid bear markets is uncanny. Market timer Tom McClellan sees stocks set up for ‘ugly decline’“, Aug. 17, 2015, by (©) Tomi Kilgore, via  This guy called it two days before it began, to the (earliest) day!

Lenovo / IBM Scrollpoint Mouse with Smooth & Horizontal Scrolling in Linux

Lenovo Scrollpoint Mouse
IBM Scrollpoint Mouse“, by Lenovo
After all these years (over 10), I finally stumbled upon a Linux driver for my IBM Scrollpoint Mouse that actually supports horizontal scrolling – BOOYAH!!!!!!! :D  I’ve had this beautiful little mouse with the glowing blue scroll button for years and had it fully working under Linux EXCEPT that I could not use the little blue, lit-up scroll pushey-thingy to scroll horizontally.  Scrolling vertically worked so-so (a bit too sensitive/jerky/fast) by default.  It appears to have three different sensitivities in the vertical axis so that if you push gently, it scrolls slowly, then speeds up as you push harder (up or down).  It’s much easier for quick scrolling than having to sit and spin a wheel hard!  Now I feel this would be the perfect mouse, if Lenovo would just make a WIRELESS version!

I had tried to pay a C-programmer friend years ago to write me a driver for it (to no avail) and even considered trying to figure out how to hack one up myself to support this, but I knew it would likely turn into a huge project with a very steep learning curve.  Besides, I really didn’t want to go to that extreme anyway.  Every few years I’ve googled around to see if anyone else had already found a way to get it to work, and today I finally got a hit!  (at  It’s a kernel driver called “hid-scrollpoint”, written by Peter De Wachter.  (Thank you Mr. De Wachter!)  You’ll need to download all three files (a Makefile, a C header file, and a C source file) from the first link mentioned above, on GitHub!  You will also need to install your kernel headers to build.  NOTE:  If you don’t care about horizontal scrolling and just want smooth vertical scrolling and use of all three buttons, then just skip all this and do only steps 2 and 5 below.

1)  Put these three files in a subdirectory and then:

    $>sudo make modules_install
    $>sudo depmod -a
    $>ls -l /lib/modules/`uname -r`/extra/hid-scrollpoint.ko

This should put the new kernel driver “hid-scrollpoint.ko” in the proper place (/lib/modules/`uname -r`/extra/) or somewhere nearby.

2)  You’ll need to create a file in /etc/X11/xorg.conf.d/ You can name it anything, but I chose: “ibm_scrollpoint.conf”.  It should contain:

    Section "InputClass"
       Identifier "ScrollPoint"
       MatchUSBID "04b3:3100|04b3:3103|04b3:3105|04b3:3108|04b3:3109"
       Option "VertScrollDelta" "16"
       Option "HorizScrollDelta" "16"
       Option "AccelerationProfile" "2"

I later added the optional “AccelerationProfile” line to speed up the mouse a bit when moving it fast – see  You can also tweak the “16” values later if you like, though these defaults seem to work very well for me.  After creating this file, or adding this section to your /etc/X11/xorg.conf, you’ll need to restart X for this to take effect.

3)  Plug in your IBM/Lenovo USB Scrollpoint mouse and do:

    $>lsmod | grep "hid"

You should see at least these three drivers (loaded in order from bottom up):

    hid_generic 907 0
    hid_scrollpoint 1168 0
    usbhid 33909 0

If not, do:


and look for a line like:

    Bus 003 Device 012: ID 04b3:3108 IBM Corp. 800dpi Optical Mouse w/ Scroll Point

If the pair of four-digit hex numbers you find there (mine are 04b3:3108, but ymmv!) isn’t in the “MatchUSBID” line you added, then modify that line to include them and restart X.  If still no go, make sure you ran “depmod -a” as root and that the file “hid-scrollpoint.ko” got installed, see if you can do a “sudo modprobe hid-scrollpoint” without error, then reboot and restart X!  If modprobe says he can’t find “hid-scrollpoint” after running “depmod -a”, reboot and try modprobe again.

4)  There’s one more issue you’ll likely run into: By default, my system likes to load the “hid_generic” module before “hid_scrollpoint”.  If that is the case for you, then you’ll see this when you run the aforementioned “lsmod” command:

    hid_scrollpoint 1168 0
    hid_generic 907 0
    usbhid 33909 0

In this case, you’ll have to find some way to force “hid_scrollpoint” to load FIRST.  I did it in my startup.  NOTE: It does NOT seem to hurt to go ahead and load both of these in the right order using “modprobe” at system startup even if the mouse is not attached at startup, ie. with a laptop / or if switching between other mice.  Also, once loaded in the proper order, they fortuitously remain loaded even after unpluging the mouse and / or switching to a different USB mouse, nor does it seem to affect my touchpad or trackpoint (I have both on my Dell Latitude D620 laptop).  After having the drivers in the right order and then starting X, both horizontal and vertical scrolling should work smoothly in applications, such as Firefox, that support it, ie. have horizontal scrollbars.  You can adjust the numerical parameters for “VertScrollDelta” and “HorizScrollDelta” to something other than “16” if you want faster / slower scrolling!  Running “xev” should also show the scroll events as buttons 4 and 5 (vertical) and 6 and 7 (horizontal)!  I also did not have to change any of Firefox’s default scrolling options.

5)  You must RESTART X or REBOOT!:

If the drivers are in the wrong order, then horizontal scrolling will not work.  Anyway, here’s my /var/log/Xorg.0.log file showing the pertinent lines and how they should look (ymmv):

[ 24191.151] (II) config/udev: Adding input device HID 04b3:3108 (/dev/input/event1)
[ 24191.151] (**) HID 04b3:3108: Applying InputClass "evdev pointer catchall"
[ 24191.151] (**) HID 04b3:3108: Applying InputClass "ScrollPoint"
[ 24191.151] (II) Using input driver 'evdev' for 'HID 04b3:3108'
[ 24191.151] (**) HID 04b3:3108: always reports core events
[ 24191.151] (**) evdev: HID 04b3:3108: Device: "/dev/input/event1"
[ 24191.202] (--) evdev: HID 04b3:3108: Vendor 0x4b3 Product 0x3108
[ 24191.202] (--) evdev: HID 04b3:3108: Found 3 mouse buttons
[ 24191.202] (--) evdev: HID 04b3:3108: Found scroll wheel(s)
[ 24191.202] (--) evdev: HID 04b3:3108: Found relative axes
[ 24191.202] (--) evdev: HID 04b3:3108: Found x and y relative axes
[ 24191.202] (II) evdev: HID 04b3:3108: Configuring as mouse
[ 24191.202] (II) evdev: HID 04b3:3108: Adding scrollwheel support
[ 24191.202] (**) Option "VertScrollDelta" "16"
[ 24191.202] (**) Option "HorizScrollDelta" "16"
[ 24191.202] (**) evdev: HID 04b3:3108: YAxisMapping: buttons 4 and 5
[ 24191.202] (**) evdev: HID 04b3:3108: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 24191.202] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-8/3-8.2/3-8.2.2/3-8.2.2:1.0/0003:04B3:3108.0008/input/input20/event1"
[ 24191.202] (II) XINPUT: Adding extended input device "HID 04b3:3108" (type: MOUSE, id 9)
[ 24191.202] (II) evdev: HID 04b3:3108: initialized for relative axes.
[ 24191.203] (**) HID 04b3:3108: (accel) keeping acceleration scheme 1
[ 24191.203] (**) Option "AccelerationProfile" "2"
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration profile 2
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration factor: 2.000
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration threshold: 4
[ 24191.204] (II) config/udev: Adding input device HID 04b3:3108 (/dev/input/mouse0)
[ 24191.204] (**) HID 04b3:3108: Applying InputClass "ScrollPoint"

UPDATE NOTE:  If you upgrade your kernel (and headers) the horizontal scrolling will quit after rebooting!  You’ll need to do the following once, the first time after upgrading and rebooting:

    Repeat Step 1 above.
    Reboot -OR- do the following:
    Unplug the mouse.
    $>sudo rmmod hid_generic
    $>sudo modprobe hid_scrollpoint
    $>sudo modprobe hid_generic
    Plug the mouse back in.
    Restart X

Two new CPAN modules: Tk::HListbox and Tk::HMListbox

I am pleased to announce the release of two new Perl/Tk modules to CPAN: Tk::HListbox and Tk::HMListbox! I created these to enable my custom Perl/Tk file-manager to support an additional column of icons representing the type of file being displayed.

Tk::HListbox is a drop-in replacement for the classic Tk::Listbox widget that is based on Slaven Rezic’s Tk::HList providing the ability to use images in addition to or in place of text strings in a “Listbox.” by providing a “Tk::Listbox” interface to Tk::HList.

Tk::HMListbox is a drop-in replacement for either Tk::SMListbox or Tk::MListbox based on Tk::HListbox instead of Tk::Listbox. This composit widget provides all the features of Tk::SMListbox plus the added features of Tk::HListbox allowing the ability to use images in addition to or in place of text strings in the tied listbox columns.

My next goal is to get JFM4 bundled up into a proper CPAN package and release it soon!  I wrote JFM4 several years ago using Rob Seegel’s Tk::MListbox, since I never found another file-manager in Linux which I liked.  Here’s what I want above and beyond what other file-managers offer:

  • Customizable to allow me to not only have a default program to launch / action to take when double-clicking on a file, but also a right-click drop-down list of alternate programs / actions to take on a particular file type, which I could add program options to on the fly!
  • Ability to choose a file from both panels for certain actions (in a custom “Actions” menu), specifically for programs like “mgdiff” (a graphical file comparisen program).
  • A file-manager that could take advantage of my Net::xFTP module so that I could have both local and networked file-systems displayed!
  • Ability to compose commands, with wildcards in a “command-line” to run as one-offs, optionally to selected files, and save my recent ones in a drop-down list for repeating.
  • I also wanted the ability to right-click on a directory and have a drop-down list of programs / options to apply to a directory, just like a file-type.  This was for programs that can open directories, such as GQView and Audacious.
  • Ability to type in a Perl regular-expression and reduce the file listing down to matching files.
  • Customizable drop-down list of file-types to reduce the file listing down to matching files.
  • Combined tree and row-listing of files in a given local (or networked) file-system.
  • One-button option to show / hide hidden files.
  • Dropdown lists of named, frequently-used directories, and recently chosen directories.
  • Ability to capture (or ignore) STDOUT and STDERR output from programs launched / actions taken.
  • Work on Windows and Linux.

Suffice it to say, I haven’t come across another file-manager that gave me all these desired features!

Soon after I created JFM4, I created Tk::SMListbox to provide sortable columns with up and down arrows indicating which column the files were sorted by.  I was content with this for personal use for years, but never got around to releasing it publicly.  Probably because it did not support the cute little icons that pretty much every OTHER file manager offers these days, though I was happy with it.

JFM4 File Manager, written in Perl/Tk“; May 28, 2015;  image by (c:2015) me.

Fighting with my Camera

Sun sets on the Baker“; April 7, 2015 (70mm 1/2500” f4.5 iso100, cropped, greyed out for text)  image by (c:2015) me.
This last month I’ve been fighting with my camera, which has now been to the repair shop twice in the last six months due to an aperture control issue that presents as random very dark underexposures. The first time they repaired it, they told me they had to take it completely apart and clean some magnets that were sticking deep within the bowels of the camera. This time they said they had to do the same thing, but that they “were more meticulous” about it! me:HUHWTH (why didn’t you be that “meticulous” the FIRST time?! They said that this was somewhat common with my particular camera model (Pentax K-30), but I was the FIRST one that had had to come BACK. :-/ Anyway, they jacked up their price for this “service” from $169 to $199, but gave me a “discount” back to $169 – Hmmmmmmmmmmmmmmmmmmmmmmmm. Anyway, this is “strike TWO” for this cam, which is <2 years old, so if this happenz again, I’m (very likely) removing the lens and throwing this thing against a brick wall and getting a new, DIFFERENT camera! This is sad because I really do like this camera (otherwise).

I ended up shooting the annual LTC DFW (“Leadership Training for Christ” interchurch convention) for our church using my old Pentax K-x, which made things difficult. The K-x’s autofocus motor is kaput (meaning manually focusing) and I didn’t realize how dependent I had become on my current camera’s dual-dials and “TAv” mode for shooting indoor stuff! That special Pentax mode allows me to set both shutter and aperture with the dials while the camera then selects a proper ISO within an preset range. This is very handy for moving subjects indoors! With the K-x I had to somewhat guess a reasonable ISO, so that Av mode would get me proper DOF and a high enough shutter speed to handle the subject’s movement. The result was I took fewer photos and got even fewer keepers, but did manage to have a successful shoot!

I decided to take my K-30 out on a short shoot at Mineral Wells State Park with the local camera club just afterwards, when it seemed to be working a bit better, but that was a bad idea.  I spent the whole time struggling to get shots that were not nearly black while everyone else had a great time with their big heavy Nikons and Cannons.  I faked smiles and having fun while inside, I was grumpy and ready to fling my camera as far as I could throw it.  Fortunately, I did manage to get several good shots (usually having to take 3-4 to get one to turn out right), but that’s when I made up my mind to take it back to the shop.  This included a couple of great candids for which the camera did manage to work.  It’s now back and working properly now, for the moment at least.  I would love to get a K-3, but they are expen$ive since they are Pentax’s “flagship” DSLR right now, but should drop a bunch in a few months when Pentax finally releases it’s first 35mm full-frame.  I hope mine can hold out at least until then!

This is also tax season and I finally got ours done. Wifey “audited” them with a fine-toothed comb and found a descrepancy in the software’s calculation of the sales-tax deduction.  I went in fearing I’d have to redo everything manually if I couldn’t get the software to correctly do it, but fortunately when I re-entered everything for that part of it, it came out correct and I regenerated the final forms for printing.  I still do not know why it came up wrong the first time though.

I would really like to take a long road trip, but am having difficulty finding a photography friend who’s not working to drive with.  If I go alone, I will have to stop and spend the nights alone in crappy little motels that still cost $$$ (where I won’t sleep well anyway).  This I absolutely hate! Anything nice and confortable will cost $$$$, but with a partner would only be $$!


Get every new post delivered to your Inbox.

%d bloggers like this: