Recovering bad discs in Linux – pt 2

So, maybe in part 1 the data recovery didn’t work for you?

Well, that’s OK because Linux is robust against bad discs in one form or another. The trick is to work out what that might be.

A good method is to use dd or dd_rescue. These tools create a forensic copy of your hard disk drive or partition so that you can mess around with it without affecting the original drive. This is also a benefit as generally a virtual disk will mount and work faster than a faulty disk drive.

To begin with, we need to create that copy of the partition that you need data from.

mkdir ~/myDisks
dd_rescue /dev/hda1 ~/myDisks/hda1.image

The reason that I’m using dd_rescue rather than dd is that seeing as you’re reading this guide, the drive probably has faulty areas of the disk. dd_rescue will work around those quite nicely.

I’m working on the premise that it’s a single partition that you need to recover. If not, you may want to look over at http://edseek.com/~jasonb/articles/linux_loopback.html#id2494145 to read up on ways to read parts of disk images and generally show off.

Right, so we have our image.

Let’s set up the mount point

mkdir /mnt/restore

And now mount the new partition image

mount -o loop ~/MyDisks/hda1.image /mnt/restore

The partition should now mount on the folder. To check if anything is there:

ls /mnt/restore/

You should see a familiar list of files (or if someone else’s drive, one that is not so familiar). You can now copy the files away and do whatever you need to do to the image.

Once finished, unmount the disk image

umount /mnt/restore

Setting up an Oki C5450 in linux with CUPS

I finally completed getting all of my printers working together nicely today.

It’s been a while, but I must admit that while I’m using the Windows XP virtual machine for my office work, the need to print in Linux is not that great.

Oddly, the HP psc 2510 was the first to behave itself. Using the HPLIP toolbox that comes with Ubuntu, I found myself scanning like a demon in no time. The toolbox also seems to scan much faster than the proprietary HP Windows-based driver (and as a bonus doesn’t insist on installing over 100MB of software on your computer).

Anyway, after sorting out some DNS issues I happened to be having, I found it was nice and easy to set up the printer. You’ll need to download the Oki driver from Oki.

  1. Open up your web browser
  2. In the address bar type in http://localhost:631
  3. Click ‘Add Printer’ and enter the name of the printer, and other bits that CUPS asks for. Click ‘Continue’
  4. In the ‘Device’ list, select ‘Internet printing protocol (ipp)’ and click ‘Continue’
  5. In the ‘Device URI’ textbox, enter http://printerip/ipp, replacing printerip with the name or IP address of your printer. Click ‘Continue’
  6. In the Make/Manufacturer, click ‘Browse’ and select the driver that you have downloaded. Click ‘Add Printer’
  7. Click on the printer name, and send a test print to the printer.

As long as all of the settings are correct, the Oki should spring into life.

The web configuration page outlines the valid ipp addresses, but here they are for completeness.

http://hostname/ipp

http://hostname:631/ipp

http://hostname/ipp/lp

http://hostname:631/ipp/lp

Remember to replace hostname with your printer’s network address.