I'm a long time vi/vim user. I don't know that I'd recommend anyone who doesn't already know vi go through the heavy learning curve necessary to become proficient at using vi. There are a number of gui editors which are more easier for new users to learn. However vim (vi improved) is available on very nearly any computing platform you might use. I also find that vim allows me to accomplish some pretty complex editing operations faster than most of my former coworkers using other editors. Having used vi for over 20 years now, I have yet to find an editor which would make me more productive and believe me I've looked. I'm constantly searching for new programming tools in my spare time.
I've been looking for a decent port of vim for the Mac for a while now. The version pointed to by vim.org always seems to lag behind a version or two. It also has a few deficiencies. It used to have screen draw problems and would leave pixel residue behind after scrolling. It also never handled the "-" command line argument properly. This argument causes vim to read its data from stdin which is very handy for piping output from other commands into vim for easier manipulation.
My search is over. The team at Google Code has created a great port of vim for the Mac they call MacVim. It's fast and features none of the problems I'd experienced with other ports. Thanks guys for a great porting job!
This blog gives me a place to comment on things which strike my fancy, hence the title. Topics may include computer software/hardware, science, space, beer, books/movies/television programs of a geeky nature, or almost anything else. It is not marked as containing adult content but be warned that I occasionally post about beer and sometimes forget to watch my language. I've been writing systems software since the days of core memory, paper tape, and front panel lights/switches.
Friday, July 25, 2008
Sunday, July 20, 2008
Data recovery, part two
I've managed to recover a fair number of files from my stepdaughter's failing hard disk. You might recall I used a program called dd_rescue to do a raw copy of the sectors of the failing hard drive to an image file on a larger USB hard disk. That was important because the old hard disk seemed to be getting progressively worse, as hard disks which have experienced a partial crash are wont to do.
There was good news and bad news regarding the copy. The good news was dd_rescue managed to copy about 33 GB from the 60 GB drive before encountering constant errors. The bad news is that left about 27 GB of data which hasn't yet been recovered.
Next, I used a handy (and free) program called PhotoRec to recover photos and a number of other data types from the partial image of her drive. All told, it found about 4000 jpg files large enough to be her pictures. Some of them probably come from a browser cache but a good deal of them are vacation photos which she'd be pretty upset to lose.
So far it's been at least a partial success. I'll post more if there are significant updates in the future.
By the way, let this be a reminder to you to go back up your data. Hard disks sometimes fail with no warning and not all drives fail gracefully enough to allow some data to be recovered.
There was good news and bad news regarding the copy. The good news was dd_rescue managed to copy about 33 GB from the 60 GB drive before encountering constant errors. The bad news is that left about 27 GB of data which hasn't yet been recovered.
Next, I used a handy (and free) program called PhotoRec to recover photos and a number of other data types from the partial image of her drive. All told, it found about 4000 jpg files large enough to be her pictures. Some of them probably come from a browser cache but a good deal of them are vacation photos which she'd be pretty upset to lose.
So far it's been at least a partial success. I'll post more if there are significant updates in the future.
By the way, let this be a reminder to you to go back up your data. Hard disks sometimes fail with no warning and not all drives fail gracefully enough to allow some data to be recovered.
No-name router problems
I spent part of this morning doing some remote troubleshooting of a problem my in-laws were having with their broadband connection. Their broadband provider supplied a no-name router. Somehow it had decided that my wife's laptop had made too many outbound connections and therefore must have a virus. Once having decided this (and quite erroneously so), this poorly designed router continued making this assertion even when her laptop was no longer plugged into the router. In fact it seemed completely unable to determine which were active computer connections and which had timed out. Its status page listed two computers which didn't match any computers currently connected to the network nor had there been any such computers connected that my in-laws could remember.
You might wonder how I could determine that the complaint about too many outbound connections was erroneous beyond the shadow of a doubt. I simply enlisted the use of the "netstat" command. The netstat command exists in all major OSes (Windows, MacOS, Linux, and BSD). It allows you to determine the state of network connections for the computer on which you execute the command. Using the "-b" option allowed us to see which programs had open connections. As I suspected, only iTunes, Thunderbird, and Firefox had network connections and none of the three applications had an unusual numbers.
And yet this silly router continued complaining about the number of outbound connections from this one computer even when the computer was disconnected to the network and through several power cycles of the router. So I walked my stepdaughter through the procedure to disable this poorly implemented portion of the firewall (the detection of number of outbound connections) because it obviously wasn't working properly.
My advice is to stick with a name brand router (Linksys or Netgear) whenever you're presented with the option. Sadly since this router was supplied by their ISP, they don't have a choice in the matter. Using a no-name router may cost you more than any initial cost savings realized by purchasing a cheap device in the amount of troubleshooting time you spend on poorly implemented features such as this one.
You might wonder how I could determine that the complaint about too many outbound connections was erroneous beyond the shadow of a doubt. I simply enlisted the use of the "netstat" command. The netstat command exists in all major OSes (Windows, MacOS, Linux, and BSD). It allows you to determine the state of network connections for the computer on which you execute the command. Using the "-b" option allowed us to see which programs had open connections. As I suspected, only iTunes, Thunderbird, and Firefox had network connections and none of the three applications had an unusual numbers.
And yet this silly router continued complaining about the number of outbound connections from this one computer even when the computer was disconnected to the network and through several power cycles of the router. So I walked my stepdaughter through the procedure to disable this poorly implemented portion of the firewall (the detection of number of outbound connections) because it obviously wasn't working properly.
My advice is to stick with a name brand router (Linksys or Netgear) whenever you're presented with the option. Sadly since this router was supplied by their ISP, they don't have a choice in the matter. Using a no-name router may cost you more than any initial cost savings realized by purchasing a cheap device in the amount of troubleshooting time you spend on poorly implemented features such as this one.
Sunday, July 06, 2008
Recovering data from a failing hard drive
I've been trying to recover the data off a failing hard drive for a family member. I've found a few programs which claim to be able to do just that but they always get hung up by the numerous retries the drive keeps doing in the failing areas. Then I came up with the idea of using the dd command to make a copy of drive image which I could then manipulate having gotten the retries out of the way during the initial copy process. I'd used dd pretty heavily during the development of an SD card driver I'd done at my last company. Once the drive image has been copied to a file, the resulting image file can be mounted using the mount command... well it can on Linux and Mac OS X at least. You poor folks running Windows are out of luck.
After looking around on the web, I discovered a great little program called dd_rescue which does intelligent retries if errors are encountered, slowly lowering the block size being requested to find the boundaries of the affected area. I think the standard dd command would try to do retries until the read worked or until the copy was aborted. dd_rescue also allows an offset to be specified when the command is invoked so the copy may be done in several stages. Since it's taken about 4 hours, off and on, to copy the first 33 GB from the failing 60 GB drive, I'm anticipating having to make heavy use of this feature to complete the copy process over the next day or two.
I made a few minor changes to the source to allow me to curtail the retries to speed up the copy. So far it's copied about 32 GB from the failing 60 GB drive. Once the data has been copied then I'll start trying to recover files from it. Wish me luck, I think I'm going to need it!
After looking around on the web, I discovered a great little program called dd_rescue which does intelligent retries if errors are encountered, slowly lowering the block size being requested to find the boundaries of the affected area. I think the standard dd command would try to do retries until the read worked or until the copy was aborted. dd_rescue also allows an offset to be specified when the command is invoked so the copy may be done in several stages. Since it's taken about 4 hours, off and on, to copy the first 33 GB from the failing 60 GB drive, I'm anticipating having to make heavy use of this feature to complete the copy process over the next day or two.
I made a few minor changes to the source to allow me to curtail the retries to speed up the copy. So far it's copied about 32 GB from the failing 60 GB drive. Once the data has been copied then I'll start trying to recover files from it. Wish me luck, I think I'm going to need it!
Subscribe to:
Posts (Atom)
-
A long time ago I was given a bit of advice that has served me well over the years. An engineer with much more experience than I had at the...
-
We lost our very special dog to an osteosarcoma a few days ago. He started limping a little over 4 months ago and it took a while to dia...
-
Most of the longtime Unix users like me love grep. Regular expressions make the silly wildcards available in Windows seem completely underw...