Library Books

So everytime I get a chance, I go and comb the local library for Python and Linux books. Why? Well, because I would like to know more about Linux, and because I have had a long standing interest in learning Python. Ever since I discovered you could create applications like Lsongs in Python. Lsongs may not be the best music player ever, but it is pretty feature rich, and reasonably pretty. So it got me interested in Python. I will be trying to learn more about Python soon as I just bought a decent book from Amazon on Python.

What I did get recently at the library was Linux For Dummies and Linux Power Tools. Seems silly right? Getting a Dummies book, and a Powertools book? However, the dummies book is about Fedora Core, which I have not used. The last time I tried an RPM distro was Red Hat 6.2 and Mandrake 8.2? Mandrake is now Mandriva, Red Hat now has a seperate free version (Fedora Core) and their Red Hat Products are aimed at Servers and such. So it has been a while. So the Dummy book on Fedora could be interesting. Although, the more I read about RPM stuff, the more I am happy with Debians apt-get and synaptic and dpkg package management for stuff. 🙂

The Power Tools book is all about improving performance and tweaking your system. In the book they talk about compiling your own kernel, different package management for different distros (they talk about Suse, Red Hat, Debian, Mandrake and Slackware throughout the book.) If you ever wanted a bit more in depth knowledge of the differences in distros, this is not a bad book. It has just enough info to be useful, but not enough to make you an expert at anything. 😛

As I read more, I will post more thoughts about it. Just felt like I should post some idea of what I am learning today.

Update

Ok, so Emmy read my entry for the other day, and said,”You really should put a step by step instruction on your blog.” So, I thought about it, and thought she was right. After all, I did link to a lot of places with a lot of good info, but what if those places go away? So, here is a step by step of what I did to recover my dying drive.

  1. Put old drive back in as slave. Make sure you have enough room on your master drive for the entire old drive, freespace and all.
  2. Boot up your main drive. The failing one probably will not mount, that is why you are trying to rescue it, right? However, you will need to know what device it is. If it is actually the slave off the master, it will probably be /dev/hdb something. So goto a konsole and type mount, that will give you a list of all partitions, mounted or not that are available on your system. Find the one you are looking to recover.
  3. Type : dd_rescue /dev/hdb3 /home/mine/Backups/olddrive.img
    The Command, The device, This is the directory you want it backed up to.
  4. Make sure the directory you are backing up to has plenty of space on that partition. If you run out of space, you may not recover what you wanted.
  5. Watch it run… watch it run for a very long time… watch it stop on errors for a long time. Find something else to do.. Watch a movie or 10.
  6. When it finishes, you should be able to do an su or sudo depending what distro you are running. You need access to write to system areas and do admin tasks.
  7. losetup /dev/loop1 /home/travis/Backups/olddrive.img
  8. That will set the image you just created as a loop device.
  9. You will then want to mkdir /media/olddrive or whatever or where ever else you want to reference it.
  10. mount -t reiserfs /dev/loop1 /media/olddrive
  11. You will need to know something of the mount command, and what file system type you have. With Linspire, it was Reiserfs. Also, you can exit the console at this point if everything was successful.
  12. I was then able to open /media/olddrive in konq and see everything from my old drive and copy it off. I love Linux and ddrescue!

I hope this helps someone as much as all those other references helped me. At the very least it gives everyone one more place to possibly find what they need to know to save some important data! For good measure, here is another picture I recovered!

Me on a rope swing!

Hard Drive Recovery.

So normally I am pretty good about backing things up. You know, burning a CD here and there of important stuff can be all the difference between having what you need and losing something important. Well, about two years ago, I slipped. For about one month, I did not backup. I paid for it dearly. My kids were here visiting for that month, and I had all the digital pictures for that month on my Linspire hard drive. I got distracted, and did not do my backups, or even copy files between me and Emmy which we often do.

One day, as my computer was booting, it told me Smart had detected my hard drive was failing, please replace it as soon as possible. I thought,”Oh crap!” I then proceeded to see if it would boot. It didn’t. It could not mount the partition that had all my data. I was running a Linux distro called Linspire. They use what is called Reiserfs for a file system. At the time, I had No clue on how to go about rescuing anything on the hard drive. So I stuck it away, and every once in awhile look at it and think,”I wish I could rescue my stuff off that drive.” 🙁 I even thought about tossing the drive at one point figuring it was shot.

Recently, I have started playing with other versions of Linux again. Nothing against Linspire, in fact, I really think Linspire is a nice easy version of Linux.. In fact, to easy. I got lazy, and was not learning how to do a lot of the stuff I was once learning so quickly.. In fact, I found myself forgetting a lot of what I had known about linux at one point. You see, I have been using Linux to one extent or another since 94 or 95. My father and I setup a Slackware server that we used at our office, and one that we used at home so Emmy and I could both play our favorite MUD through one dialup internet connection. Anyways, as you can imagine, over the years, I have played with Linux a lot.. but never completely figured it out. So I am learning new and interesting things about it all the time.

Well, recently, I finally stumbled across something mentioning how to go about recovering stuff from a partition that has become corrupted. I thought,”Ah ha! I bet I can use this to save those photos and stuff I lost a couple of years ago!” So I went searching for more info. If you read that other article, you might think,”What else ya need to know? That seems to cover it pretty good!” Well, I have always been the type who would rather be overly informed. With the photos and stuff on that drive, I have always kinda thought, when I try to recover that stuff, I need to get it right the first time, cause that drive will die about the time I plug it back into my computer.

So anyways, I decided to go research a bit, and went looking for more information. I found such articles as this and this. Finally, I stumbled across this blog. At this point, I started feeling like I had a chance of actually rescuing my precious pictures. So I started reading about dd_rescue. I am now running Mepis 6 Linux. Which is based on Ubuntu. So the directions that I found seemed fairly useful and complete.

So I dug out that old drive. It is an old Western Digital 40 Gig drive. Nothing special, and at this time, almost worthless, except for the data on it. The data, like I said before, is priceless to me. Anyways, when it first started failing and I could not get it to boot, I just took it out of the computer and stuck it away in my desk. It has not been fired up since. So I took it out, hooked it up as a slave in line with my main 120gig Mepis Drive. I then ran dd_rescue on it using the command:

dd_rescue /dev/hdb3 /home/mine/Backups/linspire.img

At first, it barely seemed to be doing anything.. Some numbers come up on the screen, but it kept stopping for long periods of time.. At first I thought the drive was so far gone that it was dying in process, after all, that is basically what kept happening when I tried to mount it. So I actually stopped it after about 10 minutes because I was convinced it was not working. Then I checked the linspire.img file, and what do you know, it was over 2 mb big. That does not seem like a big deal, but was 2mb of that stuff I did not have before. It let me know it was doing something! So I reran the same command again, and let it go. I soon came to realize that it was going through sector by sector and writing all the data it could get to the linspire.img file. Everytime it got to an error, it would pause a while and try to read it. As it got further in, it started to speed up a bit. By the time it was done, I think it took like 14-16 hours to recover the 37 gig partition. I had over 4000 errors, and the 37 gig partition was only 36 something now. However, I followed the instructions on the Ubuntu Blog, the only difference being, since I am in Mepis, and not Ubuntu, I was able to just su over to the root account and just run all those commands nice and easy instead of of sudoing them. Not a big deal, but my preference. By the time it was done, I actually recovered the pictures! In fact, the ones I was most worried about was our Canoe Trip down the Weeki Wachee River.

Here is a picture of 3 of my favorite people in the world from that trip!

Picnic Picture.
I am so thrilled I have finally managed to recover the stuff off this drive, and at this point, I have a backup of the entire thing! So even though the drive has now pretty much completely failed, I can pull whatever I want whenever I want from my backup img. I love Linux! I dunno how many times I lost small amounts of data because of MS Windows! Remember, always backup your data regularly, and if you can, use Linux and other MS alternatives. Firefox is a great place to start!