Wednesday, December 29, 2010

Linux to the Rescue: Data Recovery

I had a user bring a machine running Windows to me earlier today that wasn't working right. I did something that I've done a bunch of times before to recover the data off of it. Here's what I did.

First I took a live Linux boot disk (I typically use OpenSUSE) and booted from it.

Once it's booted fire up a terminal. Using the live KDE version of OpenSUSE I pressed Alt-F2 and typed 'konsole'. Once the terminal is up type:

cd /dev



look for sdaX where 'X' is number. These are partitions on the first hard drive. If there's more than one hard drive in the machine check sdb, sdc, and so on. In the case from this morning there was an sda1 and an sda4. Being a Windows XP laptop sda1 was the primary partition on the first hard drive and sda4 was the 'recovery' partition put there by the people who put the laptop together. So what we've got to do now is mount that primary partition so we can get at the data. First I needed to created a directory to mount the partition on so I typed:


this made me root. There wasn't a password needed because it was a live disk boot. Then:

md /media/hd

This command created the directory to mount the partition on. The next step is to mount the thing. This I did by typing:

mount -o loop /dev/sda1 /media/hd

This mounts the device /dev/sda1 as a loopback device at the directory that was just created in /media/hd.

Once mounted you can go into the mounted partition and get at the data. So...

cd /media/hd

will show you the contents. Now in my case I had a NAS on the network so I could copy the data off to that. I did this by again pressing Alt-F2 and typing:

dolphin /media/hd

This opened the default graphical file manager in KDE and pointed it at the freshly mounted hard drive partition. In my case the data that I was after was in "/media/hd/Documents and Settings/" so I navigated there. Once there I was able to see the files in the user's Desktop, My Documents, etc. folders. At this point I needed the connection to the NAS so I pressed Ctrl-t to get me a new tab in Dolphin. Then I did Ctrl-l so I could type the address I wanted to access. Again, in my case I typed in


A moment later the NAS responded asking me to enter in the password to access it. I entered it and created a folder by right-clicking-->new-->folder and called in FROM_OLD_MACHINE. Then I went into that newly created folder and flipped back to the first tab in Dolphin where the files that I wanted were. I clicked on the files and folders that I wanted to recover then dragged them to the tab in Dolphin that was showing the folder on the NAS; hovered there for a moment. When it switched over to that second tab I moved the cursor into that folder and let go of the mouse button. I then selected 'copy' and it started copying the files into the folder on the NAS.

As it turned out in this case the fix was relatively straight forward on the Windows side and I didn't need this backup but at least I had it.

Also, I know this wouldn't work if there was something screwie with the filesystem on that partition that I mounted. Never the less, in a large majority of cases where I'm given a Windows machine that won't boot I've been able to recover the data with this method. Even if I do end up having to re-install I've got the data from the original install.

Thursday, December 16, 2010

Time of Use Energy Billing

I just wrote to my MPP Peter Tabuns after hearing about a consultant's report delivered to the Ontario Energy Board that suggested a wider gap between 'On Peak' and 'Off Peak' times. Call me cynical but that sounds like higher on-peak rates rather than lower off-peak rates to me. The print version of the story I heard on the radio can be found at the CBC here.

Hi Peter,
I'm just hearing a story on the CBC's morning show news about a report from a consultant suggesting that there be a greater difference between energy rates depending on the time of use. (

I don't suppose that the intention is to lower the off-peak time?

I'm concerned because like many I'm employed in a job that I don't have much control over what time I show up at so that tends to dictate what time I'm using energy.

It's kinda funny, I seem to remember reading a book that proposed something radical. Public power at cost. Humm, who wrote that... Howard something. Seems like a good idea. Too bad so many throw their votes away by voting Conservative and Liberal.

Anyway, I just felt that I needed to say something after seeing that story.

Keep up the good work.


The book I referenced is Public Power by former Ontario NDP leader Howard Hampton.

Later in the afternoon yesterday I got this reply from Peter's office:

Kevin, thanks for passing this along. The price is like a balloon. You
push in on one side and the other side bulges out. Any price change they
make affects all the others. You are in the same position as many -
their ability to change consumption at key times is really limited. Take
care. Peter

Doesn't really change anything. I guess there's a reason it's called 'peak'; because people are using it. Still, pretty good turnaround time on a random constituent's email.

Saturday, December 4, 2010

Farewell Transit City... We Hardly Knew Ye

Earlier this week the new mayor of Toronto announced that he had killed the plan to vastly expand the city's light rail network called Transit City (see the map below for the proposed routes). All the studies had been done and the shovels had gone into the ground. So instead of bringing rapid transit lines to areas all over the city the mayor has elected to go back to the drawing board and start another study; pretty much guaranteeing that it is going to be years before we get to see any substantial improvements to the public transit system. The preference for subways pretty much guarantees that any expansion will not be as extensive as that called for in Transit City. Personally I find this decision disappointing to say the least. Earlier today I went to the site of construction of the first line to say goodbye to Transit City.

Farewell Transit City... We Hardly Knew Ye